🔥StitchingVideo
Two clips side by side, horizontal or vertical
- video_complete_path
StitchingVideo puts two videos next to each other in a single frame - side by side (horizontal) or stacked (vertical). This is the "compare and contrast" node: original vs. upscaled, prompt A vs. prompt B, before vs. after. If you've ever seen those split-screen demo videos that pair a raw AI render with the enhanced version, this is the node that makes them in one click instead of an afternoon in a video editor. Worth noting it's not the same as MergingVideoByTwo (which plays clips sequentially) or PipVideo (which overlays one inside the other). StitchingVideo is strictly a two-up layout.
How it works
FFmpeg's hstack or vstack filter does the layout, scaled so both clips line up. The shorter clip gets looped to match the longer one's duration - the node computes a loop count from the two durations - so you don't end up with one side going black. A couple of smart touches: if scale_and_crop is yes, the mismatched clip is either center-cropped or blurred-and-padded (gaussian blur background behind a pillarboxed clip) to fit video1's dimensions rather than being squashed. That blur-pad option is genuinely the professional look and it's a surprise to find in a small utility pack.
The inputs that matter
- video1_path / video2_path - the two clips. video1 is the reference for sizing.
- stitching_type -
horizontal(side by side) orvertical(one on top of the other). - use_audio -
video1orvideo2; whose soundtrack the final file keeps. - scale_and_crop -
yesorno.yesmakes the second clip crop/fit to video1's frame with the blur-pad option;noscales both to a common size (which can distort a mismatched clip). - device -
cpuorcuda; the usual CPU/libx264 vs GPU/nvenc choice. - output_path - existing directory; timestamp-named output.
Outputs
One video_complete_path string.
Install
Pack-wide standard: FFmpeg on PATH is the real prerequisite. ComfyUI Manager → search "ComfyUI-FFmpeg", or:
cd ComfyUI/custom_nodes
git clone https://github.com/MoonHugo/ComfyUI-FFmpeg
cd ComfyUI-FFmpeg
pip install -r requirements.txt
Restart ComfyUI.
Gotchas
- Different aspect ratios are the main source of surprise. Two 16:9 clips stitch cleanly; a 16:9 with a 9:16 makes an odd composite. That's where
scale_and_crop: yesearns its keep. - The audio is a straight pick, not a mix - with
use_audioyou get one clip's full soundtrack and the other's is dropped. If you wanted both, you're out of luck (AddAudio can layer afterward, but it replaces rather than mixes). - Since it loops the shorter clip, a very short clip next to a long one will visibly restart - the loop is a hard cut, not a crossfade. Keep clip lengths in the same ballpark for clean results.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| video1_path | STRING | C:/Users/Desktop/video1.mp4 | — |
| video2_path | STRING | C:/Users/Desktop/video2.mp4 | — |
| device | COMBO | cpu | 2 options: cpu, cuda |
| use_audio | COMBO | video1 | 2 options: video1, video2 |
| stitching_type | COMBO | horizontal | 2 options: horizontal, vertical |
| output_path | STRING | C:/Users/Desktop/output | — |
| scale_and_crop | COMBO | no | 2 options: yes, no |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| video_complete_path | STRING | — |