Nodes/TrentNodes/Cowboy Multi-Line String Concatenate
ComfyUI Node

Cowboy Multi-Line String Concatenate

Ten strings, one clean multi-line prompt

By TrentHunter82·Created 9 months ago·Updated 4 days ago· 36
Cowboy Multi-Line String Concatenate
    • text
    string_1
    string_2
    string_3
    string_4
    string_5
    string_6
    string_7
    string_8
    string_9
    string_10
    skip_emptytrue

    Every serious workflow ends up building a prompt from parts - a subject line, a style block, a quality tag, a lighting phrase - and if you've done that in ComfyUI, you've hit the annoyance: there's no native node that just joins strings cleanly. Cowboy Multi-Line String Concatenate is the fix: ten string slots, each becomes one line of the output, and the whole thing collapses into a single STRING. It's the plumbing-layer node that fights repetition and illegibility, which is exactly what that layer of the graph exists for.

    The model is simple and worth internalizing: each filled slot is one line. Type into a slot, or connect a string into it - the node accepts both, so it works equally well for a hand-typed quality suffix and a value that came from a filename extractor or a prompt-builder node. Empty slots are skipped by default (skip_empty on), which is the behavior you want 95% of the time: leave slots unused and they silently vanish rather than leaving blank lines in your prompt. Flip skip_empty off and an empty slot adds a blank line - which is occasionally the point (visual spacing in a multi-line caption, say).

    What you'd actually use it for

    • Assembling a multi-line prompt from per-aspect components - subject / style / lighting / negative-ish reminders - where the line break is meaningful and you want each piece editable without touching a giant blob.
    • Splicing node output into a template. A filename extractor gives you one line; a fixed style block is another; the concatenate merges them with newlines in between.
    • Building a batch of prompts when combined with a line-driven loop - each slot fed by a different source, one text output downstream.

    The single output is text, tooltipped as "All the filled slots joined with newlines." There's no separator option and no delimiter - newline is the contract. If you need commas, that's the same pack's string-list tooling or just end each slot's text with a comma.

    Gotchas

    The dynamic-input sibling (Cowboy Multi-Line String Concatenate (Dynamic)) grows slots as you connect them; this one is fixed at ten. If you find yourself wanting eleven lines, that's the Dynamic version's job, not this one's. Also note each slot is a single line input - if you paste a multi-line block into one slot, it becomes one multi-line string that still joins as a unit, which is usually fine but occasionally surprises people who expected per-line splitting.

    It ships in TrentNodes: ComfyUI Manager (search "Trent Nodes"), or git clone https://github.com/TrentHunter82/TrentNodes into custom_nodes/ + pip install -r requirements.txt. No models, no downloads, no dependencies beyond the pack core. It's the kind of node that looks too simple to matter until you've rebuilt "join these strings" with a custom function node once - then it just lives in your graph.

    CategoryTrent/Text

    Inputs (11)

    NameTypeDefaultDescription
    string_1optSTRINGSlot 1. One line of the output.
    string_2optSTRINGSlot 2. One line of the output.
    string_3optSTRINGSlot 3. One line of the output.
    string_4optSTRINGSlot 4. One line of the output.
    string_5optSTRINGSlot 5. One line of the output.
    string_6optSTRINGSlot 6. One line of the output.
    string_7optSTRINGSlot 7. One line of the output.
    string_8optSTRINGSlot 8. One line of the output.
    string_9optSTRINGSlot 9. One line of the output.
    string_10optSTRINGSlot 10. One line of the output.
    skip_emptyoptBOOLEANtrueOn - an empty slot adds no line. Off - an empty slot adds a blank line.

    Outputs (1)

    NameTypeDescription
    textSTRINGAll the filled slots joined with newlines.