Nodes/comfyui-AGSoft/📝🪡AGSoft Text Concatenate X4
ComfyUI Node

📝🪡AGSoft Text Concatenate X4

Four prompt parts, joined once — the mid-size workhorse

By Art-xmaster·Created 12 months ago·Updated a day ago· 23
📝🪡AGSoft Text Concatenate X4
    • STRING
    text_1
    text_2
    text_3
    text_4
    reverse_orderfalse
    delimiter,
    custom_delimiter
    clean_whitespacetrue
    ignore_empty_stringstrue

    Somewhere between "just two strings" and "an entire prompt template," there's the four-part build: subject + style + lighting + quality tags, each from a different node. 📝🪡AGSoft Text Concatenate X4 is the fixed-input version for exactly that shape. Four multiline fields, one joined output, and the same empty-skip and delimiter machinery that keeps the join clean when a branch produces nothing.

    How it works

    Static text_1 through text_4 inputs, a single STRING output. The pipeline is identical to the rest of the family:

    • clean_whitespace (on) trims each field before joining.
    • ignore_empty_strings (on) drops blanks so a dead branch doesn't leave ", , " in your prompt.
    • delimiter - the 15 presets (, default, "New Line", "Space", " - ", etc.) or "custom".
    • custom_delimiter - free text with \n/\t/\r escapes, active only in "custom" mode.
    • reverse_order - join last-input-first if a downstream node wants it that way.

    Where X4 earns its place

    The sweet spot is mixing static and dynamic content: two fields hard-coded (a base style, a fixed negative-fragment), two driven by other nodes (a translated prompt, a random tag picker). Because every field is multiline and accepts an incoming wire, X4 is effectively a small prompt-assembly hub. The fixed layout means no JS widget to reconfigure, which makes it the one that shows up in shared workflows people actually read.

    A practical pattern: field 1 = subject, field 2 = environment, field 3 = style descriptor, field 4 = quality batch, delimiter ", ". Leave any of the four unconnected and the join simply skips it - which is the behavior people usually want from a prompt builder but rarely get from hand-rolled concatenation.

    Installing

    cd ComfyUI/custom_nodes
    git clone https://github.com/Art-xmaster/comfyui-AGSoft
    

    Restart, or ComfyUI Manager → "comfyui-AGSoft". No models. If your output has unexpected , runs, it's almost always ignore_empty_strings being off (or an upstream node emitting whitespace that looks empty) - flip it back on and check what's actually landing in each field with a Show Text node.

    CategoryAGSoft/Text

    Inputs (9)

    NameTypeDefaultDescription
    text_1STRINGThe 1st text string to concatenate. / 1-я текстовая строка для объединения.
    text_2STRINGThe 2nd text string to concatenate. / 2-я текстовая строка для объединения.
    text_3STRINGThe 3rd text string to concatenate. / 3-я текстовая строка для объединения.
    text_4STRINGThe 4th text string to concatenate. / 4-я текстовая строка для объединения.
    reverse_orderBOOLEANfalseIf true, concatenates strings in reverse order (from last active input to first). Example: text_1='A', text_2='B', text_3='C' → result will be 'C, B, A' --- Если включено, объединяет строки в обратном порядке (от последнего активного входа к первому). Пример: text_1='A', text_2='B', text_3='C' → результат будет 'C, B, A'
    delimiterCOMBO,The separator used between concatenated strings. Choose from presets or 'custom'. Presets: - 'custom' : Enter your own delimiter in the next field. Supports escape sequences: \n (newline), \t (tab), \r (carriage return). - ',' : Comma separator. - '.' : Period separator. - 'New Line' : Inserts a line break (\n) in the output. - 'New Line X2' : Inserts a blank line (\n\n) for visual spacing between paragraphs. - 'Space' : Inserts a single space character. - ';' : Semicolon separator. - '|' : Vertical bar separator. - ' - ' : Dash with spaces. - ' | ' : Pipe with spaces. - ' :: ' : Double colon with spaces. - ' >>> ' : Triple greater-than with spaces. - ' • ' : Bullet point with spaces. - ' — ' : Em dash with spaces. - ' ... ' : Ellipsis with spaces. --- Разделитель, используемый между объединяемыми строками. Выберите из предустановленных вариантов или 'custom'. Предустановленные значения: - 'custom' : Введите свой собственный разделитель в следующем поле. Поддерживает escape-последовательности: \n (перенос строки), \t (табуляция), \r (возврат каретки). - ',' : Запятая. - '.' : Точка. - 'New Line' : Вставляет перенос строки (\n) в выводе. - 'New Line X2' : Вставляет пустую строку (\n\n) для визуального разделения абзацев. - 'Space' : Вставляет один пробел. - ';' : Точка с запятой. - '|' : Вертикальная черта. - ' - ' : Дефис с пробелами. - ' | ' : Пайп с пробелами. - ' :: ' : Двойное двоеточие с пробелами. - ' >>> ' : Три знака больше с пробелами. - ' • ' : Эмодзи-точка с пробелами. - ' — ' : Длинное тире с пробелами. - ' ... ' : Многоточие с пробелами.
    custom_delimiterSTRINGEnter a custom delimiter if 'custom' is selected above. Ignored otherwise. Supports escape sequences: \n (newline), \t (tab), \r (carriage return). Example: '\n\n' for blank line, ' | ', '---', or even an emoji like '⭐'. --- Введите пользовательский разделитель, если выше выбрано 'custom'. Игнорируется в противном случае. Поддерживает escape-последовательности: \n (перенос строки), \t (табуляция), \r (возврат каретки). Пример: '\n\n' для пустой строки, ' | ', '---', или даже эмодзи, например '⭐'.
    clean_whitespaceBOOLEANtrueIf true, removes leading and trailing whitespace from each input string before concatenation. Example: ' hello ' → 'hello' --- Если установлено, удаляет начальные и конечные пробелы из каждой входной строки перед объединением. Пример: ' hello ' → 'hello'
    ignore_empty_stringsBOOLEANtrueIf true, empty strings (or strings that become empty after cleaning whitespace) will be ignored and not included in the final result. This includes strings containing only spaces, tabs, or newlines. --- Если установлено, пустые строки (или строки, которые становятся пустыми после очистки пробелов) будут проигнорированы и не будут включены в конечный результат. Это включает строки, состоящие только из пробелов, табуляций или переносов строк.

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGConcatenated result of 4 input strings. / Результат объединения 4 входных строк.