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

📝🪡AGSoft Text Concatenate

The prompt joiner that doesn't leave empty commas behind

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

    Every prompt-builder workflow ends up gluing strings together, and the naive text + "," + text approach has a nasty habit: leave one field empty and you get "masterpiece, , highly detailed" - stray commas and double spaces that quietly pollute your conditioning. 📝🪡AGSoft Text Concatenate is the pack's flexible string-joiner that handles that by default: it cleans whitespace, skips empty strings, and only inserts the delimiter between the strings that actually exist. It manages 2 to 32 inputs dynamically, so it grows with your workflow instead of forcing you to guess a fixed count.

    How it works

    It's the big brother of the pack's fixed X2/X4/X8 concatenates. The inputs are created dynamically by frontend JS based on number_of_inputs (2–32) - set it to 7 and you get text_1 through text_7, no dead sockets. The execution pipeline is where the quality lives:

    1. clean_whitespace (default on) - strips leading/trailing whitespace from each input.
    2. ignore_empty_strings (default on) - drops anything empty or whitespace-only.
    3. delimiter - the separator, chosen from 15 presets (",", "New Line", "Space", " | ", and more) or "custom" for your own.
    4. custom_delimiter - the free-text field, active only when delimiter is "custom". Supports escape sequences: \n (newline), \t (tab), \r.
    5. reverse_order (default off) - flips the join order (last input first). Handy when a downstream node reads prompts newest-first.

    The output is a single STRING - the joined result.

    What you'll actually set

    • number_of_inputs - grow the field count to match your prompt parts.
    • delimiter - this is the one you'll touch constantly. ", " is what most people want for prompt fragments; "New Line" if you're building a multi-paragraph structure. The " - " and " :: " presets are aimed at tag-style joins.
    • ignore_empty_strings - leave on. Turn it off only if you want empty entries represented (e.g. you're joining for CSV-style output and need positional slots).

    Installing and gotchas

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

    Restart, or ComfyUI Manager → "comfyui-AGSoft". No models.

    The one trap: because custom delimiters go through escape processing, a literal \n in your custom field becomes a newline - which is what you want 99% of the time, but if you ever need a literal backslash-n in the output you'll have to double it. And remember this is the dynamic variant: if you know you'll always join exactly 4 strings, the fixed X4 is the tidier, less-widget-y choice. Use the dynamic one when the count changes between workflows.

    CategoryAGSoft/Text

    Inputs (6)

    NameTypeDefaultDescription
    number_of_inputsINT22–32Number of text inputs to create (2-32). Each input will be named text_1, text_2, etc. Example: number_of_inputs=3 → creates text_1, text_2, text_3 Inputs are managed dynamically via frontend JS. --- Количество текстовых входов (2-32). Каждый вход будет называться text_1, text_2 и т.д. Пример: number_of_inputs=3 → создаются text_1, text_2, text_3 Входы управляются динамически через JS на фронтенде.
    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). - 'New Line X2' : Inserts a blank line (\n\n) for visual spacing between paragraphs. --- Разделитель. 'custom' поддерживает \n, \t, \r. 'New Line X2' вставляет \n\n.
    custom_delimiterSTRINGEnter a custom delimiter if 'custom' is selected above. Supports \n, \t, \r. --- Пользовательский разделитель. Поддерживает \n, \t, \r.
    clean_whitespaceBOOLEANtrueStrip leading/trailing whitespace. / Удалить пробелы по краям.
    ignore_empty_stringsBOOLEANtrueSkip empty strings (including whitespace-only). / Пропускать пустые строки (включая состоящие только из пробелов).

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGConcatenated text result. / Результат объединения.