Skip to content

PID flux 2 error while decoding final image #14154

@Fqlox

Description

@Fqlox

Custom Node Testing

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

Debug Logs

[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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Potential BugUser is reporting a bug. This should be tested.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions