ComfyUI Node

List Pick

The seed dial, but for whole prompts — List Pick in ComfyUI

By bulentgercek·Created 2 days ago·Updated a day ago· 1
List Pick
    • string
    • index
    • count
    string_list
    start_index0
    control_after_generationrandomize
    skip_emptytrue
    striptrue

    If you've ever wanted to generate the same scene under five different camera angles and compare them side by side, you know the ComfyUI way to do it: retype the prompt, hit Queue, retype, hit Queue, repeat. List Pick gives a text list the exact same increment / decrement / randomize control that ComfyUI already gives an integer seed - except instead of cycling numbers it cycles whole lines of text. Paste your variations into a multiline box, pick a mode, and each run hands you the next line.

    It's a small node from bulentgercek/bulentgercek-nodes, a dependency-free pack of text utilities (List Pick, its bigger sibling Prompt Builder, and String Line Count). No models, no API keys, nothing to download.

    The inputs that matter

    • string_list (multiline) - one item per line. This is your pool.
    • start_index - where picking starts. Read the tooltip twice: it's a starting point, not a lower bound. Increment and decrement wrap around the whole list, so a high start_index does not pin you above a floor.
    • control_after_generation - fixed / increment / decrement / randomize. Default is randomize, which surprises people who assume they'll get a clean cycle.
    • skip_empty (default on) - blank lines are dropped before indexing, so they don't eat a step.
    • strip (default on) - trims whitespace off the returned line. Leave it on; stray indentation in a prompt is invisible until it isn't.

    Outputs: string (the picked line - wire it into a CLIP Text Encode or anywhere text goes), index (which line was picked), and count (how many usable lines remain after skip_empty).

    How the picking actually works

    Under the hood the node splits on newlines (it normalizes \r\n too), applies skip_empty, clamps start_index into 0..count-1, and resolves the next index. increment and decrement walk around the list, wrapping past the last line back to line 0. randomize does a uniform pick every run.

    Two implementation details are worth knowing because they explain behavior you'll otherwise find odd. First, for every mode except fixed, the node returns float("nan") from its IS_CHANGED - the standard "always re-run me" idiom in ComfyUI, the same trick seed-farming nodes use. Without it the execution cache would freeze the picker at line one and never advance. Second, the increment/decrement counter lives server-side in a plain Python dict keyed by the node's id, because ComfyUI doesn't hand custom nodes any built-in control state.

    That leads to the real gotcha. The counter resets when you change start_index, when the usable line count changes, or when you press Queue. A single Queue press with a batch count of N walks N lines forward from start_index, then the next Queue press starts over from start_index again. It deliberately does not keep drifting across separate queue presses the way a seed set to increment does. If you want variety across many separate runs, use randomize or batch inside one queue action. The frontend also decorates the node with a line-number gutter that highlights the line about to be picked before a run and the one actually picked after, plus read-only "generation result" and "count" rows.

    The pattern you'll actually use

    The clean workflow: put N prompt variants in string_list, set mode to increment, set the batch size to N, and Queue once. You get one image per line, in order, ready to eyeball in the gallery. Add a count wire somewhere that wants to know how many options exist, or feed index into logic if you want different behavior per slot. Lines are taken literally - the author pins ComfyUI's {a|b} dynamic-prompts expansion off on this input, so whatever per-run variety you want lives in your list, not in braces.

    Install

    Either ComfyUI Manager (search "bulentgercek"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/bulentgercek/bulentgercek-nodes
    

    then restart ComfyUI. There are no extra dependencies and nothing to download. One honest caveat: the pack is young and small, so don't expect the polish or community weight of an rgthree - but for one job it's genuinely the tool.

    Categorybulentgercek/text

    Inputs (5)

    NameTypeDefaultDescription
    string_listSTRINGOne item per line.
    start_indexINT00–4294967295Starting point for picking. Not a lower bound - increment/decrement wrap around the whole list (0..count-1).
    control_after_generationCOMBOrandomizeHow the index changes after each run (fixed / increment / decrement / randomize).
    skip_emptyBOOLEANtrue
    stripBOOLEANtrue

    Outputs (3)

    NameTypeDescription
    stringSTRING
    indexINT
    countINT