Nodes/ComfyUI Logic Support/String Concatenator
ComfyUI Node

String Concatenator

Glue for prompt fragments, without the cleanup

By narusas·Created about a year ago·Updated about a year ago· 0
String Concatenator
    • C
    separator_typeEMPTY
    string1
    string2
    string3
    string4
    string5
    string6
    string7
    string8
    string9
    string10
    string11
    string12
    string13
    string14
    string15

    Dynamic text in ComfyUI is really just a lot of small strings being shoved together - a subject, a style, a quality tag, a camera angle - and String Concatenator is the shove. It takes up to 15 string inputs, joins them with the separator you pick, and hands back one finished STRING. The trick that makes it actually pleasant to use: empty strings are dropped automatically before joining. So you can leave half the inputs unwired, or feed it a conditional branch that sometimes produces nothing, and you never end up with stray commas or doubled spaces polluting the result.

    The separator_type dropdown does the joining, with four choices: EMPTY (nothing between strings), COMMA (a bare ,), SPACE, and PIPE (a bare |). Note that's a plain pipe character, not the padded | the README hints at - check the shipped code and you'll see join("|"). string1 through string5 are required inputs; string6 through string15 are optional and can stay unwired, which is where the empty-string filtering earns its keep. One STRING output comes out the far side, ready to feed a CLIP Text Encode or a save filename.

    The natural way to use it is as the assembly step at the end of a logic chain. The pack's example workflow does exactly this: a number (age) gets bucketed by Number Range Index, a String Switch By Number picks the matching text fragment, and this node stitches the pieces into the final prompt. It also shines for building filenames or JSON on the fly - set separator_type to PIPE and concatenate a list of tags into one string.

    Two small things to know. Because empties are filtered, you can't use this node to build deliberately empty slots or a,,b-style output - there's no way to keep a placeholder in the middle. And the COMMA separator is a bare comma with no trailing space, so joining "hello" and "world" gives hello,world, not hello, world; if your grammar needs the space, use SPACE and put commas in the strings themselves. Both are "read the actual behavior once" details, not problems.

    Install is the pack-standard one-liner:

    cd ComfyUI/custom_nodes
    git clone https://github.com/narusas/Comfyui-Logic-Support
    

    Restart ComfyUI (or refresh the tab) afterward - or use ComfyUI Manager and search for "ComfyUI Logic Support." The whole pack is pure Python with zero dependencies and no models to fetch, so this won't start a dependency war with the rest of your custom_nodes. MIT-licensed, single-author, small community footprint. It's a quiet little utility that just does the joining.

    CategoryLogic-Support

    Inputs (16)

    NameTypeDefaultDescription
    separator_typeCOMBOEMPTY4 options: EMPTY, COMMA, SPACE, PIPE
    string1STRING
    string2STRING
    string3STRING
    string4STRING
    string5STRING
    string6optSTRING
    string7optSTRING
    string8optSTRING
    string9optSTRING
    string10optSTRING
    string11optSTRING
    string12optSTRING
    string13optSTRING
    string14optSTRING
    string15optSTRING

    Outputs (1)

    NameTypeDescription
    CSTRING