ComfyUI Node

List Wildcard

Paste a list, get one random line

By LaVie024·Created about a year ago·Updated 8 months ago· 8
List Wildcard
    • STRING
    text
    seed0
    use_newline_as_separatortrue
    separator_if_not_newline

    Wildcards are one of those things the community treats as obvious and beginners discover sideways. The classic workflow: you have a list of things - poses, lighting, artists - and you want each generation to pick one at random. Full wildcard systems (Impact Pack's, the A1111-style ones) read from files. ListWildcard is the "I don't want a file system, I want a textbox" version: paste your list, get one random item out, done.

    Why you'd reach for it

    The niche is people who want wildcard behavior without the machinery. You don't need a wildcard directory, a loader node, and a .txt file for one list of five lighting options. You want a multiline box, a seed, and a random pick. That's this node. The author calls it "dead-simple" and it is - the whole implementation is split, pick, return.

    How it works

    You type (or wire) a multiline text. If use_newline_as_separator is on, each line is one option. If it's off, the text is split on separator_if_not_newline instead - handy for comma- or space-separated lists pasted in one line. The node seeds random from your seed input and returns one random item. That's the entire mechanism, and it's exactly what "wildcard" means in its smallest honest form: an item randomly chosen from a list.

    The inputs that matter

    • text (multiline STRING) - your list, one option per line by default.
    • seed (INT) - controls which item gets picked. Fixed seed = fixed pick.
    • use_newline_as_separator (BOOLEAN, default true) - newline vs custom separator.
    • separator_if_not_newline (STRING, default " ") - the splitter when newlines aren't used.
    • STRING - the winning item, ready to feed into a prompt builder or concat node.

    Installing it

    Part of comfyui-lopi999-nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/LaVie024/comfyui-lopi999-nodes
    

    Restart ComfyUI, or search "comfyui-lopi999-nodes" in ComfyUI Manager. No models, no dependencies.

    Common issues

    The trap is invisible separators. If use_newline_as_separator is on and you paste a comma-separated list on one line, the node treats the whole line as a single option - one item, one winner, always. Same with trailing newlines: a stray blank line becomes an empty option that can win. Keep the list clean, or flip the separator toggle to match how you actually pasted it. And, as always with seeded randomness, a fixed seed means the same item every run - randomize the seed (or let "control after generate" do it) for real variety.

    Categorylopi999/string

    Inputs (4)

    NameTypeDefaultDescription
    textSTRING
    seedINT00–18446744073709550000
    use_newline_as_separatorBOOLEANtrue
    separator_if_not_newlineSTRING

    Outputs (1)

    NameTypeDescription
    STRINGSTRING