Nodes/ComfyUI LC123 Nodes/LC Join Strings πŸ”—
ComfyUI Node

LC Join Strings πŸ”—

Assemble prompt parts without a wall of plus-sign nodes

By lonecatone23Β·Created 2 months agoΒ·Updated 3 days agoΒ· 18
LC Join Strings πŸ”—
    • string
    β—„inputcount2β–Ί
    β—„delimiter β–Ί
    β—„string_1β–Ί
    β—„string_2β–Ί
    β—„string_3β–Ί
    β—„string_4β–Ί
    β—„string_5β–Ί
    β—„string_6β–Ί
    β—„string_7β–Ί
    β—„string_8β–Ί
    β—„string_9β–Ί
    β—„string_10β–Ί
    β—„string_11β–Ί
    β—„string_12β–Ί
    β—„string_13β–Ί
    β—„string_14β–Ί
    β—„string_15β–Ί
    β—„string_16β–Ί
    β—„string_17β–Ί
    β—„string_18β–Ί
    β—„string_19β–Ί
    β—„string_20β–Ί
    β—„string_21β–Ί
    β—„string_22β–Ί
    β—„string_23β–Ί
    β—„string_24β–Ί
    β—„string_25β–Ί
    β—„string_26β–Ί
    β—„string_27β–Ί
    β—„string_28β–Ί
    β—„string_29β–Ί
    β—„string_30β–Ί
    β—„string_31β–Ί
    β—„string_32β–Ί

    Prompts in ComfyUI are strings, and strings love to be built out of parts: a subject, a style, a camera, a lighting tag. The naive way is a daisy chain of concatenation nodes, which turns a three-part prompt into a rat's nest. LC Join Strings takes up to 32 string inputs and joins them with a delimiter you choose - and, crucially, it skips any input that's empty. That last bit is what makes it actually pleasant to use: you can leave sockets disconnected and the output stays clean instead of sprouting , , , in the middle.

    How it works

    Set inputcount (2–32) to decide how many string_1…string_N sockets appear, pick a delimiter, and every non-empty input gets joined in order with the delimiter between them. Empty and unconnected slots are skipped entirely. The delimiter is where the power is, because it's not just a space:

    • \n = newline (type the two characters backslash-n in the widget)
    • \n\n = blank line
    • \t = tab
    • default is a single space

    It also unwraps list inputs down to their first element and converts anything to a string, so a numeric socket won't blow up the join.

    Where it shines

    The obvious home is prompt building - wire the output of a subject node, a style selector, and a lighting node into three sockets with , as the delimiter and you get a composed prompt that updates whenever any part changes. With \n\n you get the block-structured prompts that modern LLM-encoded models actually respond to (the "structure the prompt in blocks" advice from the prompt-engineering playbook). It also handles the boring jobs - filenames, save paths, folder names - where you want a delimiter only between the parts that exist.

    The details that matter

    • The empty-skip behavior means the order of your inputs defines the order of your prompt. If a middle part is empty, the ones around it still join correctly.
    • Delimiter applies between non-empty parts only. No trailing delimiter, no doubled delimiters.
    • inputcount controls the sockets, but the underlying 32 sockets always exist - if you later raise the count, previously hidden inputs come back with their values.

    Install

    Part of ComfyUI LC123 Nodes (MIT, 89 nodes). ComfyUI Manager β†’ search "ComfyUI LC123 Nodes", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes
    

    Restart. No extra dependencies, no model files. On hosted platforms like RunningHub, the platform installs the pack on request.

    Gotchas

    The \n escape only works if you type the literal backslash - pasting an actual line break from another app usually lands as a real newline anyway, which is fine, just inconsistent. And remember the single output string feeds anything expecting a STRING: CLIP text encode, Prompt to Conditioning, save-text nodes, or the pack's own Prompt Assembler. One node, one job, does it without the wire storm.

    CategoryLC123/utils

    Inputs (34)

    NameTypeDefaultDescription
    inputcountINT22–32Number of string inputs to show and join.
    delimiterSTRING Between non-empty parts. Use \n for newline, \n\n for a blank line, \t for tab.
    string_1optSTRINGβ€”
    string_2optSTRINGβ€”
    string_3optSTRINGβ€”
    string_4optSTRINGβ€”
    string_5optSTRINGβ€”
    string_6optSTRINGβ€”
    string_7optSTRINGβ€”
    string_8optSTRINGβ€”
    string_9optSTRINGβ€”
    string_10optSTRINGβ€”
    string_11optSTRINGβ€”
    string_12optSTRINGβ€”
    string_13optSTRINGβ€”
    string_14optSTRINGβ€”
    string_15optSTRINGβ€”
    string_16optSTRINGβ€”
    string_17optSTRINGβ€”
    string_18optSTRINGβ€”
    string_19optSTRINGβ€”
    string_20optSTRINGβ€”
    string_21optSTRINGβ€”
    string_22optSTRINGβ€”
    string_23optSTRINGβ€”
    string_24optSTRINGβ€”
    string_25optSTRINGβ€”
    string_26optSTRINGβ€”
    string_27optSTRINGβ€”
    string_28optSTRINGβ€”
    string_29optSTRINGβ€”
    string_30optSTRINGβ€”
    string_31optSTRINGβ€”
    string_32optSTRINGβ€”

    Outputs (1)

    NameTypeDescription
    stringSTRINGβ€”