Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions comfy/sd1_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,8 @@ def tokenize_with_weights(self, text:str, return_word_ids=False, tokenizer_optio
min_length = tokenizer_options.get("{}_min_length".format(self.embedding_key), self.min_length)
min_padding = tokenizer_options.get("{}_min_padding".format(self.embedding_key), self.min_padding)

min_length = kwargs.get("min_length", min_length)

text = escape_important(text)
if kwargs.get("disable_weights", self.disable_weights):
parsed_weights = [(text, 1.0)]
Expand Down
2 changes: 1 addition & 1 deletion comfy_extras/nodes_textgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def define_schema(cls):
@classmethod
def execute(cls, clip, prompt, max_length, sampling_mode, image=None) -> io.NodeOutput:

tokens = clip.tokenize(prompt, image=image, skip_template=False)
tokens = clip.tokenize(prompt, image=image, skip_template=False, min_length=1)

# Get sampling parameters from dynamic combo
do_sample = sampling_mode.get("sampling_mode") == "on"
Expand Down