Indices Generator π€
Pull N evenly-spaced frames out of any clip
- indices
Say you have a 250-frame clip and you want four keyframes, evenly spaced, to feed an image-to-image or image-to-video pass. Doing that arithmetic by hand - or worse, in a calculator - is exactly the kind of fiddly step that should be a node. This one is: give it the total frame count and the number of images you want, and it hands back a comma-separated list of equally-spaced frame indices.
How it works
Two integer inputs, both plain:
frames_count- total frames in the clipimages_count- how many indices you want out
The math is a straight division: step = frames_count / images_count, rounded, then it walks 0, step, 2*step, ... up to the frame count and trims to exactly images_count entries. The author's own example: 250 frames and 4 images β 0, 62, 124, 186. The output indices is a STRING, comma-separated, ready to paste into any node that consumes a frame-index list.
Where it fits
This is keyframe-extraction glue. The same pack's List Video Path gives you the clip, this gives you the frames worth looking at, and downstream you're typically picking those frames as images for an img2img or a multi-shot consistency workflow - the kind of thing that keeps a character or a scene coherent across a video, which is a whole discipline on its own. If you're generating a few posters or stills from a video, this is your "which frames do I render" answer.
Installing the pack
Search "Robe Nodes" in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/RobeSantoro/ComfyUI-RobeNodes
Restart ComfyUI and it's there. No models, no downloads; the pack's dependencies are Manager-handled.
Where people get burned
The node gives you no protection against silly inputs, and one of them actually crashes it. If images_count is 0 you get a division-by-zero error, and if images_count is larger than frames_count, the step rounds down to 0 and Python's range() throws a ValueError. So keep 0 < images_count <= frames_count and you're fine. Also note the defaults are both 0 - you will get an empty string until you type real numbers in.
Three numbers in, one string out, no surprises when you respect the range. For batch video work that's exactly the kind of small win that stops you reaching for a spreadsheet.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| frames_count | INT | 0 | β |
| images_count | INT | 0 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| indices | STRING | β |