Merge Image Batches
Stitch two video clips together with an actual crossfade
- source_images
- new_images
- images
If you've ever generated two video segments separately and tried to join them, you know the naive way to "merge" a pair of image batches in ComfyUI is a concatenate node - which gives you a hard cut, and if the two clips differ in brightness or motion, that cut is a visible jump. Merge Image Batches does the joining with an optional blended transition, which is the difference between a seam and a cut.
What it is
It takes two image batches - source_images (the base sequence) and new_images (appended after it) - and produces one combined images batch. That's it, as far as the core job. The interesting part lives in the overlap_mode dropdown, which controls how the boundary between the two batches is handled:
- none - plain concatenation. The hard-cut option.
- cut - removes overlapping frames from one side before joining, so you can build a clean seam out of two clips that share a boundary.
- linear_blend - a simple linear crossfade over the overlap region.
- ease_in_out - an S-curve (smoothstep) crossfade, which looks more natural for motion than the linear version.
- filmic_crossfade - gamma-corrected (2.2) blend, so perceived brightness stays even through the transition.
- perceptual_crossfade - blends in LAB color space for the most perceptually even crossfade. It's the fancy one, and it requires the optional
korniapackage.
The blend modes are the reason to use this node over a raw concatenate. If you're stitching two generated clips of the same scene - say, an extension of a video - ease_in_out is usually the sweet spot between smooth and not-too-smear.
Inputs worth knowing
- source_images - first batch (optional input, but you'll want it connected).
- new_images - second batch. Must be the same resolution as source whenever you use any blend mode; mismatched sizes are a guaranteed error or a visually broken seam.
- overlap_mode - the transition selector above.
Output is a single images batch. Both inputs disconnected yields None.
Installing it
It ships with Nifty Nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/Stibo/comfyui-nifty-nodes
or search "Nifty Nodes" in ComfyUI Manager, then restart. Core blend modes need nothing extra. If you want perceptual_crossfade, install the optional dependency the README calls out:
pip install kornia
Gotchas
The resolution-match rule is the one that bites: blend modes assume both batches share dimensions, so resize the batches to match before the merge - this pack's own resize nodes make that easy. And watch frame rates: this node blends frames one-to-one, it doesn't resample, so two clips at different frame rates will stutter rather than blend cleanly. Also note the pack is built on the newer ComfyUI V3 API - if the node won't appear, update ComfyUI before you start debugging anything else.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| overlap_mode | COMBO | How to handle the transition between batches. 'none' = simple concatenation. 'cut' = removes overlap frames. 'linear_blend' = simple crossfade. 'ease_in_out' = smooth S-curve crossfade. 'filmic_crossfade' = gamma-correct blend. 'perceptual_crossfade' = LAB color space blend (requires kornia). | |
| source_imagesopt | IMAGE | First batch — the base sequence. | |
| new_imagesopt | IMAGE | Second batch — appended after source. Must have the same resolution as source when using any blend mode. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |