Nodes/Vantage-Nodes/Join Multiline String
ComfyUI Node

Join Multiline String

Collapse a multiline list back into one string with a delimiter

By vantagewithai·Created 8 months ago·Updated 26 days ago· 25
Join Multiline String
    • joined
    text
    delimiter,
    include_emptyfalse

    The inverse of the pack's DelimiterSplit: instead of splitting a delimited string into lines, this takes a multiline list and folds it back into a single string with a separator you choose. Lines become "item1, item2, item3" or "item1|item2|item3" - whatever downstream wants.

    It sounds trivial, but it's one of those glue nodes that unblocks real workflows. LLM outputs and tag lists often arrive as lines; the thing you're feeding them into wants a single comma-joined string. A multi-line prompt source that needs to become one clean line for a text encoder, a batch of tags that needs to collapse into a CSV cell - this is the node that does the folding without a Python node.

    What it needs

    • text - the multiline list to join.
    • delimiter - the separator between items. Default ", " (comma-space), which is right for most human-readable prompt strings. Set it to , for CSV, | for a pipe list, or any literal you need.
    • include_empty - whether blank lines are kept as items. Default false, so a list with stray blank lines collapses cleanly without producing a, , b. Turn it on if empty entries are intentional.

    One output: joined, the single resulting string.

    How it behaves

    Straightforward delimiter.join(lines), with blank lines filtered unless you opt in. Empty input yields an empty string. No escaping, no quoting - if your items contain the delimiter (an item with a comma when you're joining with commas), the output gets ambiguous, but that's a data problem this node will faithfully reproduce, not a bug.

    The realistic pairing is at the end of a string pipeline: DelimiterSplit → filter/index/randomize → StringJoiner. Split a messy source, operate on individual lines, then reassemble into the single-string format your encoder or API expects.

    Install

    Part of Vantage-Nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/vantagewithai/Vantage-Nodes.git
    pip install -r requirements.txt
    

    or ComfyUI Manager → search "Vantage-Nodes" → Install → restart.

    Common issues

    • Extra spaces in the result - default delimiter is ", " (comma-space); if you need "a,b" without spaces, set the delimiter to ,.
    • Empty items appearing - include_empty is on, so blanks count. Toggle it off.
    • Items containing the delimiter - the join has no quoting; the result becomes ambiguous but stays as-is. Fix the source data if it matters.
    CategoryVantage/String

    Inputs (3)

    NameTypeDefaultDescription
    textSTRING
    delimiterSTRING,
    include_emptyBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    joinedSTRING