cubiq / ComfyUI_essentials

MIT License
480 stars 58 forks source link

CLIPSeg tuple index out of range #48

Closed surinnin2 closed 1 month ago

surinnin2 commented 2 months ago

I got the following error when trying to run the PuLID_refiner workflow on comfyui deployed on a lightning.ai workspace. The CLIPSeg values were: prompt=face, threshold=0.40, smooth=21, dilate=2, blur=23.

Error occurred when executing ApplyCLIPSeg+:

tuple index out of range

File "/teamspace/studios/this_studio/ComfyUI/execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/teamspace/studios/this_studio/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 "/teamspace/studios/this_studio/ComfyUI/execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "/teamspace/studios/this_studio/ComfyUI/custom_nodes/ComfyUI_essentials/segmentation.py", line 64, in execute outputs = T.functional.gaussian_blur(outputs, smooth) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/torchvision/transforms/v2/functional/_misc.py", line 81, in gaussian_blur return kernel(inpt, kernel_size=kernel_size, sigma=sigma) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/torchvision/transforms/v2/functional/_misc.py", line 146, in gaussian_blur_image kernel = kernel.expand(shape[-3], 1, kernel.shape[0], kernel.shape[1])

When I tried the same job locally it worked fine. I know this might be a problem with the environment, but if you have any ideas or suggestions I'd greatly appreciate it.

cubiq commented 2 months ago

hard to say, they might just have an outdated version or outdated dependency

ordin2342 commented 2 months ago

Same issue since couple of days (locally). Worked fine before. No idea what''s the cause, same workflow I've been using for weeks.

Loading 1 new model
100%|████████████████████████████████████████████████████████████████████████████████████████████████████| 42/42 [00:09<00:00,  4.46it/s]
Face Analysis: value: 0.5144070088863373, normalized: 0.7564808954210842
!!! Exception during processing!!! tuple index out of range
Traceback (most recent call last):
  File "C:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\ComfyUI_windows_portable\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:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_essentials\segmentation.py", line 64, in execute
    outputs = T.functional.gaussian_blur(outputs, smooth)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torchvision\transforms\v2\functional\_misc.py", line 83, in gaussian_blur
    return kernel(inpt, kernel_size=kernel_size, sigma=sigma)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torchvision\transforms\v2\functional\_misc.py", line 148, in gaussian_blur_image
    kernel = kernel.expand(shape[-3], 1, kernel.shape[0], kernel.shape[1])
                           ~~~~~^^^^
IndexError: tuple index out of range

Tried reinstalling essentials and other packages that might be related, tried updating what's possible. This is a weird one... all help appreciated.

MYSTERlOUSGUY commented 1 month ago

I solved this by doing fresh install of portable comfyui.