Nodes/ComfyUI 1hewNodes/Image Batch Interleave
ComfyUI Node

Image Batch Interleave

Riffle-shuffle your image batch, on purpose

By 1hew·Created about a year ago·Updated 8 days ago· 33
Image Batch Interleave
  • image
  • image
segment_count2

This is a batch-ordering utility, and it doesn't try to be more than that. Image Batch Interleave takes your image batch, chops it into contiguous segments, then reads the segments back in a "column-first" zigzag - like a dealer riffle-shuffling a deck. If you've ever looked at a batch and thought "these frames are in the wrong order for what I'm about to do," this is the node.

It lives in ComfyUI 1hewNodes, the utility grab-bag from solo dev 1hew (bilingual README, active development, very much a "personal toolbox made public" vibe). It's a niche node, and that's fine - when you need it, nothing stock does it.

How it works

Say you have 8 frames and segment_count = 2. The batch is split into two contiguous halves - [0,1,2,3] and [4,5,6,7] - then re-read by taking the first of each, then the second of each: 0,4,1,5,2,6,3,7. With 3 segments it's a three-way interleave. The node clamps segment_count to the batch size, so you can't blow it up with a nonsense value.

Where does this come up in practice? Mostly when a workflow generates frames in grouped runs but needs them interleaved downstream - paired A/B generations, two-pass output you want to fold together, or arranging frames so an alternating effect reads correctly. It's not the node you reach for daily, but it's the node you'll swear at if you try to fake it with a pile of Index nodes.

The inputs

  • image - any IMAGE batch.
  • segment_count - how many contiguous segments to split into (default 2, range 1–100000).

Output is a single image batch, same frames, reordered. That's the whole interface. If your downstream is a video encoder or a sampler that processes in order, plug this between them and the reorder just happens.

Installing it

ComfyUI Manager → search "1hew" / "ComfyUI 1hewNodes" → install → restart. Manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/1hew/ComfyUI-1hewNodes

The pack installs a heavy dependency list (opencv, scikit-image, scikit-learn, plus ultralytics/rembg/transformers for its detection nodes), so the first install may grind for a few minutes. No model files. This node itself only needs numpy/torch.

Troubleshooting

  • "Node not found" on a downloaded workflow - the pack targets the current ComfyUI node API (comfy_api.latest); update ComfyUI before blaming the node.
  • Output looks identical to input - with segment_count = 1 (or equal to the batch size) the reorder is a no-op by design. Check the count.
  • Order still seems off - remember the interleave is column-first, not a true shuffle. If you wanted a different permutation, adjust segment_count rather than expecting a random order. There's also a list-flavored sibling, Image List Interleave, if your frames arrive as an image list instead of a batch.
Category1hewNodes/image

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
segment_countINT21–100000

Outputs (1)

NameTypeDescription
imageIMAGE