paulo-coronado / comfy_clip_blip_node

28 stars 6 forks source link

ValueError: not enough values to unpack (expected 3, got 1) #6

Open farizy4n opened 7 months ago

farizy4n commented 7 months ago

How to fix this.

ERROR:root:!!! Exception during processing !!! ERROR:root:Traceback (most recent call last): File "E:\Ai\ComfyUI\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "E:\Ai\ComfyUI\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "E:\Ai\ComfyUI\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "E:\Ai\ComfyUI\ComfyUI\custom_nodes\comfy_clip_blip_node\blip_node.py", line 189, in blip embeddings_final = advanced_encode( File "E:\Ai\ComfyUI\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 "E:\Ai\ComfyUI\ComfyUI\custom_nodes\comfy_clip_blip_node\adv_encode.py", line 145, in advanced_encode_from_tokens tokens = [[t for t,_,_ in x] for x in tokenized] File "E:\Ai\ComfyUI\ComfyUI\custom_nodes\comfy_clip_blip_node\adv_encode.py", line 145, in <listcomp> tokens = [[t for t,_,_ in x] for x in tokenized] File "E:\Ai\ComfyUI\ComfyUI\custom_nodes\comfy_clip_blip_node\adv_encode.py", line 145, in <listcomp> tokens = [[t for t,_,_ in x] for x in tokenized] ValueError: not enough values to unpack (expected 3, got 1)

petercham commented 6 months ago

我也遇到了同样的问题,请问您解决了么? I'm having the same problem. Have you solved it yet?

madtunebk commented 6 months ago

This error occurs because the tokenizers package fails to build. A workaround to resolve this issue is to download it manually from civitai.com : ComfyUI CLIP BLIP Node and install it manually. Additionally, don't forget to update the version of the transformers package to the latest or at least version 4.38.2 in the requirements.txt.

If you encounter errors related to the model path not existing, you can resolve them by editing the file ComfyUI/custom_nodes/comfy_clip_blip_node/blip_node.py. On lines 12 and 16, remove the 'ComfyUI' that includes quotes. Additionally, ensure that the line sys.path.append('..' + os.sep) looks like this after you've edited:

Here are the corrected lines:

Line 12: sys.path.append('..' + os.sep)

Line 16: MODELS_DIR = os.path.join((os.getcwd() + os.sep if not os.getcwd().startswith('/content') else os.getcwd()), 'models')

rollingcookies commented 6 months ago

This error occurs because the tokenizers package fails to build. A workaround to resolve this issue is to download it manually from civitai.com : ComfyUI CLIP BLIP Node and install it manually. Additionally, don't forget to update the version of the transformers package to the latest or at least version 4.38.2 in the requirements.txt.

Hi! Update transformers and tokenizers - didn't help! Error:

2024-03-11_10-55-50

madtunebk commented 6 months ago

This error occurs because the tokenizers package fails to build. A workaround to resolve this issue is to download it manually from civitai.com : ComfyUI CLIP BLIP Node and install it manually. Additionally, don't forget to update the version of the transformers package to the latest or at least version 4.38.2 in the requirements.txt.

Hi! Update transformers and tokenizers - didn't help! Error:

2024-03-11_10-55-50

Do you get the old version of Node from here: civitai? I'm not sure if it will work without updating transformers, but you still need to edit the lines specified above.

poluramus commented 6 months ago

Nothing worked for me. For your information @madtunebk when using the portable standalone version, the folder tree look like:

ComfyUI_windows_portable/ ├── run_nvidia_gpu.bat (other files...) └── ComfyUI/ (github root folder)

To fix the problem, this is what worked for me:

  1. Open this commit 9b76f24
  2. Click on the files named "blip_node.py" and "adv_encode.py" to open them.
  3. Select all the code in each file.
  4. Copy the selected code.
  5. Find and open the local files "blip_node.py" and "adv_encode.py" in your "\custom_nodes\comfy_clip_blip_node\" folder.
  6. Replace any existing code in these files with the copied code.
  7. Save the changes made to both files.

The original solution is from this post