AGSoft Text Split
One text in, fifty named outputs — the node that feeds your loops
- string_1
- string_2
- string_3
- string_4
- string_5
- string_6
- string_7
- string_8
- string_9
- string_10
- string_11
- string_12
- string_13
- string_14
- string_15
- string_16
- string_17
- string_18
- string_19
- string_20
- string_21
- string_22
- string_23
- string_24
- string_25
- string_26
- string_27
- string_28
- string_29
- string_30
- string_31
- string_32
- string_33
- string_34
- string_35
- string_36
- string_37
- string_38
- string_39
- string_40
- string_41
- string_42
- string_43
- string_44
- string_45
- string_46
- string_47
- string_48
- string_49
- string_50
Stock ComfyUI can split text into a list, but lists are awkward to wire into a fixed graph - you end up fighting indexing nodes. AGSoft Text Split from comfyui-AGSoft takes the opposite approach: it gives you up to fifty named string outputs, string_1 through string_50, and you just plug each one straight into whatever needs it. It's the node that turns one multiline block into a small fan of individual prompts.
How it works
The mechanism is dead simple: text.split(delimiter), with the delimiter picked from a preset dropdown or supplied as a custom string. The presets cover the usual suspects - comma, period, semicolon, pipe, -, ::, emoji if you're into that - plus New Line (splits on \n) and Space. Choosing custom activates custom_delimiter, so you can split on --- or a star emoji if that's how your text separates things.
Two cleaning flags are on by default and worth leaving on:
clean_whitespace- strips leading/trailing whitespace from each part (so" red"becomes"red").ignore_empty_strings- drops parts that end up empty, which stops double-spaces from spawning blank outputs.
Then the two knobs that make this node actually interesting:
number_of_outputs(1–50, default 3) - how many outputs get real values. The node always shows all fifty sockets; the rest come back as empty strings. Set it to 3 andstring_1..string_3are populated,string_4..string_50are empty.start_from_index(1-based) - skip the head of the list. With text111 222 333 777 999 888and index 4, you get777,999,888. That's the lever for "I already processed the first few prompts, start from here."
What you'll actually touch
text, delimiter, and number_of_outputs cover 95% of use. The outputs are plain STRING sockets - string_1, string_2, string_3, … - and each wires into a prompt consumer, a Show Text, or a KSampler's conditioning the same way any text does. If you're doing a batch of variations, split the variation list once and hard-wire each variant into its own branch. No loop, no list indexing, just static wiring.
Where you'd reach for it
- Comma-separated style or prompt lists that you want each as a separate text value.
- Splitting a multiline batch where each line is one prompt, then fanning them out.
- Feeding individual segments into a ForEach-style loop where you need concrete string values rather than a list.
Installing it
Part of the comfyui-AGSoft utility pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Art-xmaster/comfyui-AGSoft.git
# restart ComfyUI
Or search comfyui-AGSoft in ComfyUI Manager. Pure Python, no dependencies beyond the pack itself.
Gotchas
The fifty-socket thing is the trap. Every node instance shows all fifty outputs regardless of number_of_outputs, and the unused ones output empty strings - so if you wire string_47 by accident, you'll silently feed an empty string somewhere. Set number_of_outputs to what you need and ignore the rest.
Also mind the two defaults that can surprise: start_from_index is 1-based (1 is the whole list, not the second item), and splitting on Space means double spaces create empty parts that only get cleaned up because ignore_empty_strings defaults to true. Turn that off and your "cleaned" output suddenly has holes.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | The text to be split into parts. / Текст, который будет разбит на части. | |
| delimiter | COMBO | Space | The separator used to split the text. Choose from presets or 'custom'. Presets: - 'custom' : Enter your own delimiter in the next field. - ',' : Comma separator. - '.' : Period separator. - 'New Line' : Splits by line breaks (\n). - 'Space' : Splits by 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' : Введите свой собственный разделитель в следующем поле. - ',' : Запятая. - '.' : Точка. - 'New Line' : Разбивает по переносам строк (\n). - 'Space' : Разбивает по одиночному пробелу. - ';' : Точка с запятой. - '|' : Вертикальная черта. - ' - ' : Дефис с пробелами. - ' | ' : Пайп с пробелами. - ' :: ' : Двойное двоеточие с пробелами. - ' >>> ' : Три знака больше с пробелами. - ' • ' : Эмодзи-точка с пробелами. - ' — ' : Длинное тире с пробелами. - ' ... ' : Многоточие с пробелами. |
| custom_delimiter | STRING | Enter a custom delimiter if 'custom' is selected above. Ignored otherwise. Example: ' | ', '---', or even an emoji like '⭐'. / Введите пользовательский разделитель, если выше выбрано 'custom'. Игнорируется в противном случае. Пример: ' | ', '---', или даже эмодзи, например '⭐'. | |
| clean_whitespace | BOOLEAN | true | If true, removes leading and trailing whitespace from each resulting part before output. / Если установлено, удаляет начальные и конечные пробелы из каждой полученной части перед выводом. |
| 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 outputs. / Если установлено, пустые строки (или строки, которые становятся пустыми после очистки пробелов) будут проигнорированы и не будут включены в конечные выходы. |
| number_of_outputs | INT | 31–50 | How many text outputs to create. Each output will be named string_1, string_2, etc. Example: number_of_outputs=3 → creates string_1, string_2, string_3. / Сколько текстовых выходов создать. Каждый выход будет называться string_1, string_2 и т.д. Пример: number_of_outputs=3 → создаются string_1, string_2, string_3. |
| start_from_index | INT | 11–1000 | Start splitting from this delimiter number (1-based index). Example: text='111 222 333 777 999 888', start_from_index=4 → parts=['777', '999', '888'] If the index is larger than the number of parts, all outputs will be empty. / Начинать разбивку с этого номера разделителя (индексация с 1). Пример: text='111 222 333 777 999 888', start_from_index=4 → parts=['777', '999', '888'] Если индекс больше количества частей, все выходы будут пустыми. |
Outputs (50)
| Name | Type | Description |
|---|---|---|
| string_1 | STRING | — |
| string_2 | STRING | — |
| string_3 | STRING | — |
| string_4 | STRING | — |
| string_5 | STRING | — |
| string_6 | STRING | — |
| string_7 | STRING | — |
| string_8 | STRING | — |
| string_9 | STRING | — |
| string_10 | STRING | — |
| string_11 | STRING | — |
| string_12 | STRING | — |
| string_13 | STRING | — |
| string_14 | STRING | — |
| string_15 | STRING | — |
| string_16 | STRING | — |
| string_17 | STRING | — |
| string_18 | STRING | — |
| string_19 | STRING | — |
| string_20 | STRING | — |
| string_21 | STRING | — |
| string_22 | STRING | — |
| string_23 | STRING | — |
| string_24 | STRING | — |
| string_25 | STRING | — |
| string_26 | STRING | — |
| string_27 | STRING | — |
| string_28 | STRING | — |
| string_29 | STRING | — |
| string_30 | STRING | — |
| string_31 | STRING | — |
| string_32 | STRING | — |
| string_33 | STRING | — |
| string_34 | STRING | — |
| string_35 | STRING | — |
| string_36 | STRING | — |
| string_37 | STRING | — |
| string_38 | STRING | — |
| string_39 | STRING | — |
| string_40 | STRING | — |
| string_41 | STRING | — |
| string_42 | STRING | — |
| string_43 | STRING | — |
| string_44 | STRING | — |
| string_45 | STRING | — |
| string_46 | STRING | — |
| string_47 | STRING | — |
| string_48 | STRING | — |
| string_49 | STRING | — |
| string_50 | STRING | — |