Comfy-Org / Comfy-Org/ComfyUI

PID flux 2 error while decoding final image

Open
#14,154 6 comments 0 reactions 0 assignees View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Custom Node Testing

- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)

### Expected Behavior

I wanted to use pid on flux2kllein 9b output but the vae decoding seems to give me an error.

### Actual Behavior

```
[ERROR] !!! Exception during processing !!! The size of tensor a (3) must match the size of tensor b (128) at non-singleton dimension 1
[ERROR] Traceback (most recent call last):
File "dir\ComfyUI\execution.py", line 536, in execute
output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "dir\ComfyUI\execution.py", line 336, in get_output_data
return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "dir\ComfyUI\execution.py", line 310, in _async_map_node_over_list
await process_inputs(input_dict, i)
File "dir\ComfyUI\execution.py", line 298, in process_inputs
result = f(**inputs)
^^^^^^^^^^^
File "dir\ComfyUI\nodes.py", line 315, in decode
images = vae.decode(latent)
^^^^^^^^^^^^^^^^^^
File "dir\ComfyUI\comfy\sd.py", line 1066, in decode
model_management.raise_non_oom(e)
File "dir\ComfyUI\comfy\model_management.py", line 394, in raise_non_oom
raise e
File "dir\ComfyUI\comfy\sd.py", line 1059, in decode
out = self.first_stage_model.decode(samples, **vae_options).to(device=self.output_device, dtype=self.vae_output_dtype(), copy=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "dir\ComfyUI\comfy\ldm\models\autoencoder.py", line 244, in decode
z = z * s + m
~~^~~
RuntimeError: The size of tensor a (3) must match the size of tensor b (128) at non-singleton dimension 1
```

### Steps to Reproduce

Image

[pidonly.json](https://github.com/user-attachments/files/28352058/pidonly.json)

### Debug Logs

```powershell
[ERROR] !!! Exception during processing !!! The size of tensor a (3) must match the size of tensor b (128) at non-singleton dimension 1
[ERROR] Traceback (most recent call last):
File "dir\ComfyUI\execution.py", line 536, in execute
output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "dir\ComfyUI\execution.py", line 336, in get_output_data
return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "dir\ComfyUI\execution.py", line 310, in _async_map_node_over_list
await process_inputs(input_dict, i)
File "dir\ComfyUI\execution.py", line 298, in process_inputs
result = f(**inputs)
^^^^^^^^^^^
File "dir\ComfyUI\nodes.py", line 315, in decode
images = vae.decode(latent)
^^^^^^^^^^^^^^^^^^
File "dir\ComfyUI\comfy\sd.py", line 1066, in decode
model_management.raise_non_oom(e)
File "dir\ComfyUI\comfy\model_management.py", line 394, in raise_non_oom
raise e
File "dir\ComfyUI\comfy\sd.py", line 1059, in decode
out = self.first_stage_model.decode(samples, **vae_options).to(device=self.output_device, dtype=self.vae_output_dtype(), copy=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "dir\ComfyUI\comfy\ldm\models\autoencoder.py", line 244, in decode
z = z * s + m
~~^~~
RuntimeError: The size of tensor a (3) must match the size of tensor b (128) at non-singleton dimension 1
```

### Other

Using comfyui 0.22.0
frontend 1.44.19

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.