IW StringConcat
Two strings in, one string out — no hidden tricks
- STRING
IW StringConcat joins a prefix and a suffix and returns the combined string. That's it - prefix + suffix, no separator added, no whitespace trimmed, no magic. For a node with this small a job, the useful part is knowing exactly what it won't do for you, because that's where people trip.
When you'd use it
Prompt assembly is the obvious case. Say you've got a base prompt fragment you reuse across a batch - best quality, highly detailed, - and a per-image bit that changes. Concatenate the constant prefix with the changing suffix and you can feed the result into your CLIP Text Encode without hand-editing a whole prompt per run. It's equally handy for building filenames from parts, or prefixing an LLM-generated string (like this pack's own OllamaGenerateString output) before it hits a text encoder.
It's a two-input operation and it knows how to be exactly that. Both prefix and suffix are multiline strings, and both accept wired input, so you can chain them: concat A+B, feed the output into another concat's prefix, and keep building. That's the whole architecture.
The trap: it concatenates, it doesn't assemble
Because there's no separator logic, "foo" + "bar" gives you "foobar". If you need "foo bar" or "foo, bar", the space or comma has to be part of one of the inputs - a trailing space in the prefix or a leading one in the suffix. It's the classic dumb-glue behavior, and the fix is remembering to write your strings with the joins already in them. Same goes for newlines: multiline fields are passed through verbatim, so if your suffix starts on a new line, that line break is real.
There are fancier string nodes out there that handle separators, regex, and formatting. This one deliberately doesn't - it's from the same minimal iwanders/ComfyUI_nodes pack as the other IW string nodes, and the author's style is "one job, done plainly." If you want a formatter, grab a template node instead. If you want glue you can reason about in five seconds, this is it.
Installing
cd ComfyUI/custom_nodes
git clone https://github.com/iwanders/ComfyUI_nodes
Restart ComfyUI, or find iwanders under Custom Nodes in ComfyUI Manager. No dependencies, no models to download - a pure-stdlib node in a pack that has zero install friction.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| prefix | STRING | — | |
| suffix | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |