Nodes/ComfyUI_Eclipse/Batch Interleave
ComfyUI Node

Batch Interleave

Weave two image batches into one alternating sequence

By r-vage·Created 10 months ago·Updated a day ago· 31
Batch Interleave
  • batch_a
  • batch_b
  • images
  • count

Batch Interleave merges two image batches frame by frame into one: batch_a[0], batch_b[0], batch_a[1], batch_b[1], …. If one batch is longer than the other, its leftover frames get appended at the end. It's a shuffle-merge for image sequences, and it lives in Eclipse's batch-operations family - the nodes you reach for when a workflow deals in frames rather than single images.

What it's actually for

If you're working with video or animation, "a batch" is just "a stack of frames," and there are a surprising number of jobs that want two sequences woven into one:

  • Alternating-frame effects. Interleave two different render passes to build a strobe or flicker effect, or to compare two versions at a glance.
  • Pairing before further processing. Make every even frame one source and every odd frame another, then slice or process the merged sequence downstream.
  • Reassembling split work. Two processes produced halves of a sequence; interleave them back into one timeline in the right order.

The node reports the resulting frame count as a second output, which is handy when a downstream video-save node needs to know how many frames it's getting.

How it works

Under the hood it flattens both input batches to frame lists, zips them together alternating a, b, a, b, appends the remainder of whichever batch is longer, then re-batches the result through Eclipse's image helpers (which normalize the frames back to a consistent tensor shape - so mismatched per-frame dimensions get reconciled rather than erroring). Outputs:

  • images - the interleaved [B,H,W,C] batch.
  • count - an INT with the total number of frames.

Both inputs (batch_a, batch_b) are plain IMAGE sockets. Batch A's frames land on even positions, batch B's on odd.

The honest note

This node is simple, and its utility is proportional to how much frame-level work you do. For a plain image workflow that never thinks about batches, you'll never touch it. But the moment you're doing video, frame interpolation, or multi-pass compositing in Eclipse's ecosystem, "weave two sequences into one" is one of those operations you end up rebuilding by hand in Python every other week - having it as a node is a small gift.

Installing it

Part of ComfyUI_Eclipse, installed once:

cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI_Eclipse

Restart ComfyUI (or ComfyUI Manager → search "ComfyUI Eclipse"). It depends on torch (already present) and nothing extra.

Gotchas

The pack-wide note: ComfyUI_Eclipse was formerly RvTools, and v4.0.0 removed all legacy nodes - old workflows need the Workflow Migration Tool node (or python tools/migrate_workflow.py <workflow.json>) to rewrite old IDs with a backup. And one behavior to remember: the "append leftovers at the end" rule means an unequal pair doesn't error - it just produces a longer tail of whichever batch had extra frames. If your output looks lopsided, that's the shorter batch running out, not a bug.

Category🌒 Eclipse/ Image/Batch Operations

Inputs (2)

NameTypeDefaultDescription
batch_aIMAGEFirst image batch [B,H,W,C]. Its frames are placed at even positions.
batch_bIMAGESecond image batch [B,H,W,C]. Its frames are placed at odd positions.

Outputs (2)

NameTypeDescription
imagesIMAGE
countINT