From 9e594f90185de88b8e9c20f8ecaf6030d3ae7f17 Mon Sep 17 00:00:00 2001 From: Eugene Date: Thu, 11 May 2023 00:34:12 -0400 Subject: [PATCH] pad conditioning tensors to same length fixes crash when prompt length is greater than 75 tokens --- invokeai/backend/prompting/conditioning.py | 1 + 1 file changed, 1 insertion(+) diff --git a/invokeai/backend/prompting/conditioning.py b/invokeai/backend/prompting/conditioning.py index f94f82ef72..71e51f1103 100644 --- a/invokeai/backend/prompting/conditioning.py +++ b/invokeai/backend/prompting/conditioning.py @@ -64,6 +64,7 @@ def get_uc_and_c_and_ec(prompt_string, step_count=-1): c, options = compel.build_conditioning_tensor_for_prompt_object(positive_prompt) uc, _ = compel.build_conditioning_tensor_for_prompt_object(negative_prompt) + [c, uc] = compel.pad_conditioning_tensors_to_same_length([c, uc]) # now build the "real" ec ec = InvokeAIDiffuserComponent.ExtraConditioningInfo(tokens_count_including_eos_bos=tokens_count,