XLabs-AI / x-flux-comfyui

Apache License 2.0
771 stars 55 forks source link

Some pictures in i2i will report errors. #26

Open RINGOLINK opened 1 month ago

RINGOLINK commented 1 month ago

During the process of drawing pictures, some pictures seem to be not supported. Some pictures can run normally, while some pictures will cause the following error.

The error message is as follows:

Error occurred when executing XlabsSampler:

Error while processing rearrange-reduction pattern "b c (h ph) (w pw) -> b (h w) (c ph pw)". Input tensor shape: torch.Size([1, 16, 152, 85]). Additional info: {'ph': 2, 'pw': 2}. Shape mismatch, can't divide axis of length 85 in chunks of 2

File "D:\AI\comfy\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI\comfy\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 "D:\AI\comfy\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI\comfy\ComfyUI\custom_nodes\x-flux-comfyui\nodes.py", line 348, in sampling x = denoise_controlnet( ^^^^^^^^^^^^^^^^^^^ File "D:\AI\comfy\ComfyUI\custom_nodes\x-flux-comfyui\sampling.py", line 238, in denoise_controlnet orig_image = rearrange(orig_image, "b c (h ph) (w pw) -> b (h w) (c ph pw)", ph=2, pw=2).to(img.device, dtype = img.dtype) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI\comfy\ComfyUI\venv\Lib\site-packages\einops\einops.py", line 591, in rearrange return reduce(tensor, pattern, reduction="rearrange", axes_lengths) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI\comfy\ComfyUI\venv\Lib\site-packages\einops\einops.py", line 533, in reduce raise EinopsError(message + "\n {}".format(e))

How does this error occur?

Vovanm88 commented 4 weeks ago

Looks like shape of image mismatch with something idk try to crop image to a size dividable by 16

RINGOLINK commented 4 weeks ago

Looks like shape of image mismatch with something idk try to crop image to a size dividable by 16

I checked that the resolution is 648*1216, and the width is indeed not divisible by 16. Although it is true that looking at the literal information of the error can only be solved by cropping the picture, will this problem be fixed in the future? Every time you generate a picture, it seems to be a relatively troublesome choice to perform logical operations on the width and height of the original picture and crop it once.

Vovanm88 commented 4 weeks ago

yes, we will fix it, but not this weekend I think