biegert / ComfyUI-CLIPSeg

ComfyUI CLIPSeg
Apache License 2.0
198 stars 34 forks source link

cv2.error: OpenCV(4.9.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:3789: error: (-215:Assertion failed) !dsize.empty() in function 'cv::hal::resize' #19

Open Cokeheart opened 5 months ago

Cokeheart commented 5 months ago

!!! Exception during processing !!! Traceback (most recent call last): File "D:\Blender_ComfyUI\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Blender_ComfyUI\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 "D:\Blender_ComfyUI\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Blender_ComfyUI\ComfyUI\custom_nodes\clipseg.py", line 154, in segment_image heatmap_resized = resize_image(heatmap, dimensions) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Blender_ComfyUI\ComfyUI\custom_nodes\clipseg.py", line 44, in resize_image return cv2.resize(image, dimensions, interpolation=cv2.INTER_LINEAR) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 微信图片_20240403220839

shaoheming commented 5 months ago

i got this error too...

HydraBucket commented 5 months ago

I'm recieving this error too

dimroce commented 5 months ago

same here, So is it due to some node upgrades?

ssuukk commented 5 months ago

me too!

wer5245 commented 5 months ago

重装插件,然后和3699错误一样的步骤改代码,再试试

yincangshiwei commented 5 months ago

重装插件,然后和3699错误一样的步骤改代码,再试试 怎么改

xuxucca commented 5 months ago

Try installing transformers up to 4.36.0 if you can!or lower。使用较低版本的 transformers可以解决这个问题。

shaoheming commented 5 months ago

https://blog.csdn.net/JuMengXiaoKeTang/article/details/137383951

GalaxyTimeMachine commented 5 months ago

https://blog.csdn.net/JuMengXiaoKeTang/article/details/137383951

Thank you, this resolved it for me! :)

Godorox commented 5 months ago

https://blog.csdn.net/JuMengXiaoKeTang/article/details/137383951

I tried this solution but it doesn't work. Has anyone found another solution?

Try installing transformers up to 4.36.0 if you can! or lower. Using lower versions of transformers can solve this problem.

How can I do this?

GalaxyTimeMachine commented 5 months ago

https://blog.csdn.net/JuMengXiaoKeTang/article/details/137383951

I tried this solution but it doesn't work. Has anyone found another solution?

Try installing transformers up to 4.36.0 if you can! or lower. Using lower versions of transformers can solve this problem.

How can I do this?

The only change I needed to make was to the clipseg.py file. Just make that change and it should work.

Basically, edit custom_nodes/clipseg.py to this: 0c9bc471fb6c4e38a010ea4317364a83

wangzixin1 commented 4 months ago

低级的错误,作者怎么 能用绝对路径? OpenCV(4.9.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:3789: error: (-215:Assertion failed) !dsize.empty() in function 'cv::hal::resize'

yw-2020 commented 4 months ago

!!! Exception during processing!!! OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:3699: error: (-215:Assertion failed) !dsize.empty() in function 'cv::hal::resize'

Traceback (most recent call last): File "E:\ComfyUI_WIN\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI_WIN\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 "E:\ComfyUI_WIN\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI_WIN\ComfyUI\custom_nodes\clipseg.py", line 154, in segment_image heatmap_resized = resize_image(heatmap, dimensions) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\ComfyUI_WIN\ComfyUI\custom_nodes\clipseg.py", line 44, in resize_image return cv2.resize(image, dimensions, interpolation=cv2.INTER_LINEAR) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cv2.error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:3699: error: (-215:Assertion failed) !dsize.empty() in function 'cv::hal::resize'

how to fix??

yw-2020 commented 4 months ago

https://blog.csdn.net/JuMengXiaoKeTang/article/details/137383951

thanks, it worked!!!

ioritree commented 4 months ago

https://blog.csdn.net/JuMengXiaoKeTang/article/details/137383951

new problem after changed

Error occurred when executing Bounded Image Crop with Mask:

index is out of bounds for dimension with size 0

JulianKingman commented 4 months ago

Looks like this PR fixes it: https://github.com/biegert/ComfyUI-CLIPSeg/pull/18/files