String Constant Multiline
A text box you wire like any other node
- STRING
There's no trick here, and that's the point: String Constant Multiline is a multi-line text box that outputs a STRING. You type into it once and wire that output anywhere a string is expected, instead of retyping the same block of text into six different node widgets across your graph.
Why this earns a place in your graph
It sounds too simple to need a node, until you're maintaining a workflow with the same character description, the same negative-prompt boilerplate, or the same JSON config string used in three or four places. Change it once here, and every downstream node that reads from this output picks up the change automatically - no hunting through the graph to update copies you forgot about. It's the "define once, use everywhere" pattern applied to plain text, and it's a small habit that pays off the moment a workflow grows past a handful of nodes.
It's also just a clean way to hold a long block of text - system prompts, multi-line JSON, notes-to-self embedded in the workflow - somewhere purpose-built, rather than cramming it into a widget on a node that wasn't really designed to hold paragraphs.
The inputs and outputs that matter
string(STRING, multiline, default empty) - the text box itself. Type or paste whatever you want.strip_newlines(BOOLEAN, default true) - collapses your multi-line text down before it's output. Turn this off if the newlines themselves matter downstream (multi-line prompts some models parse specially, or literal formatting you want preserved); leave it on when you're feeding something that chokes on raw\ncharacters - filenames, single-line API fields, anything that expects one continuous line.STRINGout - wire it into any node with a string input: prompt fields, filename builders, another custom node's text widget, wherever.
For the single-line version of this same idea, there's a sibling node, String Constant, without the multiline box or the newline-stripping option.
Installing it
Ships with the pack:
- ComfyUI Manager - search KJNodes for ComfyUI, install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, thenpip install -r ComfyUI-KJNodes/requirements.txt, restart.
Zero dependencies of note - this is about as lightweight as a custom node gets.
Common issues & troubleshooting
Downstream node errors on the text, or truncates it oddly. Check strip_newlines. Some nodes genuinely don't handle embedded newline characters well (filename generators are the usual suspect) - flipping this on fixes it in one click instead of manually editing your text to remove line breaks.
I typed something with newlines and they vanished in the output. That's strip_newlines doing its job - it's on by default. Turn it off if you need the line breaks preserved exactly as typed.
Wondering why this needs to be a node at all instead of a widget on the consuming node. Because reuse is the entire feature. If you only ever need the text in one place, sure, a plain widget on the target node is simpler. The moment you need the same text in two or more places, this node is what keeps them in sync - that's the whole reason it exists.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| string | STRING | — | |
| strip_newlines | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |