Nodes/AUN ComfyUI Nodes/String List Builder
ComfyUI Node

String List Builder

The honest way to keep a prompt list inside your graph

By loz2754·Created 8 months ago·Updated a day ago· 5
String List Builder
    • string_list
    num_inputs1
    string_1
    string_2
    string_3
    string_4
    string_5
    string_6
    string_7
    string_8
    string_9
    string_10
    string_11
    string_12
    string_13
    string_14
    string_15
    string_16
    string_17
    string_18
    string_19
    string_20

    Most text-switch nodes make you type every prompt into a wall of tiny widgets, and then you've got a node the size of a skyscraper. String List Builder takes the opposite route: keep your strings as a list of values, and switch on them somewhere else. It builds a proper typed AUN_STRING_LIST from up to 20 multiline strings - and because the inputs are real widgets saved with the workflow, your list of prompts travels with the graph and survives reloads.

    What it does

    You give it a num_inputs (how many of the 20 possible strings to include) and fill in string_1 through string_N. It compiles them, in order, into a single AUN_STRING_LIST output. That output is meant to feed String List Index, which picks one string by a 1-based index - so the Builder is the data, and the Index node is the switch. Two-node split, but each half is tiny and readable.

    The strings are multiline and support dynamic prompts, which matters more than it sounds: you can put multi-line text blocks or wildcard-style expressions into a slot and have them expand when they're finally used as a prompt.

    Inputs and outputs

    • num_inputs - how many strings to include, 1–20. It's the closest thing this node has to a "show/hide" control: raise it to expose more slots, lower it to shrink the node.
    • string_1string_20 - the content, multiline. Anything beyond num_inputs is ignored.
    • Output: string_list (type AUN_STRING_LIST) - wire into a String List Index node.

    How it works

    Simple and predictable: it clamps num_inputs to 1–20, collects exactly that many strings, and returns them as a Python list wrapped in the AUN list type. No dedup, no filtering, no surprises - the order you type them is the order they come out, and index 1 in the downstream node is string_1. That predictability is the whole appeal: it's a container, not a cleverness machine.

    Why you'd want it

    Two reasons. First, separation of concerns: the list lives in one compact node, and the selection logic lives in another - so you can drive the selection from a random/select node, a counter, or even another workflow without touching the data. Second, it pairs with the pack's convention of index-driven switching. If you already use AUNRandomIndexSwitch or Text Index Switch 4 for prompts, this gives you the same "index selects from a list" pattern for arbitrary strings - filenames, prefixes, tags, negative-prompt variants.

    The honest alternative: if your strings are short one-liners and you want the switch built in, Text Index Switch 4 collapses everything into one node. The Builder+Index split is better when your strings are long (multi-line prompts), when you want the list reusable, or when you like seeing data and logic as separate boxes on the canvas.

    Installing

    It's part of the AUN ComfyUI Nodes pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/loz2754/AUN-ComfyUI-Nodes
    

    Restart ComfyUI, or install via ComfyUI Manager (search "AUN"). No models, no heavy deps beyond the pack standard, auto-installed by Manager or with pip install -r custom_nodes/AUN-ComfyUI-Nodes/requirements.txt for manual clones.

    One tip: remember the downstream String List Index is 1-based - index 1 selects the first string, which is easy to forget if you've been living in zero-based programming. Get that wrong once and the fix is a one-number edit.

    CategoryAUN Nodes/Text

    Inputs (21)

    NameTypeDefaultDescription
    num_inputsINT11–20Number of string inputs to include in the list (1-20).
    string_1STRINGString 1. Supports multiline text and dynamic prompts.
    string_2STRINGString 2. Supports multiline text and dynamic prompts.
    string_3STRINGString 3. Supports multiline text and dynamic prompts.
    string_4STRINGString 4. Supports multiline text and dynamic prompts.
    string_5STRINGString 5. Supports multiline text and dynamic prompts.
    string_6STRINGString 6. Supports multiline text and dynamic prompts.
    string_7STRINGString 7. Supports multiline text and dynamic prompts.
    string_8STRINGString 8. Supports multiline text and dynamic prompts.
    string_9STRINGString 9. Supports multiline text and dynamic prompts.
    string_10STRINGString 10. Supports multiline text and dynamic prompts.
    string_11STRINGString 11. Supports multiline text and dynamic prompts.
    string_12STRINGString 12. Supports multiline text and dynamic prompts.
    string_13STRINGString 13. Supports multiline text and dynamic prompts.
    string_14STRINGString 14. Supports multiline text and dynamic prompts.
    string_15STRINGString 15. Supports multiline text and dynamic prompts.
    string_16STRINGString 16. Supports multiline text and dynamic prompts.
    string_17STRINGString 17. Supports multiline text and dynamic prompts.
    string_18STRINGString 18. Supports multiline text and dynamic prompts.
    string_19STRINGString 19. Supports multiline text and dynamic prompts.
    string_20STRINGString 20. Supports multiline text and dynamic prompts.

    Outputs (1)

    NameTypeDescription
    string_listAUN_STRING_LIST