From 98cc6c6e744f454cbbd763033c93a0dceb40c343 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Fri, 30 Sep 2022 14:16:26 +0300 Subject: [PATCH] add embeddings dir --- embeddings/Place Textual Inversion embeddings here.txt | 0 modules/sd_hijack.py | 7 ++++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 embeddings/Place Textual Inversion embeddings here.txt diff --git a/embeddings/Place Textual Inversion embeddings here.txt b/embeddings/Place Textual Inversion embeddings here.txt new file mode 100644 index 000000000..e69de29bb diff --git a/modules/sd_hijack.py b/modules/sd_hijack.py index 5945b7c23..fa7eaeb89 100644 --- a/modules/sd_hijack.py +++ b/modules/sd_hijack.py @@ -232,7 +232,12 @@ class StableDiffusionModelHijack: for fn in os.listdir(dirname): try: - process_file(os.path.join(dirname, fn), fn) + fullfn = os.path.join(dirname, fn) + + if os.stat(fullfn).st_size == 0: + continue + + process_file(fullfn, fn) except Exception: print(f"Error loading emedding {fn}:", file=sys.stderr) print(traceback.format_exc(), file=sys.stderr)