ComfyUI-Allor icon indicating copy to clipboard operation
ComfyUI-Allor copied to clipboard

ImageFilterMedianBlur won't allow to change value

Open IcelandicCenterArtificialIntelligence opened this issue 7 months ago • 0 comments

The node ImageFilterMedianBlur works fine only if you leave the default value 10. If you try to change the value it will fail. Also it will only accept odd values (if you type 10, it will adjust it to 11)

This is the error:

`Error occurred when executing ImageFilterMedianBlur:

OpenCV(4.7.0) /io/opencv/modules/imgproc/src/median_blur.dispatch.cpp:285: error: (-215:Assertion failed) (ksize % 2 == 1) && (_src0.dims() <= 2 ) in function 'medianBlur'

File "/workspace/ComfyUI/execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/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 "/workspace/ComfyUI/execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/ComfyUI/custom_nodes/ComfyUI-Allor/modules/ImageFilter.py", line 242, in node return ((cv2_layer(img, lambda x: cv2.medianBlur(x, size)) / 255),) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/ComfyUI/custom_nodes/ComfyUI-Allor/modules/Utils.py", line 68, in cv2_layer return torch.stack([ ^ File "/workspace/ComfyUI/custom_nodes/ComfyUI-Allor/modules/Utils.py", line 69, in produce(tensor[i]) for i in range(len(tensor)) ^^^^^^^^^^^^^^^^^^ File "/workspace/ComfyUI/custom_nodes/ComfyUI-Allor/modules/Utils.py", line 54, in produce result_rgb = function(rgb) ^^^^^^^^^^^^^ File "/workspace/ComfyUI/custom_nodes/ComfyUI-Allor/modules/ImageFilter.py", line 242, in return ((cv2_layer(img, lambda x: cv2.medianBlur(x, size)) / 255),) ^^^^^^^^^^^^^^^^^^^^^^^`