Get Batch By Index (Warper)
Pull one chunk out of your batched frames
- image_batches
- IMAGE
Split your frames into batches with Smart Video Batcher (Warper) or Smart Overlapping Batcher (Warper) and you've got a list of chunks. Now what? Those chunks come out on a wire type - IMAGE_BATCHES - that nothing else in ComfyUI accepts. Get Batch By Index (Warper) is the bridge: it takes that list, an index, and hands you one batch back as a normal IMAGE tensor you can actually feed a sampler. It's the second half of the looping pattern this pack is built around.
It's from ComfyUI Warper Nodes, the niche pack by workflow author AIWarper. On its own it's two inputs and one output; in the context of a looping video pipeline it's what lets you process a 600-frame clip one sampler-friendly chunk at a time. You'd typically drive the index with an incremental integer counter so each loop pass picks up the next chunk.
How it works
Two inputs, no config to speak of:
image_batches- the list of batches, straight from either batcher node in this pack.index- which batch you want, 0-based. Default 0.
The node returns that batch as a standard IMAGE. It's defensively coded where it matters: an empty input list returns an empty tensor (so downstream nodes don't hard-crash, though they won't do anything useful either), and an out-of-range index returns the last batch with a console warning instead of killing the queue. That last behavior is worth knowing - if you're looping and your counter runs past the end, you'll silently process the final batch twice rather than stop.
Installing it
Same as every Warper node. ComfyUI Manager → search "ComfyUI-WarperNodes" → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/AIWarper/ComfyUI-WarperNodes
# restart ComfyUI
No dependencies beyond torch. The RAFT model download in the README is only for Flow Visualizer; you'll never touch it here.
Common issues
The honest truth: this node only makes sense as the tail end of the pack's own batchers. If you're not feeding it IMAGE_BATCHES from one of those, you have no reason to reach for it - it won't accept a regular IMAGE, and ComfyUI will refuse the connection. The out-of-bounds fallback (last batch, with a warning) is the main thing that bites people who assume it errors cleanly; if your loop count drifts, you get silent repetition, so clamp your counter to len(batches) - 1. And an empty image_batches gives you an empty tensor that then feeds an empty batch downstream - the failure mode is downstream confusion, not a clear error here.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image_batches | IMAGE_BATCHES | — | |
| index | INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |