Wildcards

Template

Define each wildcard as `name:` then one option per line. Use __name__ in the template; {a|b|c} picks one at random.

Sample prompts

The __wildcard__ syntax used by the sd-dynamic-prompts extension and A1111 swaps part of a prompt for a random pick from a list. Drop a token like __color__ or __pose__ into your template and it expands to a different word each generation. That's powerful, but until you actually render images and read the logs it's hard to know what a template really expands to every run — or whether a typo is pointing at a wildcard you never defined. This tool runs just that expansion in your browser ahead of time and previews a list of sample prompts. In the 'Wildcards' box, write a header line like `color:` and list one option per line below it (define as many wildcards as you like, stacked one after another). In 'Template', write a prompt containing tokens like __color__ and inline choices like {soft|harsh}; the right side fills with the requested number of randomly expanded samples. __name__ picks one option at random from that wildcard; {a|b|c} picks one on the spot — and a wildcard's option may itself contain __another_wildcard__ or {x|y}, which are expanded recursively (nested choices like {a|{b|c}} work too). Fix the seed and the exact same samples reproduce every time, so you can share results or isolate a bug; hit 'Reroll' to jump to a fresh seed and see different draws instantly. When you want every possible combination of {a|b|c} exhaustively, use prompt-matrix instead; this tool is for previewing a handful of random samples close to what a real generation produces. If you reference a wildcard you haven't defined, its token is left in place and its name is listed in a warning, so typos surface immediately. All processing happens on your device — your definitions, template, and generated samples are never uploaded, stored, or sent anywhere.

How to use

  1. In 'Wildcards', write a header line like `color:` and list one option per line below it. Stack as many wildcards as you like (lines starting with `#` are comments).
  2. In 'Template', write a prompt with tokens like __color__ and inline choices like {soft|harsh}.
  3. The right side fills with randomly expanded samples. Set how many with 'Samples' and which seed to reproduce with 'Seed'.
  4. Hit 'Reroll' to see different draws, then 'Copy all' to grab the samples you like.

FAQ

Are my definitions or template uploaded anywhere?

No. Parsing the wildcards and expanding the template both happen inside your browser. Your definitions, template, and generated samples are never uploaded, stored, or sent anywhere — nothing leaves your device.

How do I define wildcards? Can it read my .txt files?

It doesn't read files (the site is serverless by design). Instead, paste your options into the 'Wildcards' box under a `name:` header line, one option per line. You can paste the contents of a color.txt and just add `color:` on top. Stack several wildcards one after another.

How is this different from prompt-matrix?

prompt-matrix expands {a|b|c} exhaustively into every combination. This tool picks one option at random for both __wildcard__ and {a|b|c} and previews a few samples close to a real generation. Use prompt-matrix to cover all combinations; use this to check what each run actually draws.

What is the seed for?

The same seed reproduces the exact same samples every time, so you can share a result or isolate 'this template draws this combination'. Press 'Reroll' to randomize the seed and instantly see a different set of draws.

Do nested wildcards and {a|{b|c}} work?

Yes. A wildcard's option can itself contain __another_wildcard__ or {x|y}, and they're expanded recursively; nested choices like {a|{b|c}} are resolved too. To output the symbols literally, escape them as \{ \} \| \_ with a backslash.

What happens if I reference an undefined wildcard?

It isn't expanded — the __name__ token is left in place and its name appears in an 'Undefined: name' warning below the output, so typos and missing definitions surface right away. Weighted picks like {2$$a|b} and glob/path references are not supported (out of scope).