lquesada / ComfyUI-Inpaint-CropAndStitch

ComfyUI nodes to crop before sampling and stitch back after sampling that speed up inpainting
GNU General Public License v3.0
398 stars 23 forks source link

Error occurred when executing InpaintCrop: Batch size of images and masks must be the same #24

Closed pandayummy closed 4 months ago

pandayummy commented 4 months ago

image

Error occurred when executing InpaintCrop:

Batch size of images and masks must be the same

File "C:\Users\CHENG\AppData\Roaming\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\CHENG\AppData\Roaming\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:\Users\CHENG\AppData\Roaming\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:\Users\CHENG\AppData\Roaming\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Inpaint-CropAndStitch\inpaint_cropandstitch.py", line 172, in inpaint_crop assert image.shape[0] == mask.shape[0], "Batch size of images and masks must be the same" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

lquesada commented 4 months ago

Hi,

Clipseg is returning more than one mask for the same image, hence the nodes don't work

pandayummy commented 4 months ago

image

image

But after usage of combine node ,still the same error.

lquesada commented 4 months ago

I think some of those nodes are outputting more than one mask each. It doesn't matter if you combine them, as it seems some of them are returning batches of more than one mask and the combine nodes aren't combining them into a single mask, but keeping the batches.

This is not an issue related to the inpaint crop and stitch nodes, I suggest you find another combination of nodes to fold clipseg output into a single mask (but I am not aware of a way to do it :))

pandayummy commented 4 months ago

ok, I understand now. thank you.