comfy-core: VAE Decode Bug on Flux Kontext
Custom Node Testing
- [x] I have tried disabling custom nodes and the issue persists (see how to disable custom nodes if you need help)
Expected Behavior
VAE Decode will output the generated Image
Actual Behavior
VAE Decode drop out this Error: VAEDecode Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [1, 16, 1, 128, 128]
Steps to Reproduce
using latest Comfyui Version, updated requirements, worked the day with other flux workflows without problems. so my comfyui seams not the problem.
now i tested two different flux KONTEXT workflows, were other users have no problem with and soon after KSampler is done with image generation and send data to "VAEDecode" i got error message and no image.
i tested the template in comfyui for Flux Kontext Dev_Basic and this free basic workflows i used too: https://www.patreon.com/posts/flux-kontext-dev-132408206
Debug Logs
got prompt
Using scaled fp8: fp8 matrix mult: False, scale input: False
CLIP/text encoder model load device: cuda:0, offload device: cpu, current: cpu, dtype: torch.float16
Requested to load FluxClipModel_
loaded completely 5405.358837890625 4903.231597900391 True
loaded partially 9492.367040000001 9492.365478515625 0
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [01:05<00:00, 3.30s/it]
Requested to load AutoencodingEngine
loaded partially 128.0 127.999755859375 0
!!! Exception during processing !!! Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [1, 16, 1, 128, 128]
Traceback (most recent call last):
File "H:\Comfyui\ComfyUI\execution.py", line 361, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Comfyui\ComfyUI\execution.py", line 236, in get_output_data
return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Comfyui\ComfyUI\execution.py", line 208, in _map_node_over_list
process_inputs(input_dict, i)
File "H:\Comfyui\ComfyUI\execution.py", line 197, in process_inputs
results.append(getattr(obj, func)(**inputs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Comfyui\ComfyUI\nodes.py", line 290, in decode
images = vae.decode(samples["samples"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Comfyui\ComfyUI\comfy\sd.py", line 577, in decode
out = self.process_output(self.first_stage_model.decode(samples, **vae_options).to(self.output_device).float())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Comfyui\ComfyUI\comfy\ldm\models\autoencoder.py", line 135, in decode
x = self.decoder(z, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Comfyui\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Comfyui\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Comfyui\ComfyUI\comfy\ldm\modules\diffusionmodules\model.py", line 709, in forward
h = self.conv_in(z)
^^^^^^^^^^^^^^^
File "H:\Comfyui\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Comfyui\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Comfyui\ComfyUI\comfy\ops.py", line 112, in forward
return self.forward_comfy_cast_weights(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Comfyui\ComfyUI\comfy\ops.py", line 108, in forward_comfy_cast_weights
return self._conv_forward(input, weight, bias)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\Comfyui\ComfyUI\venv\Lib\site-packages\torch\nn\modules\conv.py", line 549, in _conv_forward
return F.conv2d(
^^^^^^^^^
RuntimeError: Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [1, 16, 1, 128, 128]
Prompt executed in 74.37 seconds
Other
im using the GGUF Flux Kontext Version Q4 from QuantStack: https://huggingface.co/QuantStack/FLUX.1-Kontext-dev-GGUF
I do not know why, but i restarted now my Computer and then it works like expected. Before i restarted several Times ComfyUi + Firefox and checked for errors on startup in Console, also if enough ram is there. Can't explain why after a Computer restart it now works. i feel dumb now :(
This issue cannot be reproduced, so I'm closing it.
I got this code. Can anyone help
Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [1, 16, 1, 128, 128]
I got this code. Can anyone help
Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [1, 16, 1, 128, 128]
I had this Error because i used a not supported Image Size. Check the Size of the Image you use or going to Create.