Interleave Frames
Interleave Frames — zipper two video passes into one batch
- batch1
- batch2
- batch3
- batch4
- batch5
- batch6
- batch
This is the frame-surgery node. Interleave Frames takes two batches of frames (or latents) and merges them into one where they alternate - A1, B1, A2, B2, A3, B3 - like a zipper. It accepts up to six batches, so you can go wild, but the two-batch case is where the magic is.
What do you actually use it for? Two things mostly. First, framerate: if you have two passes over the same sequence - say a LoRA-on version and a LoRA-off version, or two different seeds - interleaving them doubles the frame count, giving you a smoother 2x render or a frame-by-frame A/B flicker test you can scrub through. Second, stitching: interleave the frames of two clips of the same length to build a sequence where both sources appear in the final video. It's the kind of node you won't need every day, and when you need it you'll be glad it exists instead of hand-building the tensor.
One honest note before you get excited: interleaving is not frame interpolation. Doubling frames with a zipper makes playback smoother, but there's no motion between them - it's the same frames repeated in a new order, not new frames invented. If you want actual motion interpolation, that's a different tool (RIFE-style nodes). Interleave just changes the order and density of what you already have.
How it works
Despite living in the ffmpeg-toolkit pack, this node uses no ffmpeg at all - it's pure torch. Under the hood it stacks your trimmed batches along a new axis and reshapes:
torch.stack(trimmed, dim=1).reshape(count * n_batches, ...)
So the mechanism is exactly what the name promises, and the errors are honest about the constraints. All inputs must be the same type - all IMAGE or all LATENT, never mixed - and the same spatial shape. If your batches have different lengths, it truncates to the shortest and logs a warning rather than failing, which is friendly but means the tail of a longer batch silently disappears. Watch the console if your output seems short.
LATENT inputs get the same treatment on their samples, plus any other tensor keys that line up across all the batches - so you can interleave latents before the sampler rather than only finished images, and save the decode until the end.
The inputs and outputs
- batch1, batch2 - required. The first two batches to interleave.
- batch3, batch4, batch5, batch6 - optional. Plug in up to six if you're doing multi-way merges.
Output: batch - a single batch of the same type you fed in, alternating across all inputs. Wire it to a VAE Decode (if it's LATENT), or straight into a Save Video / the FFmpeg Merge Frames node if it's IMAGE, to render the interleaved sequence as a video.
Install
Same pack as its siblings, same steps - ComfyUI Manager (search "ComfyUI-ffmpeg-toolkit") or:
cd ComfyUI/custom_nodes
git clone https://github.com/RCAKangle/ComfyUI-ffmpeg-toolkit
restart, and you're done. This is the one node in the pack that doesn't care about ffmpeg at all, so if you only need the interleave you can skip the binary entirely. Python-side it wants only numpy and Pillow, both already in a stock ComfyUI environment.
The errors to expect: "All inputs must have the same type" when you mix IMAGE and LATENT, "All inputs must have the same shape" on a resolution mismatch, and the silent-truncation warning when batch sizes differ. None of these are bugs - they're the node telling you the interleave math doesn't line up. Fix the mismatch and it just works.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| batch1 | IMAGE,LATENT | First batch to interleave. | |
| batch2 | IMAGE,LATENT | Second batch to interleave. | |
| batch3opt | IMAGE,LATENT | Third batch to interleave. | |
| batch4opt | IMAGE,LATENT | Fourth batch to interleave. | |
| batch5opt | IMAGE,LATENT | Fifth batch to interleave. | |
| batch6opt | IMAGE,LATENT | Sixth batch to interleave. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| batch | IMAGE,LATENT | — |