Fade Between Batches | Akatz
Crossfade two video clips with a proper overlap
- image1
- image2
- IMAGE
Fade Between Batches stitches two image batches into one by crossfading them over a shared overlap window: batch one plays, then overlap_frames of blended transition, then batch two finishes. It's the ComfyUI-native way to join two clips without popping straight from one to the other.
If you've ever concatenated two video batches in ComfyUI you know the result: a hard cut. Sometimes a cut is what you want. When it isn't - you're joining two shots, blending a loop back on itself, or smoothing a transition between two style passes - this node is the missing glue. The classic pattern is seamless loops: fade the end of a clip into its own beginning, and the seam disappears. It's also handy for smoothly switching between two generated sequences where the generator's own "cut" would be jarring.
How it works
The math is a straight alpha blend. The last overlap_frames of image1 are blended with the first overlap_frames of image2, with alpha ramping 0→1 across the transition, and the two untransitioned tails are concatenated around it. It even handles a mismatch in resolution: if image2 is a different size, it's resized to match image1 with bilinear interpolation before blending, so your workflow won't die on dimension errors.
One sharp edge in the source: overlap_frames must be smaller than both batches - if either batch is shorter than the overlap, it raises an error rather than guessing. And if you hand it an empty batch, it gracefully returns the other one.
Inputs and output
image1- first IMAGE batch.image2- second IMAGE batch.overlap_frames- how many frames the fade spans, default 10, minimum 1.
Output is a single IMAGE batch: len(image1) + len(image2) − overlap_frames frames. The blend is a smooth linear crossfade - no easing options, keep it simple.
Installing it
Part of akatz-ai/ComfyUI-AKatz-Nodes. Install via ComfyUI Manager (search "AKatz") or:
cd ComfyUI/custom_nodes
git clone https://github.com/akatz-ai/ComfyUI-AKatz-Nodes
cd ComfyUI-AKatz-Nodes
pip install -r requirements.txt
Restart ComfyUI. No model downloads; requirements are numpy, torch, opencv-python and pydub.
Common issues
The error you'll actually hit is "Overlap frames exceed the batch sizes" - raise overlap_frames too high and both tails go negative. Keep it comfortably below your smallest batch. And for loops specifically, remember it's a linear crossfade, not a morph: if the last frame of batch one and first frame of batch two are wildly different, the fade shows both - you want the two batches to be visually close (same scene, matched brightness) or the fade just looks like a double exposure.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image1 | IMAGE | — | |
| image2 | IMAGE | — | |
| overlap_frames | INT | 10 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |