📝🪡AGSoft Text Concatenate X4
Four prompt parts, joined once — the mid-size workhorse
- STRING
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/\rescapes, 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.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| text_1 | STRING | The 1st text string to concatenate. / 1-я текстовая строка для объединения. | |
| text_2 | STRING | The 2nd text string to concatenate. / 2-я текстовая строка для объединения. | |
| text_3 | STRING | The 3rd text string to concatenate. / 3-я текстовая строка для объединения. | |
| text_4 | STRING | The 4th text string to concatenate. / 4-я текстовая строка для объединения. | |
| reverse_order | BOOLEAN | false | If 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' |
| delimiter | COMBO | , | 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_delimiter | STRING | Enter 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_whitespace | BOOLEAN | true | If true, removes leading and trailing whitespace from each input string before concatenation. Example: ' hello ' → 'hello' --- Если установлено, удаляет начальные и конечные пробелы из каждой входной строки перед объединением. Пример: ' hello ' → 'hello' |
| ignore_empty_strings | BOOLEAN | true | If 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)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | Concatenated result of 4 input strings. / Результат объединения 4 входных строк. |