kijai / ComfyUI-Florence2

Inference Microsoft Florence2 VLM
MIT License
300 stars 17 forks source link

'list' object has no attribute 'replace' #5

Closed formulake closed 1 week ago

formulake commented 1 week ago

So this happens when I try to pass the caption output into a CLIP Text Encode input. What I'm trying to do is caption an image and use that prompt to generate test images with other checkpoints. I understand this may not be the intended use-case, but can anyone help with a workaround?

Full text

Error occurred when executing CLIPTextEncode:

'list' object has no attribute 'replace'

File "F:\Tools\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "F:\Tools\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "F:\Tools\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "F:\Tools\ComfyUI\nodes.py", line 57, in encode
tokens = clip.tokenize(text)
File "F:\Tools\ComfyUI\comfy\sd.py", line 131, in tokenize
return self.tokenizer.tokenize_with_weights(text, return_word_ids)
File "F:\Tools\ComfyUI\comfy\sdxl_clip.py", line 30, in tokenize_with_weights
out["g"] = self.clip_g.tokenize_with_weights(text, return_word_ids)
File "F:\Tools\ComfyUI\comfy\sd1_clip.py", line 416, in tokenize_with_weights
text = escape_important(text)
File "F:\Tools\ComfyUI\comfy\sd1_clip.py", line 256, in escape_important
text = text.replace("\)", "\0\1")
kijai commented 1 week ago

This should now work.

formulake commented 1 week ago

Like a charm! Thank you!