From 7e9ca60dfd8aacc2e1afdbbff79c3a74db4c46bc Mon Sep 17 00:00:00 2001 From: asagi4 <130366179+asagi4@users.noreply.github.com> Date: Wed, 27 Nov 2024 00:02:42 +0200 Subject: [PATCH] Pad with an empty prompt See #64 --- prompt_control/node_clip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prompt_control/node_clip.py b/prompt_control/node_clip.py index 54f175f..1d69684 100644 --- a/prompt_control/node_clip.py +++ b/prompt_control/node_clip.py @@ -343,7 +343,7 @@ def encode_prompt(clip, text, default_style="comfy", default_normalization="none tokens["l"] = clip.tokenize(text_l, return_word_ids=need_word_ids)["l"] if "g" in tokens and "l" in tokens and len(tokens["l"]) != len(tokens["g"]): - empty = clip.tokenize(text_l, return_word_ids=need_word_ids) + empty = clip.tokenize("", return_word_ids=need_word_ids) while len(tokens["l"]) < len(tokens["g"]): tokens["l"] += empty["l"] while len(tokens["l"]) > len(tokens["g"]):