Nodes/ComfyUI-VideoHelperSuite/Select Images πŸŽ₯πŸ…₯πŸ…—πŸ…’
ComfyUI Node Runs on cloud

Select Images πŸŽ₯πŸ…₯πŸ…—πŸ…’

Pick specific frames by index, range, or step

By KosinkadinkΒ·Created 3 years agoΒ·Updated 3 months agoΒ· 1,727
Select Images πŸŽ₯πŸ…₯πŸ…—πŸ…’
  • image
  • IMAGE
β—„indexes0β–Ί
β—„err_if_missingtrueβ–Ί
β—„err_if_emptytrueβ–Ί

This is the Swiss-army knife for grabbing exactly the frames you want out of an image batch. Hand it a batch and a little index string, and it returns the frames you named - a single one, a scattered handful, a range, every other frame, or the whole thing reversed. If you know Python slicing, you already know how to drive it, because it borrows Python's exact syntax. It's the frame-picking utility in Kosinkadink's VideoHelperSuite, and it's genuinely one of the handier nodes in the pack once you get the notation.

Where it shines: pulling the last frame of a video to continue a sequence, extracting a specific still to inspect, dropping a bad frame, reordering, or reversing a clip. All the fiddly "I just need frame 47" and "give me frames 10 through 20 backwards" tasks that are annoying to do any other way.

How it works

You provide a comma-separated list of indexes in the indexes widget, and it returns those items in the order you asked. It's zero-based, negative indexes count from the end, and colon ranges work Python-style (end excluded), with an optional step. Straight from the node's own examples, assuming 16 frames (indexes 0–15):

  • 0 returns frame 0; -1 returns the last frame.
  • 0, 1, 13 returns those three.
  • 0:5, 13 returns 0,1,2,3,4 and 13.
  • 0:-1 returns everything except the last.
  • 0:5:-1 returns 4,3,2,1,0 (reversed range).
  • 0:5:2 returns 0,2,4 (every other).
  • ::-1 reverses the whole batch.

The inputs that matter

  • image - the batch to pick from.
  • indexes - the selection string (default "0"). This is the whole game; everything above is valid here.
  • err_if_missing (default true) - throw an error if you ask for an index that doesn't exist, instead of silently skipping it.
  • err_if_empty (default true) - error if the selection ends up empty.

The single output is IMAGE, the selected frames in your requested order.

How to install it

ComfyUI Manager: search ComfyUI-VideoHelperSuite, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite

then restart. No weights.

Common issues & troubleshooting

"Index out of range" errors. You asked for a frame that isn't there - say index 20 in a 16-frame batch. Either fix the index or set err_if_missing to false to have it skip missing ones quietly (handy when batch length varies run to run).

I got an empty result and the graph stopped. err_if_empty is true by default, so an empty selection halts execution deliberately. Set it false if an empty output is acceptable in your flow.

My reverse/step isn't working. Double-check the colon syntax - it's start:stop:step, stop is exclusive, and a negative step reverses. ::-1 (empty start and stop) is the clean "reverse everything."

CategoryVideo Helper Suite πŸŽ₯πŸ…₯πŸ…—πŸ…’/image

Inputs (4)

NameTypeDefaultDescription
imageIMAGEβ€”
indexesSTRING0β€”
err_if_missingBOOLEANtrueβ€”
err_if_emptyBOOLEANtrueβ€”

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”