Nodes/ComfyUI-Minimax-H3-Reference-Library/Skeba Get Image From Batch
ComfyUI Node

Skeba Get Image From Batch

Grab one image out of a batch by index — even when the index is 'wrong'

By nikaskeba·Created 13 days ago·Updated a day ago· 2
Skeba Get Image From Batch
  • images
  • image
  • index
index0

Skeba Get Image From Batch is the single-image half of the folder-batch story: feed it an IMAGE list, tell it which index you want, and it hands back one image. The useful bit is that it doesn't care where the list came from. It's marked INPUT_IS_LIST, so it accepts a batch from any loader or node that outputs an IMAGE list - the Skeba folder loader, a video frame extractor, whatever.

How it works

Dead simple: it picks images[index % len(images)]. That modulo is the whole personality of the node. Ask for index 7 of a 5-image batch and you get index 2, not an error. Ask for index 5000 and it wraps around the same way. This is deliberate - it means you can drive it with an incrementing counter, an oscillator, or a Primitive node that goes way past the batch size and the node still lands on a real frame.

Inputs are just images (an IMAGE list, forced as an input so you can't confuse a widget) and index (INT). Outputs are image - a single, non-list IMAGE you can feed to any normal image node - and index, which reports the actual index that was selected after wrapping. That second output is quietly useful: wire it into a filename prefix and your outputs always get the real frame number, not the one you asked for.

Why you'd reach for it

Three jobs, all manual-iteration flavored:

  • Step through a batch. Put the loader output in, connect index to a Primitive INT with a control_after_generate widget, and each queue click advances to the next frame. The wrapped index output tells you which one you're on.
  • Probe one specific shot. You know the frame that's broken - pull exactly it, route it into a reference or inpainting node, leave the rest of the batch alone.
  • A/B an image inside an automated graph. Since it's a plain node, you can drive the index from a scheduler or a loop counter and sample frames across a timeline without re-rendering the whole thing.

Installing it

It's in the ComfyUI-H3-Reference-Library pack (a.k.a. ComfyUI-Minimax-H3-Reference-Library) under Skeba AI Nodes - Utilities. ComfyUI Manager search "Skeba", or:

cd ComfyUI/custom_nodes
git clone https://github.com/nikaskeba/ComfyUI-H3-Reference-Library

Restart ComfyUI. No extra Python dependencies, no model files, nothing to configure.

The one trap

An empty list doesn't error - the source returns a 64×64 black tensor and index 0. If your downstream image is suddenly a small black square, your list was empty, and it happened before this node. Same silent-failure family as the loader's missing-folder case, so when images come out black, check what's upstream before blaming the selector.

CategorySkeba AI Nodes - Utilities

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
indexINT00–10000

Outputs (2)

NameTypeDescription
imageIMAGE
indexINT