Skip to content

Bugfix for using nodes in video creation, where one source image is used.#193

Open
FortunaCournot wants to merge 2 commits intoGourieff:mainfrom
FortunaCournot:main
Open

Bugfix for using nodes in video creation, where one source image is used.#193
FortunaCournot wants to merge 2 commits intoGourieff:mainfrom
FortunaCournot:main

Conversation

@FortunaCournot
Copy link

Bugfix for:

File "...\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-ReActor\nodes.py", line 1470, in execute result[image_index] = pasting * paste_mask + result[image_index] * (1. - paste_mask) ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ RuntimeError: The size of tensor a (3) must match the size of tensor b (4) at non-singleton dimension 2

…sed.

Bugfix for:

File "...\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-ReActor\nodes.py", line 1470, in execute result[image_index] = pasting * paste_mask + result[image_index] * (1. - paste_mask) ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ RuntimeError: The size of tensor a (3) must match the size of tensor b (4) at non-singleton dimension 2
Bugfix for using nodes in video creation, where one source image is u…
@Buumcode
Copy link

Buumcode commented Oct 29, 2025

where one source image is used

Can you explain - what do you mean "one source image used"? If we do face swap im2video - we always has one Source image and one Target video. And with using VHS Video Helper Suite workflow - I never get any errors.

Reactor__VHS__Image-to-Video__face_swap__GITHUB

@FortunaCournot
Copy link
Author

At ReActor FastFace Swap: InputImage from VAE Decode. This is almost the same.
But i have another node ReActor 🌌 Masking Helper, like in your other workflow, directly behind.

@FortunaCournot
Copy link
Author

FortunaCournot commented Oct 29, 2025

I removed the Masking Helper node. Now the video looks correct. My workflow was wrong, i havn't seen your example. Thank you!!! However, it is still a bug ;-)
Side note: I don't use this for vid2vid. I need it for img2vid, to keep character consistent over multiple segments.

@sahibalejandro
Copy link

sahibalejandro commented Nov 2, 2025

This issue happens to me too, it only happens when the input_image is a video and the ReActor Masking Helper node is before the Video Combine (the last node).

@Buumcode
Copy link

Buumcode commented Nov 2, 2025

Yes, I'm got this error too - with using Masking Helper:

got prompt
[ReActor] 23:44:21 - STATUS - Working: source face index [0], target face index [0]
[ReActor] 23:44:21 - STATUS - Analyzing Source Image...
[ReActor] 23:44:21 - STATUS - Analyzing Target Image...
[ReActor] 23:44:22 - STATUS - Swapping...
[ReActor] 23:44:25 - STATUS - --Done!--

0: 384x640 1 face, 87.2ms
Speed: 2.8ms preprocess, 87.2ms inference, 11.5ms postprocess per image at shape (1, 3, 384, 640)
Moving to GPU... OK
!!! Exception during processing !!! The size of tensor a (3) must match the size of tensor b (4) at non-singleton dimension 2
Traceback (most recent call last):
  File "c:\ComfyUI\execution.py", line 498, 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, hidden_inputs=hidden_inputs)
                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\ComfyUI\execution.py", line 316, 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, hidden_inputs=hidden_inputs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\ComfyUI\execution.py", line 290, in _async_map_node_over_list
    await process_inputs(input_dict, i)
  File "c:\ComfyUI\execution.py", line 278, in process_inputs
    result = f(**inputs)
             ^^^^^^^^^^^
  File "C:\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 1358, in execute
    result[image_index] = pasting * paste_mask + result[image_index] * (1. - paste_mask)
                                                 ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
RuntimeError: The size of tensor a (3) must match the size of tensor b (4) at non-singleton dimension 2
```

@Gourieff
Copy link
Owner

Gourieff commented Nov 5, 2025

This is because Masking Helper requires list of images as input if you process a batch:
изображение

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants