Multi Input Variable Rewrite
Template strings with {a}–{e} placeholders — no scripting required
- TEXT
You have a prompt that's 80% the same every run, with a few bits you want to swap: "Create {a} image of {b} in {c} style". You could rebuild text nodes by hand for every variation, or wire up a wildcard pack with its own syntax and rules. Multi Input Variable Rewrite is the middle path - a template string with placeholders like {a}, and inputs that fill them in. Write the template once, feed values in, get a finished string out.
It's the lightweight sibling of the old A1111 wildcard idea that most people who arrived post-2024 never learned (our prompt-engineering essay covers that history). Where wildcard systems use a file-based syntax and random selection, this is simpler and more direct: you control the values, and they're wired in as node inputs, which means other nodes can drive them.
How it works
There's no magic. The node takes the template and, for each provided input, does a plain string replace of the placeholder with the value:
for key, value in kwargs.items():
if value:
text = text.replace(f"{{{key}}}", value)
So {a} gets replaced by the value of input a, and so on. Unfilled placeholders are left untouched, and empty inputs are skipped. That's a feature: you can have a template with more placeholders than you're actually using this run.
Inputs and output
text- the template, multiline, with{a}…{e}placeholders.athroughe- optional STRING inputs, one per placeholder. They're forced-input style, so they expect to be wired rather than typed.- Output:
TEXT- the filled-in string, ready to feed a CLIP Text Encode node, a filename template, whatever.
Practical uses: dynamic prompts where a batch or an API changes the subject/style per run, filename templating for an output saver, or composing a prompt from separately-managed components.
The one gotcha
The README advertises "up to 26 optional inputs ({a}…{z})". The shipped code defines a through e only. If you write {f} in your template it will not be replaced - the placeholder just survives to the output. It's the kind of README-vs-code drift that bites quietly, so plan your templates around {a}–{e} and you're fine.
Install
Same as every node in this pack: ComfyUI Manager → search "uber_comfy_nodes" ("Suplex Misc ComfyUI Nodes") → install → restart. Or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/saftle/uber_comfy_nodes
Restart and find it under Uber Comfy. Light dependencies (Pillow, numpy, psutil, pynvml), no model downloads.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| aopt | STRING | — | |
| bopt | STRING | — | |
| copt | STRING | — | |
| dopt | STRING | — | |
| eopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| TEXT | STRING | — |