DuoUmiWildcards
Custom ComfyUI node supporting wildcard text processing from files with YAML tags, randomization, latent ratio selection and preset aspect ratios.
DuoUmiWild — ComfyUI Wildcard Node
A ComfyUI custom node for building dynamic prompts from .txt wildcard files and structured .yaml libraries. Supports random line selection, range picks, curly-brace randomization, and YAML tag-based selection with prefix/suffix injection. Includes a second node for aspect-ratio management.
Installation
Method 1 — Git (recommended)
cd ComfyUI/custom_nodes/
git clone https://github.com/UndefinedUo/ComfyUI_DuoUmiWild.git
Method 2 — Manual
Download the ZIP, extract, and place the DuoUmiWild folder inside ComfyUI/custom_nodes/.
Restart ComfyUI. The nodes appear under the DuoUmiWild category.
Quick Start
- Right-click the canvas → Add Node → DuoUmiWild → Wildcard Prompt
- Connect processed_text → your CLIP Text Encode positive input
- In the text field, enter a prompt with wildcards:
masterpiece, best quality, __Prompt/score__, __Prompt/safety__, 1girl, __characters/Series Girls/Vocaloid FEM__, __Art/Artist Names__, <[Pose]> - Hit generate. Change the seed to get different wildcard selections.
Tip: Connect the seed input to your KSampler seed to keep wildcards and image generation in sync. Use a separate seed value to vary wildcards independently.
Syntax Reference
.txt Wildcards — __filename__
Picks one random line from wildcards/filename.txt:
__subject__
__Body/FE-Hair__
__characters/Series Girls/Vocaloid FEM__
Files can be referenced by bare name (node searches all subfolders) or by relative path for precision.
Lines starting with # are treated as comments and skipped. Inline comments after # are also stripped.
Range Selection — __N$$filename__ / __N-M$$filename__
Pick multiple lines from a file:
__2$$colors__ # exactly 2
__1-3$$mood__ # between 1 and 3
__-4$$tags__ # up to 4
__2-$$lighting__ # at least 2
Selected lines are joined with commas.
Curly Brace Randomization — {a|b|c}
Pick one option at random:
{happy|sad|neutral} expression
wearing a {red|blue|green} dress
Pick multiple options with range syntax:
{2$$red|blue|green|yellow} # exactly 2
{1-3$$happy|sad|angry|calm} # 1 to 3
{0-1$$dark skin} # 50% chance
YAML Tag Selection — <[Tag]>
Pick a random YAML entry that matches a tag:
<[Pose]> # any entry tagged "Pose"
<[Upright Pose][Solo]> # entries with BOTH tags (AND)
<[Hat|Crown|Headband]> # entries with ANY tag (OR)
<[Outfit][Fancy|Formal]> # AND + OR combined
See YAML_GUIDE.md for how to build .yaml files.
Combining Syntax
All three syntax types work together and are expanded recursively (up to 20 passes):
masterpiece, __Prompt/score__, 1girl, {a|b|c|d|e|f|g}-size, <[Pose]>, __Art/Artist Names__
Wildcard files can also contain other wildcards — the node will keep expanding until the prompt is fully resolved.
Prompting — Pony / Danbooru-Trained Models
This node is built around models trained on Danbooru-style tags. Follow these conventions for best results.
Tag Order
[quality/meta/year/safety] [1girl/1boy] [character] [series] [artist] [general tags]
Within each section, order is arbitrary.
Quality Tags
Human score tags (no underscores):
masterpiece, best quality, good quality, normal quality, low quality, worst quality
Pony aesthetic score tags (underscores only for these):
score_9, score_8, score_7, score_6, score_5, score_4, score_3, score_2, score_1
Both sets can be used together. Use __Prompt/score__ and __Prompt/quality__ to randomize these.
Year / Period Tags
Steer the model toward artwork from a specific era:
year 2025, newest
year 2022, recent
year 2018, mid
year 2013, early
year 2007, old
Use __Prompt/year_period__ for combined pairs, or __Prompt/year__ / __Prompt/period__ separately.
Safety Tags
safe sensitive nsfw explicit
Use __Prompt/safety__ to randomize, or hardcode the one you want.
Artist Tags
Prefix with @ and use lowercase. The @ is required — the effect is weak without it:
@artgerm @wlop @kantoku @nardack
__Art/Artist Names__ handles this automatically. The node converts any Artist:Name token in the output to @name (lowercase), so existing artist files stay compatible.
Prompt Weighting
Weights work but need higher values than SDXL. Example:
(chibi:2) (detailed background:1.5)
Natural Language
You can mix tags and natural language freely. For natural language, aim for at least 2 sentences and follow standard English capitalization for character and series names:
masterpiece, best quality, @wlop. An anime girl with long silver hair stands at the edge of a cliff at sunset, wearing a white flowing dress.
Full Example
year 2024, newest, masterpiece, best quality, score_8, score_7, safe,
1girl, hatsune miku, vocaloid, @koi_(koitosoitosa),
long hair, twintails, teal hair, detached sleeves, bare shoulders,
smile, looking at viewer, outdoors, cherry blossoms
Wildcard Folder Structure
wildcards/
├── characters/
│ └── Series Girls/ 300+ anime/game series (one file per series)
├── Body/ Hair, eyes, expressions, body type, breast size
│ └── breast_sizes.yaml
├── Clothing and Gear/ Full outfits, individual pieces, themed collections
│ ├── Clothing Mods/
│ ├── Individual Clothing Pieces/
│ └── Themed Outfits/
├── Art/ Artist names and art style keywords
│ ├── Artist Names.txt
│ ├── Art Keywords.txt
│ └── award-photo.yaml
├── Poses-Locations/ Poses, locations, YAML pose libraries
│ ├── GirlPoses.txt
│ ├── Poses.yaml YAML pose library with full tag support
│ ├── sex-poses.yaml
│ ├── Location.txt
│ ├── indoor.txt
│ └── outdoor.txt ...
├── Prompt/ Model quality / prompt meta tags
│ ├── score.txt score_9, score_8, score_7 …
│ ├── quality.txt masterpiece, best quality …
│ ├── safety.txt safe, sensitive, nsfw, explicit
│ ├── year.txt year 2025, year 2024 …
│ ├── period.txt newest, recent, mid, early, old
│ └── year_period.txt combined year + period pairs
├── Meta/ Visual modifiers: camera angle, colors, decorations
├──
└── [root] General: quality.txt, style.txt, subject.txt,
lighting.txt, mood.txt, colors.txt, where.txt …
Reference rules:
- Bare name:
__GirlPoses__— node finds the file anywhere in the tree - Relative path:
__Poses-Locations/GirlPoses__— precise, preferred for ambiguous names - Both
.txtand.yamlfiles are loaded automatically from all subfolders
Node Reference
Wildcard Prompt
| Parameter | Type | Description |
|---|---|---|
| text | STRING (multiline) | Prompt with __wildcards__, <[tags]>, and {options} |
| seed | INT | Seed for reproducible selections |
| autorefresh | Yes / No | Yes: reload files each run (slow, live editing). No: cache (fast, default) |
Output: processed_text — fully expanded prompt string, also shown as copyable text in the node UI.
Latent Ratio Selector
Creates an empty latent tensor at a preset aspect ratio. See RATIO_SELECTOR_GUIDE.md for full documentation.
Troubleshooting
Wildcard not found
- Check the file exists in
wildcards/with a.txtextension - Filenames are case-sensitive on Linux/Mac; match exactly
- Enable autorefresh if you just created the file without restarting
Same output every time
- Change the seed value, or connect to a random seed generator node
Artist names not getting @ prefix
- The node auto-converts
Artist:Nametokens. If you're writing artist names manually, add@yourself:@artgerm
YAML entry not selected
- Verify the tag spelling matches exactly (tags are case-insensitive)
- Check the YAML file is valid — look for ComfyUI console errors on load
Output has double commas / extra spaces
- This is cleaned up automatically. If it persists, check that wildcard lines don't start or end with commas
License
MIT — use and modify freely.
Built on the UmiAI wildcard concept for Stable Diffusion WebUI.