Nodes/RyanOnTheInside/Image Index Select βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
ComfyUI Node

Image Index Select βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜

Pull a single frame out of a batch by index

By ryanontheinsideΒ·Created 2 years agoΒ·Updated 5 months agoΒ· 852
Image Index Select βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
  • image
  • IMAGE
β—„indices0β–Ί
β—„filter_behaviorwrapβ–Ί

A small, genuinely useful utility: given a batch of images (a video sequence, a batch of generations, whatever), pull out exactly the one at a given index. No AI, no effect, just indexing - the kind of node you don't think about until you need it, and then you need it constantly, especially in video workflows where you want to inspect or reuse one specific frame.

How it works

You give it an IMAGE batch and an integer indices, and it returns the image at that position. The interesting part is what happens when your index doesn't actually exist in the batch - that's what filter_behavior controls.

The inputs and outputs that matter

  • image (IMAGE, required) - your batch/sequence.
  • indices (default 0, range 0–100000) - which position to pull. 0-indexed, like almost everything in ComfyUI.
  • filter_behavior (default wrap) - what happens when the index is out of range for the batch you gave it:
    • wrap - loops back around (like modulo), so an index past the end of a 10-frame batch just cycles back toward the start.
    • ignore - presumably skips/no-ops rather than erroring.
    • error - fails loudly, useful when you want to catch a wiring mistake instead of silently getting an unexpected frame.
  • Output - a single IMAGE.

How to install it

Via ComfyUI Manager: search "RyanOnTheInside," install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside.git
cd ComfyUI_RyanOnTheInside
pip install -r requirements.txt

then restart ComfyUI. No downloads needed - pure indexing logic.

Common issues & troubleshooting

You expected an error on an out-of-range index and got a frame back instead. Check filter_behavior - wrap is the default, and it's silent by design: it never fails, it just cycles the index back into range. If you want out-of-range access to be loud and obvious (say, while debugging a batch-size mismatch elsewhere in your graph), switch to error.

Got the "wrong" frame from a wrapped index and it took a while to notice. This is the flip side of wrap's convenience - if your upstream batch size changes (say, a different video with fewer frames than you expected), an index that used to point at frame 47 might silently wrap to frame 7 on a shorter batch instead of telling you something's off. If correctness matters more than never-erroring, error is the safer default while you're actively building a graph.

Selecting multiple specific frames, not just one. The field is called indices (plural) but the schema exposes it as a single integer, so as shipped this pulls one frame per node instance. For multiple specific frames, you'd chain multiple Image Index Select nodes rather than expecting one node call to return several.

CategoryRyanOnTheInside/Utility/Batches

Inputs (3)

NameTypeDefaultDescription
imageIMAGEβ€”
indicesINT00–100000β€”
filter_behaviorCOMBOwrap3 options: ignore, error, wrap

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”