paulo-coronado / comfy_clip_blip_node

29 stars 6 forks source link

not enough values to unpack (expected 3, got 1) #2

Open BaiterYamato opened 1 year ago

BaiterYamato commented 1 year ago

Error occurred when executing CLIPTextEncodeBLIP:

not enough values to unpack (expected 3, got 1)

File "C:\StableDiffusion\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\StableDiffusion\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 "C:\StableDiffusion\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\StableDiffusion\ComfyUI\custom_nodes\comfy_clip_blip_node\blip_node.py", line 189, in blip embeddings_final = advanced_encode( ^^^^^^^^^^^^^^^^ File "C:\StableDiffusion\ComfyUI\custom_nodes\comfy_clip_blip_node\adv_encode.py", line 192, in advanced_encode return advanced_encode_from_tokens(clip, tokenized, token_normalization, weight_interpretation, w_max) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\StableDiffusion\ComfyUI\custom_nodes\comfy_clip_blip_node\adv_encode.py", line 145, in advanced_encode_fromtokens tokens = [[t for t,,_ in x] for x in tokenized] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\StableDiffusion\ComfyUI\custom_nodes\comfy_clip_blip_node\advencode.py", line 145, in tokens = [[t for t,,_ in x] for x in tokenized] ^^^^^^^^^^^^^^^^^^ File "C:\StableDiffusion\ComfyUI\custom_nodes\comfy_clip_blip_node\advencode.py", line 145, in tokens = [[t for t,,_ in x] for x in tokenized] ^^^^^

PaulFidika commented 11 months ago

I also have this exact error. I cannot get past this. Disappointing.

seanlynch commented 11 months ago

I am guessing you're trying to use the node with an SDXL model, which unfortunately it does not currently support.

Wraithnaut commented 8 months ago

While it is analyzing the image and outputting a prompt to the console each time I run it, I still get this ValueError OP posted with any model, 1.5 or SDXL, so I think it is something else.

compilelife commented 8 months ago

possible solution: https://github.com/compilelife/comfy_clip_blip_node/commit/9b76f2451282e64a34276e647dde5649e0f9b28d

latest comfyui clip returns: {"l": [[]]} for sd1 or {"l": [[]], "g":[[]]} for sdxl, which leads to the unpack error

I just unpack "l" to function advanced_encode_from_tokens, and leave "g" unchanged. Not sure if it's correct.

The other error when using with sdxl is that comfyui needs pooled argument in clip encode output。Fix it too.

poluramus commented 5 months ago

possible solution: compilelife@9b76f24

latest comfyui clip returns: {"l": [[]]} for sd1 or {"l": [[]], "g":[[]]} for sdxl, which leads to the unpack error

I just unpack "l" to function advanced_encode_from_tokens, and leave "g" unchanged. Not sure if it's correct.

The other error when using with sdxl is that comfyui needs pooled argument in clip encode output。Fix it too.

I copied/pasted the 2 files from the commit you provided and it worked for me.

Thank you :-)