Join Strings
Stitch prompt parts together without a text editor
- string
Most ComfyUI prompts live in one CLIP Text Encode box, typed once, left alone. But the moment you want to assemble a prompt from parts - a subject here, a style chunk there, quality tags you toggle on and off - you need something to glue those parts back into a single string. That's this node. Five strings in, one string out, with a separator you control between each. It's one of those nodes you don't realize you want until you've rebuilt the same prompt by hand for the third time.
Why it exists
This is plumbing, pure logic - no GPU, no model, no downloads. ComfyUI core gives you primitive value nodes but is oddly thin on multi-way string concatenation, so small packs like this fill the gap. The author's README is disarmingly honest about the motive: "mostly random nodes of random usefulness... so I don't need 249 different node packs installed for a one-off function." That's the whole pitch, and for a string join it's a fair one.
How it works
Under the hood it's dead simple. The node collects your five strings, and then:
- With strip on (the default), each string gets whitespace stripped and any empty inputs dropped entirely.
- With strip off, only trailing empty slots are removed, so exact spacing is preserved.
- Then it joins what's left with the separator.
The fun bit is sep_escaped (also on by default). It runs the separator through Python's unicode_escape decoder, so the literal \n in the separator box becomes a real newline between your chunks, and \t becomes a tab. The default separator is "\n", which is why the node produces a nice multiline block the moment you drop it in.
The inputs that matter
- string_1 through string_5 - the chunks. Each is a single-line box (not multiline), so think short tags and phrases, not paragraphs. Leave unused ones blank; with strip on they vanish.
- separator - default
\n. Set it to", "and you've got a comma-joined tag list. Because of sep_escaped, you can type\\nand get a newline even where you can't press Enter. - strip - leave it on unless you specifically need to preserve spacing. The "drop empty inputs" half of it is what lets you leave slots blank and not end up with stray separators.
- sep_escaped - keep it on. Turn it off and your
\nbecomes the literal two characters backslash-n, which is the #1 way people get confused here.
The output is a single string socket, and that's the whole deal: wire it into a CLIP Text Encode's text input (right-click the text widget and "Convert to input" first), into a Save Image filename text field, or into any other node that accepts a STRING. It also pairs naturally with the rest of this pack - the model-list nodes output newline-joined filenames, and a join node is exactly the tool that turns those into a tag block.
Installing it
Install the whole pack, since both string nodes ship together:
cd ComfyUI/custom_nodes
git clone https://github.com/without-ordinary/wo_nodes
Then restart ComfyUI. If you use ComfyUI Manager, just search for WO Nodes (the pack's display name) or wo_nodes and install from there. There are no Python dependencies to fight over - the pack's own pyproject.toml lists an empty dependencies = [], so nothing extra gets pip-installed into your environment. That's rare in the custom-node world and worth appreciating.
Where people get burned
- The literal
\n. If you turn sep_escaped off but leave the separator as\n, you'll get the two-character sequence between every chunk. Keep sep_escaped on. - Five inputs is a hard ceiling. Need eight chunks? Chain two join nodes - output of the first feeds a string input of the second. Ugly, but it works.
- The inputs are strict STRINGs. Want to insert a number, like a step count or a seed? ComfyUI won't coerce an INT into these boxes - stringify it first.
- One heads-up so you don't think you broke something: the separator's tooltip says "Seperator," with a typo. That's the author's spelling, not a setting you've mangled.
It won't change your images by itself. But for assembling prompts from toggleable parts, or feeding structured text into a filename or a tag block, it's the quiet little node that makes the rest of the graph readable.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| string_1 | STRING | — | |
| string_2 | STRING | — | |
| string_3 | STRING | — | |
| string_4 | STRING | — | |
| string_5 | STRING | — | |
| separator | STRING | \n | Seperator between strings. If enabled, supports escape characters like: \t and \n |
| strip | BOOLEAN | true | Remove leading and trailing whitespace, and empty imputs. |
| sep_escaped | BOOLEAN | true | Enables support for escape characters in seperator field. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| string | STRING | — |