Nodes/ComfyUI_SwiftCut/Select Images Advanced
ComfyUI Node

Select Images Advanced

Frame Selection With Presets, for When You Can't Be Bothered With Syntax

By yichengup·Created about a year ago·Updated 8 months ago· 10
Select Images Advanced
  • image
  • selected_images
  • selected_indexes
selection_modecustom
indexes0
n_count5
step2
seed0
err_if_missingtrue
err_if_emptytrue

Select Images Advanced is the slightly smug older sibling of Select Images: same idea, same index-string parser underneath, but it adds a selection_mode dropdown so you don't have to type ranges for the five most common jobs. "First N frames," "last N frames," "every Nth frame," "N random frames" - all one click. It's the node you reach for when you keep writing 0-10:2 and thinking "there has to be a button for this."

The modes

  • custom - same string grammar as Select Images (5, 1,3,5, 3-10, 0-10:2, negatives). Identical behavior.
  • first_n - the first n_count frames.
  • last_n - the last n_count frames.
  • every_nth - every step frames, starting at 0.
  • random - n_count frames picked at random, seeded by the seed input so you can reproduce a given pick.

Under the hood each mode just builds an index string and feeds it to the same parser as the plain node - same dedupe-and-sort behavior, same err_if_missing / err_if_empty safety toggles.

The output that makes it worth having

Two outputs, and the second one is the sleeper feature: selected_images is the batch you asked for, but selected_indexes returns the actual index string that got used. When you pick random, that's genuinely useful - you can see exactly which frames got chosen and, say, echo that string into another node that needs to match. It's also a great debugging tool: watch what first_n really did before you trust it downstream.

The honest take

Let's be real: this is a thin utility, and in a pack this obscure you're not going to find anyone recommending it. But it sits right in the gap where ComfyUI's stock batch nodes end and your patience for index math begins. If you're doing "take every 4th frame from a 48-frame generation and upscale just those," every_nth beats typing ranges, and the seed on random selection is a genuinely nice touch for pulling a repeatable "lucky frames" sample.

One thing to keep in mind: random sorts its picks, so it's random selection, not random shuffling - the output stays in original frame order. And first_n/last_n clamp silently to the batch size if you ask for more than exists.

Installing it

Same pack, same steps as every SwiftCut node - ComfyUI Manager, search "ComfyUI_SwiftCut," or:

cd ComfyUI/custom_nodes
git clone https://github.com/yichengup/ComfyUI_SwiftCut

Restart ComfyUI, look under YC_VideoCutHelper → Image Tools. Only torch/Pillow/numpy to worry about, no models, no heavy dependencies. If you already run plain Select Images, this is a zero-cost upgrade for the modes.

CategoryYC_VideoCutHelper/Image Tools

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
selection_modeCOMBOcustom5 options: custom, first_n, last_n, every_nth, random
indexesSTRING0
n_countINT51–1000
stepINT21–100
seedINT00–2147483647
err_if_missingBOOLEANtrue
err_if_emptyBOOLEANtrue

Outputs (2)

NameTypeDescription
selected_imagesIMAGE
selected_indexesSTRING