Nodes/ComfyUI_Fill-Nodes/FL Prompt Selector
ComfyUI Node

FL Prompt Selector

Pick one prompt from a list by index

By filliptm·Created 3 years ago·Updated about an hour ago· 628
FL Prompt Selector
    • STRING
    prepend_text
    prompts
    append_text
    index0

    You've got a list of twenty prompts you want to run, one per generation, and you don't want to paste them one at a time. FL_PromptSelector lets you keep them all in a single text box, one per line, and pull out whichever line you want by number. Change the index, get a different prompt. Wire the index to a counter or bump it by hand per run, and you've got a clean way to sweep through a batch of ideas without editing your prompt every time.

    It also does the boring-but-useful wrapping job: you can set text to glue on the front and back of every selected line, so shared boilerplate (a quality tag block, a style suffix, a trigger word for a LoRA) lives in one place instead of being copy-pasted into all twenty lines. It handles the spacing for you, so you don't end up with words jammedtogether.

    The inputs and output

    • prompts (multiline STRING) - your list, one prompt per line. This is the pool it selects from.
    • index (0–6969) - which line to grab. 0 is the first line. This is the knob you change to move through the list.
    • prepend_text (multiline) - text stuck on the front of the selected line, with a space inserted automatically.
    • append_text (multiline) - text stuck on the end, same auto-spacing.

    Output is a single STRING - the assembled prompt (prepend + selected line + append) - which you feed straight into your CLIP Text Encode.

    The prepend/append is the difference between this and the pack's barer FL_PromptSelectorBasic, which just grabs a line by index with no wrapping and loops the index with modulo so it never goes out of bounds. If all you want is "line N," the Basic one is fine. If you want "line N wrapped in my standard scaffolding," this is the one.

    Installing it

    FL_PromptSelector ships in ComfyUI_Fill-Nodes. ComfyUI Manager: search Fill-Nodes, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
    

    then restart ComfyUI. No downloads - it's plain text handling.

    How to actually use it in a sweep

    The trick that makes this powerful is driving index automatically. Pair it with a counter or the queue count so each queued run advances to the next line, and you can queue up 20 generations that each use a different prompt from your list - a poor-man's prompt-matrix, no wildcard extension required. Keep your shared style in prepend_text/append_text and vary only the per-line subject, and you get consistent treatment across the whole set. The one thing to watch: unlike the Basic variant, if you ask for an index past the end of your list you're relying on the node's own handling rather than a guaranteed wrap, so keep the index within the number of lines you actually wrote, or let your counter reset at the list length.

    Category🏵️Fill Nodes/Prompting

    Inputs (4)

    NameTypeDefaultDescription
    prepend_textSTRING
    promptsSTRING
    append_textSTRING
    indexINT00–6969

    Outputs (1)

    NameTypeDescription
    STRINGSTRING