Nodes/Wildcard Pipeline/WP Prompt Assembler
ComfyUI Node

WP Prompt Assembler

Where Your Wildcard Variables Finally Become a Prompt

By DumiFlex·Created 5 months ago·Updated 19 days ago· 9
WP Prompt Assembler
  • context
  • prompt
template

WP Prompt Assembler is the moment your wildcard pipeline stops being machinery and becomes text. Everything upstream - WP Context, the injector, the loop - produces $variables. This node is where you write the actual prompt template that consumes them, and its single output is a plain STRING you hand to CLIP Text Encode like any other prompt. If you can only remember one thing about it: type free text, drop $var names where values should go, wire it after a context.

How it works

Two required inputs, that's it. context is a PIPELINE_CONTEXT from any upstream WP Context / Loop / Injector chain - no context, no resolution, so it'll refuse to do anything useful if you leave it dangling. template is a multiline string. You write A $style portrait of $subject and the node substitutes the picked values. Missing variables don't crash it - the resolver emits a warning (which WP Debug will show you) and leaves the $var literal in the text so you can spot the typo.

The tooltip contains a subtle warning that's easy to miss and worth flagging: inline {a|b|c} picks render verbatim here. The {a|b|c} dynamic-prompt syntax is a ComfyUI habit from Impact Pack, but in this node it is not a source of randomness - it's literal text. If you want a roll, it has to happen in a seeded module upstream; the assembler only renders. That's a deliberate design call: randomness lives in the context where it can be seeded, tracked, and debugged, not scattered through template text. It's also the most common "why is my prompt full of braces" complaint on a new workflow.

One subtlety the source makes explicit: variables flagged as internal (a "hide from prompt" flag in the manager) never substitute here - the node strips them before resolution, so a variable used purely for mid-pipeline logic doesn't leak into your final prompt. And the placeholder shown in an empty template - A $style portrait of $subject - is just a hint; the workflow JSON stores no template by default, so a freshly dropped node starts blank rather than pre-filling prose you'd have to delete.

Wiring it up

The canonical chain from the README: WP ContextWP Prompt AssemblerCLIP Text EncodeKSampler. Inside the template you can use loop variables too - pair it with WP Context Loop and frame $iteration of $iteration_total labels each render. Output is a STRING, so anything that accepts prompt text works downstream: a clean prompt conditioner, a weighted prompt encoder, or even a text node for logging.

Install and gotchas

ComfyUI Manager → search Wildcard Pipeline → install, or manual:

cd ComfyUI/custom_nodes
git clone https://github.com/DumiFlex/ComfyUI-Wildcard-Pipeline
cd ComfyUI-Wildcard-Pipeline
pip install -e .
pnpm install && pnpm run build

Same pack-wide notes: needs ComfyUI ≥ 0.3.36 (V3 node schema), no model downloads, GPL-3.0.

Where people get burned: forgetting that this node is downstream of the randomness, not a source of it. If you're assembling a template with {red|blue|green} hoping for variety, stop - create a wildcard module in the manager, name it $color, and type a $color sky. And if a $var comes through as literal text, you either misspelled it or the upstream context genuinely doesn't have it - WP Debug's warnings tab will name the offender, so wire one in before you tear the graph apart.

Categorywildcard-pipeline

Inputs (2)

NameTypeDefaultDescription
contextPIPELINE_CONTEXTThe resolved $variable context from any upstream WP Context / Loop / Injector chain. Required — without it the template can't resolve any $vars.
templateSTRINGYour prompt template. Type free text and insert $variable names where the upstream Context's values should appear. Inline {a|b|c} picks render verbatim here — produce randomness in a seeded module instead.

Outputs (1)

NameTypeDescription
promptSTRING