aboutsummaryrefslogtreecommitdiff
path: root/modules/textual_inversion
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-03-25 12:36:35 +0300
committerGitHub <noreply@github.com>2023-03-25 12:36:35 +0300
commitdb7caf9b9cb353fdb92f179a02ba71c923e2dcec (patch)
tree93bd1e85103efdb4a2eb8cacf5c022901fd51c43 /modules/textual_inversion
parente5dd5d73357715110c18c1ac31711f3a81b84a0c (diff)
parentc1294d849a50b9b2995aa257adbb918837c4b384 (diff)
Merge branch 'master' into patch-1
Diffstat (limited to 'modules/textual_inversion')
-rw-r--r--modules/textual_inversion/textual_inversion.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/textual_inversion/textual_inversion.py b/modules/textual_inversion/textual_inversion.py
index c63c7d1d..d2e62e58 100644
--- a/modules/textual_inversion/textual_inversion.py
+++ b/modules/textual_inversion/textual_inversion.py
@@ -152,7 +152,11 @@ class EmbeddingDatabase:
name = data.get('name', name)
else:
data = extract_image_data_embed(embed_image)
- name = data.get('name', name)
+ if data:
+ name = data.get('name', name)
+ else:
+ # if data is None, means this is not an embeding, just a preview image
+ return
elif ext in ['.BIN', '.PT']:
data = torch.load(path, map_location="cpu")
elif ext in ['.SAFETENSORS']: