From d95aac906332be0ea72a19fb91b0e576e4d58c8a Mon Sep 17 00:00:00 2001 From: Koratahiu Date: Mon, 1 Sep 2025 03:30:57 +0300 Subject: [PATCH] fix input embed --- comfy/sd1_clip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/sd1_clip.py b/comfy/sd1_clip.py index 1bee4d110..ce42b441e 100644 --- a/comfy/sd1_clip.py +++ b/comfy/sd1_clip.py @@ -259,7 +259,7 @@ class SDClipModel(torch.nn.Module, ClipTokenWeightEncoder): # Adjust output embedding indices based on where # multi-token INPUT embeddings were inserted. if emb is not None: - num_new_tokens = emb.shape[1] + num_new_tokens = emb.shape[0] if len(emb.shape) > 1 else 1 for i in range(len(output_embeds_for_prompt)): if output_embeds_for_prompt[i][0] > o[0]: output_embeds_for_prompt[i] = (output_embeds_for_prompt[i][0] + num_new_tokens - 1, output_embeds_for_prompt[i][1])