From 94ec8884c3301c6fd6c41d9e71fa1da047765c88 Mon Sep 17 00:00:00 2001 From: DominikDoom Date: Tue, 26 Sep 2023 10:27:50 +0200 Subject: [PATCH] Fix SD.Next error caused by embeddings without filenames This only ignores these embeddings, the root cause is a bug / behavioral difference in SD.Next Fixes #242 --- scripts/tag_autocomplete_helper.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/tag_autocomplete_helper.py b/scripts/tag_autocomplete_helper.py index 0456add..3e0c7ca 100644 --- a/scripts/tag_autocomplete_helper.py +++ b/scripts/tag_autocomplete_helper.py @@ -174,14 +174,14 @@ def get_embeddings(sd_model): # Add embeddings to the correct list if (emb_a_shape == V1_SHAPE): - emb_v1 = [(Path(v.filename), k, "v1") for (k,v) in emb_type_a.items()] + emb_v1 = [(Path(v.filename), k, "v1") for (k,v) in emb_type_a.items() if v.filename is not None] elif (emb_a_shape == V2_SHAPE): - emb_v2 = [(Path(v.filename), k, "v2") for (k,v) in emb_type_a.items()] + emb_v2 = [(Path(v.filename), k, "v2") for (k,v) in emb_type_a.items() if v.filename is not None] if (emb_b_shape == V1_SHAPE): - emb_v1 = [(Path(v.filename), k, "v1") for (k,v) in emb_type_b.items()] + emb_v1 = [(Path(v.filename), k, "v1") for (k,v) in emb_type_b.items() if v.filename is not None] elif (emb_b_shape == V2_SHAPE): - emb_v2 = [(Path(v.filename), k, "v2") for (k,v) in emb_type_b.items()] + emb_v2 = [(Path(v.filename), k, "v2") for (k,v) in emb_type_b.items() if v.filename is not None] # Get shape of current model #vec = sd_model.cond_stage_model.encode_embedding_init_text(",", 1)