From 6bdbac1c00eb5ed94427ae38216d1310856a7ec6 Mon Sep 17 00:00:00 2001 From: Koratahiu Date: Tue, 2 Sep 2025 00:24:51 +0300 Subject: [PATCH] zero-vector placeholders --- comfy/sd1_clip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comfy/sd1_clip.py b/comfy/sd1_clip.py index f13896fa9..57f6c686b 100644 --- a/comfy/sd1_clip.py +++ b/comfy/sd1_clip.py @@ -226,8 +226,8 @@ class SDClipModel(torch.nn.Module, ClipTokenWeightEncoder): # For output embeddings, store their position and data for later. # Insert placeholder tokens to maintain sequence length. output_embeds_for_prompt.append((index, y["data"])) - tokens_temp.extend([self.special_tokens["pad"]] * num_tokens_in_embed) - attention_mask.extend([1] * num_tokens_in_embed) + placeholder_data = torch.zeros_like(y["data"]) + other_embeds.append((index, {"type": "embedding", "data": placeholder_data})) else: # Regular input embedding other_embeds.append((index, y)) index += num_tokens_in_embed