Nodes/Frog Node Pack/🐸 Wildcard Resolver
ComfyUI Node

🐸 Wildcard Resolver

Turn __files__ and {choices} into a real prompt

By RabbitThatIsPinkΒ·Created 3 months agoΒ·Updated 24 days agoΒ· 1
🐸 Wildcard Resolver
    • resolved_text
    • debug
    β—„string_inputβ€”β–Ί
    β—„seed0β–Ί
    β—„use_builtin_oppositestrueβ–Ί
    β—„use_autodetected_pairstrueβ–Ί

    This is the node that actually does the wildcard work. If 🐸 Wildcard Box is where you write __hair/color__, this is where that notation gets turned into a concrete red hair at queue time. Give it a string full of wildcards, and it resolves file-based wildcards, inline {a|b|c} choices, and even tries to keep opposing choices from conflicting - then hands you a prompt with zero __ left in it.

    Let's talk about what "resolves" means, because that's the mechanism and it's where the interesting design choices live. Feed it __hair/color__, {sitting|standing|running}, __clothing__, and the resolver does three passes:

    1. File wildcards - __hair/color__ reads wildcards/hair/color.txt and picks one line, seeded from the seed input.
    2. Inline choices - {sitting|standing|running} picks one option.
    3. Opposite deconfliction - here's the part most simple wildcard systems skip. If your wildcard files would randomly produce "left hand raised, right hand raised" or "looking left, looking right," the resolver tries to stop the contradiction.

    That last feature is why the node has two extra toggles you won't find on a bare wildcard resolver: use_builtin_opposites (auto-swaps pairs like left/right, top/bottom, over/under - there's a hardcoded list of ~34 built-in opposite pairs in the source) and use_autodetected_pairs (detects opposing pairs from your own {a|b} groups). Both default to on. The idea: wildcards are supposed to add variety, and nothing kills variety like a prompt that contradicts itself.

    The seed behavior matters for reproducibility: seed = 0 means random each run; any other value makes the same string + same seed produce the same picks, every time. If you want a wildcard-varied batch that you can still reproduce when you find a keeper, wire a fixed seed in.

    Inputs and outputs, the short version: string_input (the text to resolve), seed, use_builtin_opposites, use_autodetected_pairs, and out the other side resolved_text plus a debug string that logs which files got picked and which opposites got swapped. The debug output is genuinely useful when a prompt comes out weird - it's the record of what the resolver chose.

    Now the honest bit: this node is deprecated in the pack. The README is upfront that 🐸 Prompt Processor supersedes it (along with Merge, Sorter, and Dedupe), and existing workflows won't break - but if you're building fresh, you should probably skip straight to Prompt Processor, which does resolve β†’ sort β†’ dedupe in one node. Reach for Wildcard Resolver alone if you have a simpler pipeline that just needs expansion with no sorting, or you're maintaining an older workflow.

    Installing it

    Ships in Frog Node Pack:

    • ComfyUI Manager: search Frog Node Pack, install, restart.
    • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/RabbitThatIsPink/FrogNodePack, restart, hard-refresh (Ctrl+Shift+R).

    No extra pip dependencies (requirements.txt is empty; Pillow ships with ComfyUI). Find 🐸 Wildcard Resolver under 🐸 Node Pack.

    Common issues

    Wildcards not resolving β†’ check the text actually contains __name__ (file wildcards) or {a|b} (inline), and that your .txt files live in ComfyUI/wildcards/ (the pack checks the ComfyUI root first, then its own folder). Same result every run β†’ your seed is nonzero and fixed; that's expected. Contradictory outputs β†’ both opposite toggles default on; if the auto-pair detection is mangling something unusual, flip use_autodetected_pairs off. And if a prompt still contains __, a resolver isn't in the chain at all - double-check the wiring.

    Category🐸 Node Pack

    Inputs (4)

    NameTypeDefaultDescription
    string_inputSTRINGWired string containing wildcards to resolve.
    seedINT00–18446744073709550000Seed for wildcard picks. 0 = random each run.
    use_builtin_oppositesBOOLEANtrueUse built-in opposite pairs (right/left, top/bottom, etc.) to prevent duplicates. Only activates pairs found in wildcard groups.
    use_autodetected_pairsBOOLEANtrueAuto-detect opposite pairs from {a|b} wildcard groups.

    Outputs (2)

    NameTypeDescription
    resolved_textSTRINGβ€”
    debugSTRINGβ€”