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

🎲 LLM Wildcard Manager

Get prompt variety that isn't a re-skin of the same sentence

By pclshmΒ·Created 5 months agoΒ·Updated 4 months agoΒ· 1
🎲 LLM Wildcard Manager
  • server
  • structure
  • prompt_template
  • prompts
  • negative_prompt
β—„example_promptA portrait of a woman doing an outdoor activity, photorealistic, masterpiece.β–Ί
β—„lock_templatefalseβ–Ί
β—„seed0β–Ί
β—„directionnoneβ–Ί
β—„production_tiernoneβ–Ί
β—„moodnoneβ–Ί
β—„anchorsβ–Ί
β—„negative_promptβ–Ί
β—„forbidden_placeholdersβ–Ί
β—„min_categories3β–Ί
β—„max_categories8β–Ί
β—„system_prompt_overrideβ–Ί
β—„categories{}β–Ί
β—„design_brief{}β–Ί
β—„lock_brieftrueβ–Ί

Ask an LLM to "enhance this prompt" and it anchors on the whole thing - run it twice and you get two near-identical sentences dressed up as different prompts. LLM Wildcard Manager attacks the problem from the other end. It turns your rough idea into a template: a sentence with __wildcard__ placeholders (__hair__, __location__, __pose__…) plus a description of each slot. Then the pack's Resolver fills each slot independently, so the downstream prompt has genuine variance instead of being a re-skin.

It's the local-LLM prompt-enhancement pattern (llm-in-comfyui.md) with the "generative" part moved out of the single rewrite step. The Manager writes the shape; the Resolver writes the values. Most prompt-enhancer nodes conflate those two jobs, which is exactly why their output repeats itself.

How it works

The Manager runs a multi-step pipeline on each queue. First it turns your idea into a "design brief" (refined idea, fixed traits, banned axes), then a "wildcardify" step invents the placeholders and their descriptions, and it enforces your guardrails along the way:

  • negative_prompt - what the LLM must avoid, applied at every level: the drafted sentence won't include it, the aspect won't become a wildcard (so "no old people" stops __age__ from being created when your idea says "young woman"), and each placeholder description gets an explicit exclusion clause so the Resolver can't drift into it either.
  • forbidden_placeholders - a hard deny-list. Any placeholder name here is stripped from the template and demoted to concrete words even if the LLM ignored you. This is the backstop when the negative prompt alone isn't enough.
  • anchors - the opposite: phrases that must survive verbatim. Each anchor is force-added to fixed traits, so the Manager can't wildcardify it or paraphrase it away. Pin your non-negotiables here.
  • min_categories / max_categories - the floor and cap on how many placeholders the template may contain. The floor is enforced by retrying the wildcardify step ("you produced X, need at least N"); the cap by demoting surplus placeholders to plain words deterministically. Lower max = more focused prompts.

The inputs you'll actually touch

  • server - wire from 🎲 LLM Server Config.
  • example_prompt - your idea. This is the one thing you rewrite every time you want a different scene.
  • direction - steering for the template's feel. Pick a preset like cinematic, noir, editorial, sfw_strict, or type your own text.
  • seed - 0 re-rolls the template and category set every queue; a non-zero seed makes the same inputs produce the same template, reproducibly.
  • lock_template - the workflow trick worth knowing. Turn it ON and the Manager skips the LLM entirely, reusing the last template and categories. Re-queue and you get fresh random wildcard fills from the Resolver without changing the prompt. Combined with the Resolver's fix_seed off, that's your "same prompt, new images every run" setup.
  • structure (optional) - wire a 🎲 LLM Wildcard Template Builder here and you dictate the shape (a sentence, then 3 character wildcards, an action sentence…) instead of letting the LLM invent it. min_categories/max_categories stop applying; the counts come from your sliders.

Outputs

  • prompt_template - the template string. Wire into the Resolver's template input.
  • prompts - a WILDCARD_PROMPTS bundle carrying the system prompt, flair, and merged category descriptions. Wire into the Resolver's optional prompts socket.
  • negative_prompt - a deterministic comma-separated deny-list, not LLM-rewritten. This is the useful design choice: wire it straight into your CLIP Text Encode (negative) and the image model sees the same forbidden list every run, no matter how the positive side re-rolls.

On the node itself you get a Generated prompt panel showing the template with wildcards highlighted, a categories table (expand any row to see the LLM's description, entry counts, and your overrides), and a ↻ Refresh disk button that re-reads the ComfyUI/wildcards/ folder without re-queuing.

Installing

ComfyUI Manager β†’ search LLM Wildcard Manager β†’ install, or clone https://github.com/pclshm/comfyui-llm-wildcard-manager into ComfyUI/custom_nodes and restart. No Python deps, no model downloads - the pack speaks HTTP to your Ollama/llama.cpp/OpenAI-compatible server via stdlib urllib. Starter workflow: example_workflows/llm_wildcard_basic.json.

Where people get burned: the Manager needs the LLM server running, so a dead Ollama shows up as an error on this node before anything else. And remember the 0.3 upgrade replaced the old LLMWildcardPromptConfig node with this Manager + Server Config split - old workflows need re-wiring.

Categoryprompt/wildcards

Inputs (17)

NameTypeDefaultDescription
serverLLM_SERVERβ€”
example_promptSTRINGA portrait of a woman doing an outdoor activity, photorealistic, masterpiece.β€”
lock_templateBOOLEANfalseWhen ON, skip the LLM and reuse the last generated prompt template + categories. Re-queue to get fresh random wildcards from the Resolver without changing the prompt.
seedINT00–18446744073709550000β€”
directionSTRINGnoneβ€”
production_tierSTRINGnoneWhat KIND of making this is. Orthogonal to direction β€” 'homemade' steers per-slot values toward amateur/phone-snapshot equivalents (casual outfit, ambient light, plain pose) without touching the aesthetic style.
moodSTRINGnoneEmotional tone of the scene. Biases pose, expression, activity and time-of-day choices without dictating the visual style.
anchorsSTRINGUser-pinned phrases. Each anchor is force-added to fixed_traits so the LLM cannot wildcardify it or paraphrase it away. Use this when the idea names something specific (a setting, a garment) and you don't want the resolver to re-roll it.
negative_promptSTRINGWhat the LLM must avoid. Pinning an aspect here (e.g. 'no old/middle-aged people' when the idea is 'young woman') prevents the Manager from creating a wildcard for that aspect AND keeps the resolver's per-slot values from contradicting it.
forbidden_placeholdersSTRINGHard deny-list. Any placeholder name listed here is stripped from the generated template and demoted to concrete words, even if the LLM ignored the instruction. Use this as a backstop when the negative prompt isn't enough.
min_categoriesINT31–30Minimum number of __wildcard__ placeholders the Manager will accept. Enforced by retrying the wildcardify step if the LLM falls short. Higher = more variation.
max_categoriesINT81–30Maximum number of __wildcard__ placeholders in the generated template. Lower = more focused prompts.
system_prompt_overrideSTRINGβ€”
categoriesSTRING{}β€”
design_briefSTRING{}β€”
lock_briefBOOLEANtrueWhen ON, reuse the design brief on the node and skip the LLM brief call. When OFF, regenerate the brief from the LLM every queue (edits are overwritten).
structureoptWILDCARD_STRUCTUREβ€”

Outputs (3)

NameTypeDescription
prompt_templateSTRINGβ€”
promptsWILDCARD_PROMPTSβ€”
negative_promptSTRINGβ€”