pad conditioning tensors to same length

fixes crash when prompt length is greater than 75 tokens
This commit is contained in:
Eugene 2023-05-11 00:34:12 -04:00
parent aca4770481
commit 9e594f9018

View File

@ -64,6 +64,7 @@ def get_uc_and_c_and_ec(prompt_string,
step_count=-1): step_count=-1):
c, options = compel.build_conditioning_tensor_for_prompt_object(positive_prompt) c, options = compel.build_conditioning_tensor_for_prompt_object(positive_prompt)
uc, _ = compel.build_conditioning_tensor_for_prompt_object(negative_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 # now build the "real" ec
ec = InvokeAIDiffuserComponent.ExtraConditioningInfo(tokens_count_including_eos_bos=tokens_count, ec = InvokeAIDiffuserComponent.ExtraConditioningInfo(tokens_count_including_eos_bos=tokens_count,