nullquant / ComfyUI-BrushNet

ComfyUI BrushNet nodes
Apache License 2.0
571 stars 20 forks source link

CutForInpaint error #107

Closed foobarhe closed 3 months ago

foobarhe commented 4 months ago

When the mask is empty, the CutForInpaint throws the following error, could you please fix so that can handle this situation?


Error occurred when executing CutForInpaint:

min(): Expected reduction dim to be specified for input.numel() == 0. Specify the reduction dim with the 'dim' argument.

File "/root/tmp/ComfyUI/execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/tmp/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 "/root/tmp/ComfyUI/execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/tmp/ComfyUI/custom_nodes/ComfyUI-BrushNet/brushnet_nodes.py", line 557, in cut_for_inpaint
x0, y0, w, h = cut_with_mask(mask[i], width, height)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/tmp/ComfyUI/custom_nodes/ComfyUI-BrushNet/brushnet_nodes.py", line 691, in cut_with_mask
x_min = ix.min().item()
^^^^^^^^
nullquant commented 4 months ago

Ok, I've done it. But with empty mask BrushNet will not work.