Text Multiline with Variables
Fill !var_1 placeholders from other nodes — a tiny prompt mail-merge
- STRING
Text Multiline with Variables is the boring node that saves you from an enormous amount of copy-paste. You write a prompt skeleton with placeholders like !var_1 and !var_2, then fill those placeholders from the node's inputs. Think mail-merge for prompts: one template, swappable parts.
Why you'd reach for it
The natural partner for this is the same pack's Random Text From Multiline. Set your template to something like the default - picture of !var_1 in the style of !var_2 - wire the random subject picker into var_1, wire an artist or style string into var_2, and now every generation rolls a new subject inside the same fixed frame. You get consistent structure with randomized content, which is exactly the setup for farming one style across many subjects.
How it works
How it works is about as simple as it gets: the node does a literal string replace of each !var_x placeholder with the matching input value. There's no templating engine, no nesting, no functions - if !var_1 appears in your text, it becomes whatever var_1 holds. The vars are marked forceInput, which just means they show up as input sockets you can wire from other nodes instead of only being typed by hand.
The fields
The fields:
- text - the template with
!var_1through!var_5inline. - var_1 … var_5 - optional string inputs. Leave an unused one empty and its placeholder is simply removed from the output.
One output, a STRING, goes wherever your prompt does - a CLIP Text Encode for the positive prompt, or a Show Text node to preview before you commit.
What trips people up
Two things trip people up. The placeholders are exactly !var_1 - underscore, matching the input name - not !var1 or !var_a. And the replacement is case-sensitive and literal: !VAR_1 in your template won't match !var_1. That's essentially the whole failure surface of the node, which is honestly refreshing.
Installing
Install: ComfyUI Manager, search "unwdef", or:
cd ComfyUI/custom_nodes
git clone https://github.com/unwdef/unwdef-nodes-comfyui.git
Restart and it's there. No dependencies, no models to fetch - just a text node that does exactly what it says. Given how much hand-rolling ComfyUI's text handling normally involves, "exactly what it says" is worth a lot.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | picture of !var_1 in the style of !var_2 | — |
| var_1opt | STRING | — | |
| var_2opt | STRING | — | |
| var_3opt | STRING | — | |
| var_4opt | STRING | — | |
| var_5opt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |