String Concatenator
Glue for prompt fragments, without the cleanup
- C
Dynamic text in ComfyUI is really just a lot of small strings being shoved together - a subject, a style, a quality tag, a camera angle - and String Concatenator is the shove. It takes up to 15 string inputs, joins them with the separator you pick, and hands back one finished STRING. The trick that makes it actually pleasant to use: empty strings are dropped automatically before joining. So you can leave half the inputs unwired, or feed it a conditional branch that sometimes produces nothing, and you never end up with stray commas or doubled spaces polluting the result.
The separator_type dropdown does the joining, with four choices: EMPTY (nothing between strings), COMMA (a bare ,), SPACE, and PIPE (a bare |). Note that's a plain pipe character, not the padded | the README hints at - check the shipped code and you'll see join("|"). string1 through string5 are required inputs; string6 through string15 are optional and can stay unwired, which is where the empty-string filtering earns its keep. One STRING output comes out the far side, ready to feed a CLIP Text Encode or a save filename.
The natural way to use it is as the assembly step at the end of a logic chain. The pack's example workflow does exactly this: a number (age) gets bucketed by Number Range Index, a String Switch By Number picks the matching text fragment, and this node stitches the pieces into the final prompt. It also shines for building filenames or JSON on the fly - set separator_type to PIPE and concatenate a list of tags into one string.
Two small things to know. Because empties are filtered, you can't use this node to build deliberately empty slots or a,,b-style output - there's no way to keep a placeholder in the middle. And the COMMA separator is a bare comma with no trailing space, so joining "hello" and "world" gives hello,world, not hello, world; if your grammar needs the space, use SPACE and put commas in the strings themselves. Both are "read the actual behavior once" details, not problems.
Install is the pack-standard one-liner:
cd ComfyUI/custom_nodes
git clone https://github.com/narusas/Comfyui-Logic-Support
Restart ComfyUI (or refresh the tab) afterward - or use ComfyUI Manager and search for "ComfyUI Logic Support." The whole pack is pure Python with zero dependencies and no models to fetch, so this won't start a dependency war with the rest of your custom_nodes. MIT-licensed, single-author, small community footprint. It's a quiet little utility that just does the joining.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| separator_type | COMBO | EMPTY | 4 options: EMPTY, COMMA, SPACE, PIPE |
| string1 | STRING | — | |
| string2 | STRING | — | |
| string3 | STRING | — | |
| string4 | STRING | — | |
| string5 | STRING | — | |
| string6opt | STRING | — | |
| string7opt | STRING | — | |
| string8opt | STRING | — | |
| string9opt | STRING | — | |
| string10opt | STRING | — | |
| string11opt | STRING | — | |
| string12opt | STRING | — | |
| string13opt | STRING | — | |
| string14opt | STRING | — | |
| string15opt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| C | STRING | — |