Nodes/LLM Wildcard Manager/🎲 LLM Wildcard Resolver
ComfyUI Node

🎲 LLM Wildcard Resolver

Filling your wildcard slots one at a time so they never repeat

By pclshmΒ·Created 5 months agoΒ·Updated 4 months agoΒ· 1
🎲 LLM Wildcard Resolver
  • server
  • prompts
  • resolved_prompt
  • report
  • negative_prompt
β—„templateDigital illustration of a __age__ __ethnicity__ woman with __hair__, __activity__ at a __location__, __time__, wearing __outfit__, __pose__, __style__, masterpiece, best quality, ultra-detailedβ–Ί
β—„modehybridβ–Ί
β—„max_per_category200β–Ί
β—„min_pool_size5β–Ί
β—„values_per_call10β–Ί
β—„seed0β–Ί
β—„fix_seedfalseβ–Ί
β—„trigger_wordsβ–Ί
β—„trigger_positionprefixβ–Ί
β—„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_existing always picks from disk, generating only if the file is empty. force_new regenerates every slot every run.
  • min_pool_size (default 5) - 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 (default 200) - the soft cap. Once a file hits this many entries the Resolver stops appending and starts reusing.
  • values_per_call (default 10) - 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's prompt_template, or type your own. The default is a complete working portrait template if you want to test standalone.
  • prompts (optional) - the WILDCARD_PROMPTS bundle 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, prefix or suffix. Spliced after the grammar pass, so trigger tokens stay verbatim.
  • seed / fix_seed - fix_seed OFF (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" when phone is 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 the prompts bundle 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.

Categoryprompt/wildcards

Inputs (12)

NameTypeDefaultDescription
serverLLM_SERVERβ€”
templateSTRINGDigital illustration of a __age__ __ethnicity__ woman with __hair__, __activity__ at a __location__, __time__, wearing __outfit__, __pose__, __style__, masterpiece, best quality, ultra-detailedβ€”
modeCOMBOhybrid3 options: reuse_existing, force_new, hybrid
max_per_categoryINT2001–10000β€”
min_pool_sizeINT51–1000β€”
values_per_callINT101–50β€”
seedINT00–18446744073709550000β€”
fix_seedBOOLEANfalseβ€”
trigger_wordsSTRINGβ€”
trigger_positionCOMBOprefix2 options: prefix, suffix
negative_promptSTRINGResolver-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.
promptsoptWILDCARD_PROMPTSβ€”

Outputs (3)

NameTypeDescription
resolved_promptSTRINGβ€”
reportSTRINGβ€”
negative_promptSTRINGβ€”