Nodes/TrentNodes/Cowboy Multi-Line String Concatenate (Dynamic)
ComfyUI Node

Cowboy Multi-Line String Concatenate (Dynamic)

The prompt assembler that grows its own sockets

By TrentHunter82·Created 9 months ago·Updated 4 days ago· 36
Cowboy Multi-Line String Concatenate (Dynamic)
  • string_1
  • text
skip_emptytrue

The fixed-ten-slot version of this node is predictable. This one is the version that stops being predictable in the good way: connect an input and a new one appears. Each connected input becomes one line of a single multi-line string, and the node keeps spawning sockets until you stop wiring things in. If you've ever tried to join a variable number of strings and discovered ComfyUI's native options don't love that, this is the fix.

The mechanism is the standard dynamic-input pattern - the node watches its own sockets and extends itself when the last one fills. You connect string_1, a string_2 appears; fill that and string_3 shows up. The useful wrinkle is in the node description: "A list input becomes one line per item." Wire in a list (say, from a string-list builder) and the node unrolls it into individual lines rather than pasting the whole list as one line. That's the feature that makes this more than a concatenate - it's a flatten-and-join in one step.

skip_empty (default on) is the only real setting: an empty input adds no line; off, an empty input adds a blank line. Everything else is just "connect stuff, get text out."

When you'd reach for it over the fixed version

  • Variable-arity prompt assembly - you don't know how many components a run will have until you build the graph. Dynamic sockets mean you never stare at a wall of empty slots.
  • Folding a string list into a multi-line prompt - a list of tags, a batch of captions, a set of filenames; each item becomes its own line automatically.
  • Keeping the graph compact - one node that holds exactly the connections you made, no more.

The single output is text: "All the connected inputs joined with newlines." Newline is the separator; there's no delimiter option, so if you want commas you add them at the source or use the pack's list tooling instead.

Gotchas

Dynamic-input nodes have one quirk that bites people loading shared workflows: the number of sockets is a property of the graph, so a saved workflow remembers the connection count. If you load one with fewer slots than you expected, wire into the last visible socket and the next will appear - it's the same mechanics, just re-established. And unlike the fixed version, you can't "reserve" ten slots by typing text; the node only materializes slots you connect, so text-in-a-field is the fixed node's job, wiring is this one's.

Ships in TrentNodes: ComfyUI Manager (search "Trent Nodes"), or clone + pip install -r requirements.txt. No models, no downloads - pure plumbing, and the kind of node that quietly removes a whole class of "I hardcoded the count and now the loop broke" failures from prompt-generation graphs.

CategoryTrent/Text

Inputs (2)

NameTypeDefaultDescription
skip_emptyoptBOOLEANtrueOn - an empty input adds no line. Off - an empty input adds a blank line.
string_1opt*

Outputs (1)

NameTypeDescription
textSTRINGAll the connected inputs joined with newlines.