π² LLM Wildcard Resolver
Filling your wildcard slots one at a time so they never repeat
- server
- prompts
- resolved_prompt
- report
- negative_prompt
This is the workhorse of the LLM Wildcard Manager pack, the node that actually does the thing the pack is named after. The Manager designs the template; the LLM Wildcard Resolver fills it in - and it's the filling-in that's clever. Instead of asking the LLM to complete the whole prompt at once (which is how you get two near-identical rerolls), it resolves each __wildcard__ slot in isolation: the LLM sees only the category name, its description, and a forbidden list of everything already on disk for that category. No anchor, no context, no way to copy the sentence next to it.
The results land in reusable files under ComfyUI/wildcards/<name>.txt, one value per line - the same format the Impact Pack and Santodan Wildcard Manager use, so your existing wildcard collections just work. The Resolver even creates files automatically as it generates values. Your prompt library grows with every run instead of being thrown away.
How it works
Each category has an on-disk pool. On a run, the Resolver decides per slot whether to generate or reuse:
mode-hybrid(default) reuses existing values, generating only for__!name__slots (the!prefix forces fresh generation and appends it to the file).reuse_existingalways picks from disk, generating only if the file is empty.force_newregenerates every slot every run.min_pool_size(default5) - the pool floor. If a category's file has fewer entries than this when the Resolver runs, it tops the pool up with fresh values before picking. Bump this to 20β50 when outputs feel same-y across runs; a wider pool is more combinatorial variety.max_per_category(default200) - the soft cap. Once a file hits this many entries the Resolver stops appending and starts reusing.values_per_call(default10) - how many values it requests per LLM call when topping up. Higher = fewer calls to seed the pool.
Anti-repetition isn't just "don't pick the same line twice." The system prompt asks the model to identify the implicit dimensions of a category (hair = color Γ length Γ texture Γ style) and produce values that combine across dimensions. If the model returns a duplicate anyway, the Resolver retries once at a higher temperature.
Inputs that matter
server- from π² LLM Server Config.template- from the Manager'sprompt_template, or type your own. The default is a complete working portrait template if you want to test standalone.prompts(optional) - theWILDCARD_PROMPTSbundle from the Manager, carrying the system prompt, flair, and category descriptions. Wire it and the per-slot descriptions come from the Manager; skip it and the Resolver runs with built-in defaults.negative_prompt- resolver-stage deny-list. Merges with the Manager's when a bundle is wired; acts as the sole source standalone. It filters the on-disk pool and drives generation retries.trigger_words/trigger_position- splice LoRA trigger tokens (or any fixed text) onto the final prompt,prefixorsuffix. Spliced after the grammar pass, so trigger tokens stay verbatim.seed/fix_seed-fix_seedOFF (default) re-rolls the fills every queue regardless of seed. ON makes it fully deterministic: same template + same seed = same values.
Outputs
resolved_prompt- the completed prompt. Wire into your CLIP Text Encode positive input. If any comma-separated clause still contains a forbidden term after substitution, it's stripped - "girl, holding a phone, on a bench" becomes "girl, on a bench" whenphoneis on the deny-list.report- a text report of what happened per slot. Wire into π² LLM Wildcard Report.negative_prompt- the same deterministic deny-list the Manager produced (rebuilt from thepromptsbundle if the Manager isn't wired). Wire into CLIP Text Encode (negative).
Installing & running
Same as the pack: ComfyUI Manager β search LLM Wildcard Manager, or git clone https://github.com/pclshm/comfyui-llm-wildcard-manager into custom_nodes, restart. No Python deps, no model downloads - just a running LLM backend (Ollama on localhost:11434 is the fastest start) and the Server Config node pointing at it.
The trap most people hit: leave min_pool_size low and a small pool gets reused until it feels repetitive. That's not the node being broken, it's the pool being thin - seed it with 20β50 values per category (or just run force_new once) and the same-y feeling disappears. And if you want "same prompt, new images every run," lock the template on the Manager, leave fix_seed off here, and let the Resolver do the rolling.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| server | LLM_SERVER | β | |
| template | STRING | Digital illustration of a __age__ __ethnicity__ woman with __hair__, __activity__ at a __location__, __time__, wearing __outfit__, __pose__, __style__, masterpiece, best quality, ultra-detailed | β |
| mode | COMBO | hybrid | 3 options: reuse_existing, force_new, hybrid |
| max_per_category | INT | 2001β10000 | β |
| min_pool_size | INT | 51β1000 | β |
| values_per_call | INT | 101β50 | β |
| seed | INT | 00β18446744073709550000 | β |
| fix_seed | BOOLEAN | false | β |
| trigger_words | STRING | β | |
| trigger_position | COMBO | prefix | 2 options: prefix, suffix |
| negative_prompt | STRING | Resolver-stage deny-list. Merges with the Manager's negative_prompt when a bundle is wired; acts as the sole source when the Resolver is used standalone. Terms here filter the on-disk pool, drive value-generation retries, and are re-emitted on the negative_prompt output. | |
| promptsopt | WILDCARD_PROMPTS | β |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| resolved_prompt | STRING | β |
| report | STRING | β |
| negative_prompt | STRING | β |