Nodes/comfyui-mudknight-utils/Wildcard passthrough
ComfyUI Node

Wildcard passthrough

Randomize your prompts from your own wildcard file

By mudknight·Created 8 months ago·Updated 2 months ago· 1
Wildcard passthrough
    • output
    text
    opt_string

    Wildcard passthrough does what the name suggests: it looks at your prompt text, finds keys you've defined as wildcards, and replaces each one with a random value from its list. It's the pack's small answer to the dynamic-prompt idea - the one that lets you roll outfit, pose, background etc. and get a different prompt every run without editing text.

    It's a tiny node and honest about being one: a text input, an optional opt_string, one output. The wildcard definitions live in config/wildcards.jsonc as key → pipe-separated list (e.g. "example": "option1 | option2 | option3"). Whatever keys you define there get swapped for a random choice. If you've used dynaprompt-style nodes, this is the same trick with a smaller surface - which some people prefer, because there's less to go wrong.

    The inputs that matter

    • text - multiline. Contains your prompt with wildcard keys. A key is just the literal text of the dict key appearing in the string (e.g. the key example appearing anywhere in the text), so define keys that are unlikely to show up accidentally.
    • opt_string - optional force-input string. If text is empty, the output is just opt_string (it's a passthrough, hence the name). If text has content, opt_string gets appended to the result with a comma.

    Output: output, the resolved string.

    The important behavior: randomness

    The node's IS_CHANGED forces a re-execution on every run whenever text is non-empty - meaning every execution rolls new random choices, even if nothing upstream changed. That's exactly what you want from a wildcard node (each batch gets fresh values) but it's a deliberate design choice worth knowing: it will not be deterministic between runs, and it will re-roll even inside a single queue if you re-trigger it. If you want a wildcard choice to lock for a whole batch or experiment, this isn't the node for stable iteration - freeze the output text downstream if you need to hold it.

    Installing

    Part of the mudknight utils pack. ComfyUI Manager → search comfyui-mudknight-utils, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/mudknight/comfyui-mudknight-utils
    

    Restart. No model downloads. The default wildcards.jsonc ships with one example key; add your own lists in the same format (or via the Preset Manager UI).

    Gotchas

    • Text comes back unchanged - none of your keys are in the text. Keys match by literal substring, so a typo or a key that's a substring of another key will behave unexpectedly.
    • Undefined keys pass through - if you write {sky} or [sky] and there's no matching key, it just stays in the output as-is. No error.
    • Not deterministic - the IS_CHANGED re-roll is by design, but it surprises people running comparison batches. Expect different results per run.
    • This is not the Prompt (full-pipe) wildcard system - that node has its own wildcard trigger handling; this standalone node uses the same wildcards.jsonc config, but don't assume they share state or behavior beyond the file.

    A small, useful node in a zero-impression pack. The niche use-case - prompt variety from your own word lists - is handled well, as long as you remember it's supposed to be random.

    Categorymudknight/presets

    Inputs (2)

    NameTypeDefaultDescription
    textSTRING
    opt_stringoptSTRING

    Outputs (1)

    NameTypeDescription
    outputSTRING