Nodes/JStudio_Wildcards/🎲 JStudio Wildcards
ComfyUI Node

🎲 JStudio Wildcards

Seeded if/then logic in a prompt node

By cyanideoverdoseΒ·Created 5 months agoΒ·Updated 5 months agoΒ· 1
🎲 JStudio Wildcards
    • resolved_prompt
    • resolved_negative
    β—„prompt__lucky_ladies/random__β–Ί
    β—„negative_prompt__negatives/global__β–Ί
    β—„seed0β–Ί

    Ever wanted to batch 32 renders and get the same character in thirty-two different outfits, poses and lighting setups without hand-writing thirty-two prompts? That's the old trick of dropping {option_a|option_b} and __wildcard__ tags into a prompt and letting the sampler roll dice. Most people who started ComfyUI after 2024 never learned that syntax, and Impact Pack still quietly provides a version of it. JStudio Wildcards is the version for people who outgrew plain random choice: it's a wildcard resolver where the "wildcards" are actually Jinja2 programs, so your prompt text can run real conditionals, and it keeps everything seeded and negative-aware.

    It's a small, personal pack - one node, built by Joaquin Studios (Leizer on Civitai), MIT licensed, with essentially no community footprint behind it. Zero search impressions on comfy.icu, nothing on the usual subreddits. Don't read that as a warning; read it as "this is a guy's personal workflow he open-sourced," which is exactly the vibe the code has. No model downloads, no GPU cost, nothing that can break a working ComfyUI install.

    How it works

    The node takes your prompt text, feeds it through a seeded random.Random(seed), and resolves three layers of syntax in order:

    • __folder/key__ tags pull a random line from a .txt or nested .yaml file.
    • {a|b|c} picks a random option; {33%a|b} makes it weighted (and {33%a|} leaves a 67% chance of an empty string - great for "sometimes add X").
    • Jinja2 templates run first and can do the real work: {% if "rear" in cam %}, holiday flags like is_halloween and is_christmas, and a wildcard("key") function for nested lookups.

    The part worth switching packs for: the positive prompt resolves first and sets Jinja2 variables, then the negative prompt resolves in the same Jinja2 environment. So you can write {% set is_clothed = true %} in the positive and have the negative emit visible_nipples, exposed_breasts only when it isn't. Your negative becomes conditional instead of a static block of tags that fights the positive. That's genuinely unusual.

    Inputs and outputs

    Only three inputs, all required:

    • prompt - your template with wildcard tags, weighted choices and/or Jinja2.
    • negative_prompt - same syntax, shares variable scope with the positive.
    • seed - connect this to your KSampler seed. Leave it at 0 and every run gives you the same roll; that's the trap that makes people think the node is broken.

    Outputs are resolved_prompt and resolved_negative, both plain strings. Wire resolved_prompt into the positive CLIPTextEncode and resolved_negative into the negative one. The node re-executes on every queue, so each run rolls fresh unless you hold the seed.

    Installing

    ComfyUI Manager β†’ Install via Git URL β†’ paste https://github.com/cyanideoverdose/JStudio_Wildcards, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/cyanideoverdose/JStudio_Wildcards
    pip install jinja2 pyyaml   # usually already present in ComfyUI's python env
    

    Then create a wildcards folder at your ComfyUI root. The node finds it by walking up from its own install location looking for a sibling custom_nodes + wildcards, so ComfyUI/wildcards/characters/my_cast.yaml just works. A πŸ”„ Refresh Wildcards button on the node clears the file cache - which you need, because files are cached until you click it.

    Troubleshooting

    • Literal __something__ in your resolved text - the folder wasn't found. Check the startup console for [JStudio Wildcards] WARNING: Could not find wildcards folder.
    • [Jinja2 error: ...] printed in the output - a template bug, and the node helpfully dumps the error right where you'll see it.
    • Same image every queue - your seed isn't tied to the KSampler.
    • One honest gotcha: the README advertises a separate reload node, a wildcards_folder input and a character_name output, but none of those are in the shipped code - the real node is exactly the three inputs and two outputs above. READMEs rot; check the node before you go looking for widgets that don't exist.
    CategoryJoaquin Studios

    Inputs (3)

    NameTypeDefaultDescription
    promptSTRING__lucky_ladies/random__β€”
    negative_promptSTRING__negatives/global__β€”
    seedINT00–18446744073709550000β€”

    Outputs (2)

    NameTypeDescription
    resolved_promptSTRINGβ€”
    resolved_negativeSTRINGβ€”