Nodes/ComfyUI-TextUtils/Join String List
ComfyUI Node

Join String List

Collapse a batch of strings back into one

By wutipong·Created 3 years ago·Updated about a year ago· 2
Join String List
    • TEXT
    texts
    separator/

    This is the mirror image of Split String to List from the same pack. Where that node takes one string and explodes it into a batch, Join String List takes a batch of strings and collapses it back into one - glued together with whatever separator you pick. If you've got a list of captions, tags, or per-item results floating around your graph and you need them as a single block of text again (to save, to log, to display), this is the node.

    How it works

    The node is declared with INPUT_IS_LIST = True, which is ComfyUI's signal to hand the function the entire incoming list in one call instead of running the node once per item. Internally it's just separator.join(texts) - Python's standard string join, run once over the whole list. (One implementation quirk worth knowing if you ever read the source: because the node runs in list mode, even the separator widget arrives wrapped in a one-item list, which is why you'll see separator[0] if you go looking. That's ComfyUI plumbing, not something you need to think about as a user.)

    Inputs and outputs

    • texts - the list of strings to join. This input is marked forceInput, meaning there's no widget for it - it has to come from a wire, not a typed value. Feed it from Split String to List, or any other node that outputs a list of strings.
    • separator - what goes between each item when they're glued back together. Defaults to /.
    • Output: TEXT - one single string (not a list this time).

    How to install it

    Comes with the same pack as the other TextUtils nodes:

    • ComfyUI Manager: search "ComfyUI-TextUtils", install, restart.
    • Manual: git clone https://github.com/wutipong/ComfyUI-TextUtils into ComfyUI/custom_nodes, restart.

    No dependencies, no models - it's four plain Python files, nothing to pip install. There's no README in the repo either; everything here comes from actually reading the node's source rather than a doc that doesn't exist.

    Common issues & troubleshooting

    You can't type a value into texts. Because it's forceInput, there's no text box - just a socket. New users sometimes go looking for where to type their strings and come up empty; the fix is to wire in an upstream list-producing node instead. Split String to List (same pack) is the obvious pairing, but anything that outputs a list of strings works.

    Joining a "list" of one item just hands you that item back unchanged. Not a bug - if only one string ever reaches this node, there's nothing to join, so don't be surprised if the output looks identical to the input.

    Round-tripping isn't always lossless. If you split a string, edit some of the resulting items, and join it back with the same separator - and one of your edited items happens to contain that separator character itself - the joined result is ambiguous about where the original boundaries were. Pick a separator that won't show up inside your actual content if you plan to split-edit-join.

    Mismatched separator between split and join. It's easy to split on one character and then join on the default / without noticing - check both nodes if the reassembled text looks wrong.

    Categorytext utility

    Inputs (2)

    NameTypeDefaultDescription
    textsSTRING
    separatorSTRING/

    Outputs (1)

    NameTypeDescription
    TEXTSTRING