From e38d0e39b7779abf37993d20d7c56ebd1dfe8049 Mon Sep 17 00:00:00 2001 From: woweenie <145132974+woweenie@users.noreply.github.com> Date: Wed, 27 Dec 2023 22:14:14 +0100 Subject: [PATCH] fix bug when there are two multi vector TI in a prompt --- invokeai/backend/model_management/lora.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/invokeai/backend/model_management/lora.py b/invokeai/backend/model_management/lora.py index 3d2136659f..066381ac53 100644 --- a/invokeai/backend/model_management/lora.py +++ b/invokeai/backend/model_management/lora.py @@ -215,7 +215,9 @@ class ModelPatcher: text_encoder.resize_token_embeddings(init_tokens_count + new_tokens_added, pad_to_multiple_of) model_embeddings = text_encoder.get_input_embeddings() - for ti_name, _ in ti_list: + for ti_name, ti in ti_list: + ti_embedding = _get_ti_embedding(text_encoder.get_input_embeddings(), ti) + ti_tokens = [] for i in range(ti_embedding.shape[0]): embedding = ti_embedding[i]