π² JStudio Wildcards
Seeded if/then logic in a prompt node
- resolved_prompt
- resolved_negative
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.txtor nested.yamlfile.{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 likeis_halloweenandis_christmas, and awildcard("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_folderinput and acharacter_nameoutput, 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.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | __lucky_ladies/random__ | β |
| negative_prompt | STRING | __negatives/global__ | β |
| seed | INT | 00β18446744073709550000 | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| resolved_prompt | STRING | β |
| resolved_negative | STRING | β |