Nodes/comfyui-lumi-tools/Lumi Wildcard Processor
ComfyUI Node

Lumi Wildcard Processor

Wildcards, the ComfyUI way — random picks from your own word banks

By illuminatianon·Created 9 months ago·Updated 4 months ago· 0
Lumi Wildcard Processor
    • processed text
    wildcard_text
    populated_text
    modepopulate
    seed0
    select_wildcardSelect the Wildcard to add to the text

    If you've ever wanted "a random color, a random location, a random style" without hand-rolling ten prompt variations, wildcards are the answer - and Lumi Wildcard Processor brings that to your ComfyUI graph. You write a prompt with wildcard references like __color__ and __location__, the node picks a random value for each from your word-bank files, and it hands back the fully resolved prompt. One queue run becomes a surprise, and with a seed you can make that surprise reproducible.

    The engine underneath is the dynamicprompts library - the same machinery behind Impact Pack's wildcards and A1111's dynamic prompts - so the syntax is the familiar one: __name__ references a file of options, and the richer {a|b|c} alternative syntax works too. The node is an explicit descendant of Impact Pack's Wildcard Processor, which is a strong pedigree for a utility this boring-looking.

    The inputs that matter

    • wildcard_text - your prompt written with wildcard syntax, e.g. a __color__ car in __setting__, sunset.
    • populated_text - where the resolved result lands. This is the widget you see, and the node writes the final pick into it - so you can always read exactly what got chosen. In some modes you can edit it yourself.
    • mode - the three-way switch that makes this node actually smart:
      • populate (default) - overwrites populated_text with the processed result. You can't hand-edit the output here.
      • fixed - ignores wildcard_text entirely and uses populated_text as-is (editable). Turn this on when you've found a resolution you like and want to lock it.
      • reproduce - one-shot: behaves like fixed once so you keep the current pick, then flips to populate for future runs.
    • seed - makes the random picks reproducible; same seed, same wildcard values.
    • select_wildcard (optional) - a dropdown of all your available wildcards, formatted as __name__, so you can add one to the text without remembering filenames.

    Output: processed text, a single STRING - the resolved prompt, ready for your encoder or an LLM pass.

    Where the wildcards live

    The node looks in several places, in priority order: the LUMI_WILDCARDS_PATH environment variable, any wildcards: paths you declare in ComfyUI/extra_model_paths.yaml, and the ComfyUI/wildcards folder. The YAML route is the clean one for a big library:

    my_wildcards:
      wildcards: D:/dev/wildcards
    

    Each .txt file in those folders is one wildcard - colors.txt gives you __colors__, with one option per line. The node caches the list but invalidates on file changes, so dropping a new file in usually just works.

    Installing

    cd ComfyUI/custom_nodes
    git clone https://github.com/illuminatianon/comfyui-lumi-tools
    cd comfyui-lumi-tools
    uv sync
    

    Restart ComfyUI, or grab "Lumi Tools" from ComfyUI Manager. Note that dynamicprompts is one of the pack's two real dependencies, so the first launch after install pulls it in.

    Where people get burned

    The usual trio. First, an empty wildcard set: if the dropdown shows nothing, your files aren't in a path the node can see - check the YAML key name and the folder structure. Second, mode confusion: leaving it in populate and hand-editing populated_text does nothing, because the next run overwrites it - that's exactly what fixed is for. Third, forgetting that wildcards are random even between runs: if a render is great but unreproducible, you forgot to set the seed. And one honest note for LLM-encoded models: wildcard chunks like masterpiece are largely inert there - the resolved prompt still works, but the value of randomizing tag lists shrinks compared to SDXL-lineage models, where this node is a proper workflow staple.

    CategoryLumi/Prompt

    Inputs (5)

    NameTypeDefaultDescription
    wildcard_textSTRINGEnter a prompt using wildcard syntax.
    populated_textSTRINGThe actual value passed during execution. Wildcard syntax can also be used here.
    modeCOMBOpopulatepopulate: Overwrites 'populated_text' with processed 'wildcard_text'. fixed: Uses populated_text. reproduce: one-shot fixed then populate.
    seedINT00–18446744073709550000Random seed for wildcard processing.
    select_wildcardoptCOMBOSelect the Wildcard to add to the text3 options: Select the Wildcard to add to the text, __samples/flower__, __samples/jewel__

    Outputs (1)

    NameTypeDescription
    processed textSTRING