π² Moon Simple Wildcards
The seed-deterministic wildcard node that won't make you rebuild your prompt
- text
The default prompt is a dead giveaway: A [color] shirt, [clothes], in a [background]. Type [color], and the node rolls a random pick from its color list - neon cyan, deep crimson, whatever - and drops it into your prompt. The trick that makes this worth having over just editing text by hand is that the pick is driven by the seed input, so the same seed always resolves to the same combination. You can rerun a seed to reproduce an exact look, or bump the seed to roll the dice again while everything else in your workflow stays put.
How it works
The node recognizes [wildcard] or __wildcard__ tokens in the text box. On first run it copies a starter set of .txt files (art_style, background, camera, clothes, color, expression, lighting, pose, weather) from wildcards/.example/ into the pack's wildcards/ directory, then scans that folder - including subfolders, so [folder/name] works. Each non-hidden .txt file becomes a wildcard key, each non-empty line an option. Lines starting with # are treated as comments, which is handy for labelling.
Resolution uses Python's random.Random(seed), which is why it's deterministic. Nested wildcards work - if a chosen line contains another [token], it gets resolved too, up to five passes deep. The result comes out the text output as a plain STRING, ready to wire into a CLIP Text Encode or your positive prompt.
The inputs that matter
Just two, which is the point of the node:
text- your prompt with[wildcard]tokens in it. The field has dynamic prompts disabled, so ComfyUI's built-in{}dynamic syntax won't fight the node's own substitution.seed- controls every pick. Same seed, same resolved prompt. Keep it linked to your sampler seed if you want a fully reproducible run, or leave it fixed while you shuffle other things.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/m0rtus59/ComfyUI-MoonNodes.git
cd ComfyUI-MoonNodes
pip install -r requirements.txt
Restart ComfyUI, or search "ComfyUI-MoonNodes" in ComfyUI Manager. Yes, that pip install line matters even for this node: the pack's only pinned dependency is google-genai, imported at load time by the Gemini nodes, and if it's missing the entire pack fails to load.
Gotchas
The token pattern only matches [A-Za-z0-9_-/], so a wildcard file with spaces or odd characters in its name won't resolve - keep names to letters, numbers, underscores and hyphens. Keys are matched case-insensitively. And there's a subtle one: unknown tokens are left in place rather than erroring, so a typo like [colour] when the file is color.txt silently passes through and pollutes your prompt instead of telling you something's wrong. Watch for stray brackets in your output.
If a token doesn't resolve at all, that's usually the wildcards/ directory not being where you expect - check it's the pack's own folder and that your file is .txt (not hidden, not inside a dot-folder like .example, which gets skipped).
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | A [color] shirt, [clothes], in a [background] | β |
| seed | INT | 00β18446744073709550000 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | β |