Nodes/KJNodes for ComfyUI/Join String Multi
ComfyUI Node Runs on cloud

Join String Multi

Join many strings, or emit them as a list

By kijai·Created 3 years ago·Updated about 9 hours ago· 2,930
Join String Multi
    • string
    inputcount2
    string_1
    delimiter
    return_listfalse
    string_2

    The many-input version of JoinStrings, plus one genuinely useful trick: it can hand you the strings as a list instead of merging them. That second mode is what makes it more than a convenience node - it's how you turn a handful of separate prompts into a batch that runs one after another.

    Two jobs in one node

    Job one: concatenate several strings. Set how many inputs you want, wire your text fragments in, pick a delimiter, and get one combined string out. This is the "I'm assembling a prompt from five pieces" case, without building a staircase of two-input joins. Cleaner graph, one node.

    Job two: build a list of strings. Flip return_list on and instead of gluing everything together, the node emits each input as a separate item in a string list. Feed that into a sampler chain that iterates over lists and ComfyUI runs the graph once per string - so three prompts in becomes three generations out. That's a quick, no-scripting way to batch several distinct prompts through the same workflow. It's the difference between "one image from a merged megaprompt" and "one image per prompt."

    The inputs and output that matter

    • inputcount - how many string inputs to show, from 2 up to 1000. Set it, update, and the sockets appear.
    • string_1, string_2, … - your text fragments, however many you asked for.
    • delimiter (default a space) - what goes between them in concatenate mode. Ignored when you're returning a list.
    • return_list (default false) - the mode switch. Off = one joined string. On = a list of the inputs.

    The output is a string. In concatenate mode it's the merged text; in list mode it's the list of individual strings. The receiving node decides what it does with a list - samplers and encoders that understand list inputs will iterate; ones that don't will take the first item.

    How to install it

    It's part of kijai's KJNodes pack.

    • ComfyUI Manager - search KJNodes for ComfyUI, install, restart.
    • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, then pip install -r ComfyUI-KJNodes/requirements.txt, restart.

    No models or dependencies.

    Common issues & troubleshooting

    return_list on, but only one generation runs. The list only fans out if the downstream nodes actually support list inputs and iterate over them. If your encoder/sampler collapses a list to its first element, you'll get one result. This is a ComfyUI list-execution behavior, not a bug in the node - make sure the whole path from here to the sampler is list-aware.

    Delimiter seems ignored. It is, in list mode - the delimiter only applies when you're concatenating. Turn return_list off if you meant to merge.

    Empty inputs sneak into the output. In list mode an unconnected or blank input can show up as an empty string in the list, which then runs as an empty prompt. Set inputcount to exactly how many you're filling so there are no blanks riding along.

    You only ever have two strings. Then plain JoinStrings is the simpler node. Reach for JoinStringMulti when the count is genuinely variable, large, or when you want the list-batch behavior.

    CategoryKJNodes/text

    Inputs (5)

    NameTypeDefaultDescription
    inputcountINT22–1000
    string_1STRING
    delimiterSTRING
    return_listBOOLEANfalse
    string_2optSTRING

    Outputs (1)

    NameTypeDescription
    stringSTRING