concat
The glue for building strings in ComfyUI
- STRING
Prompts are rarely one blob. They're a subject, a style, a quality tag, a camera word - parts you want to assemble in the graph rather than retype. ComfyUI gives you no built-in way to jam two strings together, so this node is the glue.
What it does
concat does exactly one thing: string_a + string_b. Python string addition, end to end. Two required inputs, string_a and string_b, both defaulting to "", and one STRING output.
And that's where the trap lives: there is no separator. "blue" + "sky" is "bluesky", not "blue sky". If you want a space between them you have to build it - either a third concat with a " " in the middle, or better, reach for the pack's format_map or join nodes when you're assembling more than two pieces. concat is the blunt instrument; it shines for the simple "stick these together" cases.
Why you'd reach for it
The two-part join is its natural habitat. A filename prefix plus a date. A fixed style tag plus a dynamic subject. string_a wired from another node, string_b typed in - that's the pattern. Chain a few concats and you can assemble a longer string, though at three or four parts you should seriously consider format_map with a template instead; it's a lot easier to read later.
Installing
It's part of Basic data handling by StableLlama, so it shares the pack's dead-simple install. In ComfyUI Manager, search "Basic data handling" → Install → restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
Restart ComfyUI. This pack declares zero runtime dependencies - pure stdlib - so there's no pip hell and no model download to worry about. In a community where half the setup pain is dependency conflicts between node packs, that's the whole appeal.
Where people get burned
Order. string_a + string_b is not commutative, and when you're chaining two or three concats it's easy to assemble something backwards and not notice until the output reads wrong. Also the missing-separator thing - it's the single most common "why is my prompt one long word" question, and the answer is always that concat doesn't insert anything. If your parts naturally need commas or spaces between them, join with a ", " separator from the start.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| string_a | STRING | — | |
| string_b | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |