Nodes/Shima/Shima String Concat
ComfyUI Node

Shima String Concat

Glue up to four strings together without thinking about separators

By KDB-USJP·Created 6 months ago·Updated 6 months ago· 2
Shima String Concat
    • string
    separator
    custom_separator
    string_1
    string_2
    string_3
    string_4
    allow_external_linkingfalse

    Prompt building in ComfyUI is mostly string surgery: base prompt plus style tag plus quality suffix, joined with the right separator, with a comma where a comma belongs. Shima StringConcat is a four-input string joiner that takes the separator decision out of your hands - pick Space, Comma, Newline, or a custom separator and it joins whatever inputs are actually connected, skipping the empty ones.

    It's the "many values into one" counterpart to the pack's String primitive. Where String is a single authoritative source that fans out, Concat is the collection point: gather a style name, a subject, and a quality token from different nodes, and emit one combined string for your prompt box or CLIP encoder.

    The inputs

    • separator - None (just concatenates), Space, Comma, Newline, or Custom. The default is None, so out of the box the node concatenates with no glue at all - wire in Comma or a custom separator if you want readable joins.
    • custom_separator - used only when separator is Custom. Type anything, including multi-character glue like " | ".
    • string_1 through string_4 - the inputs. All optional; unconnected ones are skipped, so you can leave holes without getting stray separators. Order is preserved: string_1 first, then 2, 3, 4.
    • allow_external_linking - the pack's Use Everywhere toggle, off by default.

    Output: string, the joined result.

    How it behaves

    The join is separator.join(values) on the non-None inputs, which means two things. First, a missing middle input is fine - with a comma separator, ["a", None, "b"] becomes "a, b", not "a, , b". Second, every input is coerced with str(), so wiring an INT in works, though it's clearly meant for strings.

    Installing it

    Part of KDB-USJP/shima_wf:

    cd ComfyUI/custom_nodes
    git clone https://github.com/KDB-USJP/shima_wf
    

    Restart ComfyUI. No special dependencies.

    The honest take

    Four inputs and a separator is a modest feature set - if you need to join more than four pieces or want to reorder at runtime, you'll outgrow it fast. But for the common "assemble a prompt from parts" job it's cleaner than hand-typing a prompt with placeholders, and the skip-empty behavior means you can wire in optional branches and get a sensible string no matter which are live. Where people stumble: forgetting that Comma inserts a comma-space. If you're building something delimiter-sensitive (a CSV, a tag list that must not contain spaces), switch to Custom and type the exact separator you need.

    CategoryShima/Utilities

    Inputs (7)

    NameTypeDefaultDescription
    separatorCOMBO5 options: None, Space, Comma, Newline, Custom
    custom_separatorSTRING
    string_1optSTRING
    string_2optSTRING
    string_3optSTRING
    string_4optSTRING
    allow_external_linkingoptBOOLEANfalseIf ON, this node broadcasts/receives OUTSIDE the Island (ignores group regex)

    Outputs (1)

    NameTypeDescription
    stringSTRING