Files
Max Toball a3343e169a Pick one item out of a ComfyUI list by index
ComfyUI has two things that both get called a list, and the difference is the
whole reason this node exists. A *list output* -- a socket flagged
OUTPUT_IS_LIST, which is what the built-in Create List produces -- is never
delivered to downstream nodes: the executor runs them once per item and
collects the results. A node only receives the list whole if it declares
INPUT_IS_LIST.

So a generic "index into any input" node that omits INPUT_IS_LIST is invoked
once per element and returns each in turn. From the graph that looks like the
index being ignored, which is a difficult thing to debug, because the node is
working exactly as written on one item at a time, having never seen a list.

This declares INPUT_IS_LIST and returns a single item. The consequence is that
every input arrives wrapped, index included -- a widget set to 3 shows up as
[3] -- so unwrapping is the other half of the job.

The index widget carries control_after_generate, so setting it to increment
walks one step per queued job: define the prompts once, queue N runs, get one
prompt each. wrap mode lets you queue more jobs than you have items.
2026-08-31 18:30:56 +02:00
..