Nodes/danbot-comfy-node/Danbot Concat String
ComfyUI Node

Danbot Concat String

Join up to six strings with a separator you control

By p1atdev·Created 2 years ago·Updated about a year ago· 35
Danbot Concat String
    • STRING
    string_1
    string_2
    string_3
    string_4
    string_5
    string_6
    separator,

    Every prompt pack ships a string joiner, and Danbot Concat String is this one's. You plug in up to six strings, it glues them together with a separator you set, and hands you one combined string. That's it - but in a tag-translation workflow it earns its place, because you're constantly stitching: translation output + extension output + a quality-tag suffix like masterpiece, best quality + maybe a hand-written override.

    The interesting defaults are where the quality lives. The separator defaults to ", " - comma-space - which is exactly the delimiter the Danbooru tag vocabulary expects (and that prompt-engineering lore insists on: no underscores, commas with spaces). If you're building tag lists, don't change it. Where you would change it is if you're gluing whole sentences or template fragments together - set it to "\n" or nothing and it behaves like a plain concat.

    The details that matter

    • Six inputs, string_1 through string_6, all optional. Empty and whitespace-only inputs are silently dropped, so a dangling unconnected socket won't produce ", , ," in your prompt. That's a nicer behavior than most joiners have.
    • Each string is trimmed before joining, which kills the stray spaces that ComfyUI nodes love to leave behind.
    • Only the separator input is typed by hand; the six string sockets are forceInput, so they're for wiring, not typing. If you want to type text into the graph, that's what Danbot Text Input is for - text node → this joiner → text encoder is the canonical chain.

    The gotcha

    Everything that goes in comes out joined - there's no deduplication and no sorting. If your translation pass and extension pass both emit 1girl, you'll get 1girl, 1girl in your final prompt. That's usually harmless (models mostly shrug at duplicate tags) but if it bugs you, dedupe before you hit this node. Also note the output is a plain STRING, so you can chain joiners if six inputs somehow aren't enough.

    Install

    Same one-line install as every node in this pack. ComfyUI Manager → danbot-comfy-node, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/p1atdev/danbot-comfy-node
    cd danbot-comfy-node
    pip install -r requirements.txt
    

    (portable: ../../../python_embeded/python.exe -s -m pip install -r requirements.txt.) It sits under prompt/Danbooru Tags Translator/utils after restart.

    Categoryprompt/Danbooru Tags Translator/utils

    Inputs (7)

    NameTypeDefaultDescription
    string_1optSTRING
    string_2optSTRING
    string_3optSTRING
    string_4optSTRING
    string_5optSTRING
    string_6optSTRING
    separatoroptSTRING,

    Outputs (1)

    NameTypeDescription
    STRINGSTRING