XB-BOX - Video Merger
Stitch up to ten video segments into one long clip — on the CPU, so it won't OOM
- video_1
- video_2
- video_3
- video_4
- video_5
- video_6
- video_7
- video_8
- video_9
- video_10
- 🎞️ Full Long Video
XB_Video_Merger is the plumbing node that sits at the end of the pack's "infinite video" pipelines: it takes up to ten IMAGE batches and concatenates them into one long video stream along the frame axis. That's the entire job - no blending, no fading, no overlap handling. If you're generating 5-second clips and chaining them into a minute-long take, this is the node that does the joining, and its one genuinely smart trick is that it moves every segment to the CPU before the torch.cat. The console message spells out the reasoning: it unloads all segments to RAM before concatenating so that multiple big video tensors never sit in VRAM simultaneously and OOM you.
What it actually checks
The input side is refreshingly simple: ten optional sockets, video_1 through video_10, all IMAGE. Leave the ones you don't need unplugged. It concatenates the connected ones in order.
It will reject mismatched segments, and it's strict about it - this is the thing that bites people. Every segment must match the first segment's height, width, and channel count on every dimension except the frame axis. Feed it a 480x832 clip followed by a 720x1280 clip and it raises a shape-mismatch error naming exactly which dimension differs. That's a feature: silent concatenation of mismatched frames would produce garbage, and the error message actually tells you what to fix.
The single output is 🎞️ Full Long Video (IMAGE). Wire it into a VideoCombine to save.
When you reach for it
Two realistic cases. First, the pack's own relay/bus workflows: each XB_WanAnimate_RelayNode hands you an accumulated video, and a merger isn't strictly needed because the relay already accumulates - but the merger is what you use if you're assembling segments from separate generation runs. Second, any "generate clips, then assemble" batch workflow where you want the assembly as a visible, debuggable step rather than something hidden inside another node. If your segments come from different resolutions, upscale them to a common size before merging - the node won't do it for you.
The catch
It's a pure concatenation, so it has the same identity-drift problem every chunked video pipeline has: if your segments were generated independently, the seam between them will jump. The pack's relay nodes use overlap frames and trimming to hide that; if you're using this merger to join unrelated clips, expect a visible cut. Also note there's no audio handling - audio comes back when you feed the merged IMAGE into XB_VideoCombine with an audio input.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/WJLUOXIAO/XB_ToolBox.git
then restart ComfyUI, or search "XB_ToolBox" in ComfyUI Manager. It's pure torch - no extra dependencies beyond what the pack already installs.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| video_1opt | IMAGE | — | |
| video_2opt | IMAGE | — | |
| video_3opt | IMAGE | — | |
| video_4opt | IMAGE | — | |
| video_5opt | IMAGE | — | |
| video_6opt | IMAGE | — | |
| video_7opt | IMAGE | — | |
| video_8opt | IMAGE | — | |
| video_9opt | IMAGE | — | |
| video_10opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 🎞️ Full Long Video | IMAGE | — |