List Selector
Step through a prompt list across queue runs
- prompt_list
- prompt
- current_index
If you batch-generate, you've hit the problem this node exists for: you have a LIST of prompts (from this pack's PromptListWithTemplates, or the Wildcard Manager's line-by-line output, or any other list source) and you want each queue run to consume one item from the list, in order, without manually rewiring anything between runs. The List Selector remembers where it is per node and hands out the next prompt each time.
Think of it as a cursor over a list that persists across queue runs. Impact Pack has its own PromptList; this is the "walk through the list one at a time" companion.
How it works
The node keeps a per-instance counter keyed by its node ID in a class-level dictionary, so each List Selector in your workflow tracks its own position independently. Each run, it picks based on mode:
all_run- dumps the whole list out at once (useful for batch of N).selected- jumps to a fixedindexand returns only that item. No state, pure lookup.increment- returns the current item, then advances the counter. This is the mode that makes "one prompt per queue run" work.
In increment mode, stop_at_end decides the end-of-list behavior: False (default) loops back to the start; True halts the queue (it calls ComfyUI's interrupt_processing) and tells you to reset. The reset_counter toggle resets the position to zero - it's a one-shot switch the frontend flips back after use, so you click it and the next run starts from the top.
Inputs / outputs
prompt_list(required) - aLISTinput; feed it any list-typed output.mode-all_run/selected/increment.index- target index forselectedmode.stop_at_end,reset_counter- end-of-list and reset behavior.- Outputs:
prompt(a list - even a single item comes wrapped, which matches how prompt lists flow in ComfyUI) andcurrent_index(the position, so you can log or preview which prompt fired).
Gotchas
- The output is always a list.
selectedandincrementreturn a one-element list. If your downstream expects a plain string, takecurrent_indexand re-index, or unwrap with a list-to-string helper - the pack's own prompt nodes acceptLISTinputs, so it usually just connects. - Counter state is per node, in memory. It lives in the process, keyed by node ID. Copy-paste a duplicate of the node and it gets its own counter (new ID). Restart ComfyUI and all counters reset to zero - fine for most uses, surprising if you expected persistence across sessions.
IS_CHANGEDalways returns "changed." The node re-executes every run by design so it can advance the cursor, which means it won't be skipped by ComfyUI's caching. That's correct behavior, not a bug.
Install
ComfyUI Manager (search "Santodan"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/Santodan/santodan-custom-nodes-comfyui
Restart. No dependencies, no downloads.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt_list | LIST | — | |
| mode | COMBO | 3 options: all_run, selected, increment | |
| index | INT | 00–18446744073709550000 | — |
| stop_at_end | BOOLEAN | false | — |
| reset_counter | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| current_index | INT | — |