Nodes/ComfyUI-KSTR-Nodes/Text Concatenate (Dynamic)
ComfyUI Node

Text Concatenate (Dynamic)

A Text Joiner That Grows Its Own Inputs

By Ye0l·Created 2 months ago·Updated about a month ago· 0
Text Concatenate (Dynamic)
    • text
    separator,
    strip_inputstrue
    skip_emptytrue
    text_1
    text_2
    text_3
    text_4
    text_5
    text_6
    text_7
    text_8
    text_9
    text_10
    text_11
    text_12
    text_13
    text_14
    text_15
    text_16
    text_17
    text_18
    text_19
    text_20
    text_21
    text_22
    text_23
    text_24
    text_25
    text_26
    text_27
    text_28
    text_29
    text_30
    text_31
    text_32
    text_33
    text_34
    text_35
    text_36
    text_37
    text_38
    text_39
    text_40
    text_41
    text_42
    text_43
    text_44
    text_45
    text_46
    text_47
    text_48
    text_49
    text_50
    text_51
    text_52
    text_53
    text_54
    text_55
    text_56
    text_57
    text_58
    text_59
    text_60
    text_61
    text_62
    text_63
    text_64

    Stock ComfyUI's text-join story has always been a bit clumsy: a fixed handful of inputs, and when you need a sixth slot you're mutating the node. Text Concatenate (Dynamic) fixes the annoying part - it starts with two slots, and the moment you type into the last one, another slot appears. Up to 64 of them. Remove the text and the unused slots tidy themselves up. It's a small quality-of-life win, but it's the exact kind of thing that keeps a big prompt-building graph from turning into node surgery every five minutes.

    How it works

    The inputs you actually interact with: text_1, text_2, and so on - up to text_64. Type into the last visible slot and a new one grows; clear the trailing slots and they drop off. Behind the scenes the node collects every non-empty text slot, sorts them in order, and joins them with your separator.

    The three controls:

    • separator - what goes between pieces, default ", ". Change it to a newline or " + " if you're building something that isn't a comma-prompt.
    • strip_inputs (default on) - trims leading/trailing whitespace off each piece before joining.
    • skip_empty (default on) - drops empty slots from the result entirely, so a half-filled chain doesn't leave , , artifacts.

    With separator = ", ", strip_inputs and skip_empty on, and text_1 = masterpiece, text_2 = 1girl, text_3 = blue hair, you get masterpiece, 1girl, blue hair - no trailing comma, no double separators.

    There's also a text STRING output (the joined result), which is what you wire into a text encoder or into the pack's sibling Normalize Comma Prompt if you want a final formatting pass.

    Install

    It ships in Ye0l/ComfyUI-KSTR-Nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Ye0l/ComfyUI-KSTR-Nodes
    

    or search "ComfyUI-KSTR-Nodes" in ComfyUI Manager, then restart. The auto-growing slots need the pack's small JavaScript file (web/text_concatenate.js), which loads automatically because the pack declares a web directory - so as long as you restarted after installing, you get the dynamic behavior for free. No Python dependencies.

    Where people get burned

    Two small things. First, the dynamic-slot trick is a UI feature - the node itself exposes all 64 text inputs regardless, so if you're driving ComfyUI through its API you can still pass any of them; only the visual auto-grow needs the frontend. Second, this node is part of a very young pack (one commit, essentially no community footprint yet), so if a slot ever behaves oddly, check that the web directory actually loaded - a missing WEB_DIRECTORY shows up as slots that never appear. For day-to-day prompt assembly it's otherwise exactly what it says: concatenate, strip, skip, done.

    CategoryYeol/Text

    Inputs (67)

    NameTypeDefaultDescription
    separatorSTRING,
    strip_inputsBOOLEANtrue
    skip_emptyBOOLEANtrue
    text_1optSTRING
    text_2optSTRING
    text_3optSTRING
    text_4optSTRING
    text_5optSTRING
    text_6optSTRING
    text_7optSTRING
    text_8optSTRING
    text_9optSTRING
    text_10optSTRING
    text_11optSTRING
    text_12optSTRING
    text_13optSTRING
    text_14optSTRING
    text_15optSTRING
    text_16optSTRING
    text_17optSTRING
    text_18optSTRING
    text_19optSTRING
    text_20optSTRING
    text_21optSTRING
    text_22optSTRING
    text_23optSTRING
    text_24optSTRING
    text_25optSTRING
    text_26optSTRING
    text_27optSTRING
    text_28optSTRING
    text_29optSTRING
    text_30optSTRING
    text_31optSTRING
    text_32optSTRING
    text_33optSTRING
    text_34optSTRING
    text_35optSTRING
    text_36optSTRING
    text_37optSTRING
    text_38optSTRING
    text_39optSTRING
    text_40optSTRING
    text_41optSTRING
    text_42optSTRING
    text_43optSTRING
    text_44optSTRING
    text_45optSTRING
    text_46optSTRING
    text_47optSTRING
    text_48optSTRING
    text_49optSTRING
    text_50optSTRING
    text_51optSTRING
    text_52optSTRING
    text_53optSTRING
    text_54optSTRING
    text_55optSTRING
    text_56optSTRING
    text_57optSTRING
    text_58optSTRING
    text_59optSTRING
    text_60optSTRING
    text_61optSTRING
    text_62optSTRING
    text_63optSTRING
    text_64optSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING