WP Context Injector
Push Any ComfyUI Output Into Your Wildcard Context
- wp_rows
- upstream
- context
Here's the gap WP Context Injector fills: your wildcard chain lives in a PIPELINE_CONTEXT, but the rest of ComfyUI doesn't know that type exists. A wildcard picks a resolution, an aspect-ratio node computes a width, an LLM node returns a string - and none of those outputs can just walk into a $variable. This node is the bridge. It lifts any ComfyUI output - a multiline String, an INT, a FLOAT, whatever - into a named $variable your prompt assembler can reference.
How it works
The node's whole surface is a wp_rows socketless widget plus an optional upstream input. Each row has a binding name and a source socket: you type the variable name (width, say) and wire an upstream node's output into that row's input socket. The node manages those input_* sockets dynamically on the frontend - add a row, a socket appears; wire it, and the value lands in the context.
At execution, the rule is simple and worth internalizing: for each enabled row with a non-empty binding AND a live wire, the node writes ctx[binding] = stringify(value). If a row's socket isn't wired, it's skipped - it doesn't error and it doesn't write garbage. That makes the injector the natural place to park values that are conditional on what got wired this run.
Each row also has a template field that can reference other wired sockets with $slot_name, and $$ escapes to a literal $. So a row can say a $width x $height canvas and fold several inputs into one binding. Unwired slots stay literal in the output so you can spot the typo instead of debugging invisible empties.
Like WP Context, it accepts an upstream context: variables pass through and the injector's rows write fresh bindings on top. Leave it unconnected and you're starting a new chain from scratch - useful if you want a context that's only external values, no random modules at all. The single output is context (PIPELINE_CONTEXT), which feeds the same downstream nodes as any other context.
When you'd reach for it
The classic case: a wildcard picks a resolution label ("small", "medium", "big"), a derivation maps it to a number, but the actual width needs to drive an Empty Latent Image. That's two hops and the injector isn't needed - you'd use WP Var → Int. The injector shines the other way: when a non-wildcard node (a controlnet preprocessor, a token counter, an external script output) produces a value you want available inside your template as a $var, or when you want a context that combines random picks with fixed live-computed values. It's also the cleanest way to build a context from a completely external data source - wire an LLM node's string output into a row and your template gets it as $story, no library required.
Install and gotchas
Install the pack once - ComfyUI Manager → search Wildcard Pipeline, or the git clone + pip install -e . + pnpm build route in the README. Same note as every node in this pack: it needs ComfyUI ≥ 0.3.36 because it uses the V3 io schema, and there are no model downloads or extra Python deps.
The gotcha that trips people: the rows want live wires. A row that looks configured but has nothing connected silently does nothing, and since it doesn't error you'll stare at an empty $var in the rendered prompt. If a variable comes out missing, check the injector first - enabled row, non-empty binding, and a wire actually attached. WP Debug's warnings tab is your friend for exactly this.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| wp_rows | WP_INJECTOR_ROWS | — | |
| upstreamopt | PIPELINE_CONTEXT | Optional upstream Context to extend. Variables pass through; this node's rows write fresh bindings on top. Leave unconnected to start a new chain. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| context | PIPELINE_CONTEXT | — |