Text Split By Delimiter
Chop one text block into a list of prompts
- STRING
You've got one big text field with a bunch of prompts in it, separated by commas or newlines, and you want them as a list so a batch can run through each one. This node does exactly that split - plus a few slicing controls so you can grab a subset instead of the whole thing. It's the glue between "a text box full of ideas" and "render all of these."
How it works
Give it a text blob and a delimiter, and it cuts the text at every delimiter into separate pieces, handing back a list of strings. So "a cat, a dog, a bird" split on , becomes three list items. The extra parameters let you slice that list - start partway in, skip some, cap the total - without editing the source text.
The inputs that matter
- text - the blob to split. Multiline, so newline-separated lists work fine.
- delimiter - what to cut on. Default is
,(comma). Set it to a newline, a semicolon, or any character your text uses to separate items. This is the one you'll always set to match your data. - max_count - the biggest number of items to return (default 10). Your batch-size cap. If your text has 50 prompts and you only want to render 10, this is where you say so.
- start_index - skip the first N items and start there. Handy for resuming or grabbing a later chunk.
- skip_every - drop items at a regular interval, thinning the list. Leave at 0 to keep everything.
Output is a STRING list - the pieces. Feed it into a batch prompt setup, a loop, or Mixlab's app batch-prompt feature.
Installing it
Get the pack via ComfyUI Manager (search mixlab, install comfyui-mixlab-nodes, restart), or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/shadowcz007/comfyui-mixlab-nodes
then install requirements and restart. No downloads - it's plain string handling.
Common snags
- You get one giant item instead of a list. Your
delimiterdoesn't match what's actually in the text. If your prompts are on separate lines, the delimiter needs to be a newline, not a comma. - Extra blank or whitespace-padded items. Splitting on
,leaves the spaces after each comma attached to the next item ("a cat" vs " a dog"). If a downstream node is fussy, trim the results, or split on,including the space. - Fewer items than you put in. Check
max_count,start_index, andskip_every- any of the three will quietly shrink the list. If you want everything, set max_count high, start_index 0, skip_every 0. - Pairs beautifully with RandomPrompt or an LLM node: generate or collect a pile of prompts as one string, split them here, batch-render them all.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| delimiter | STRING | , | — |
| start_index | INT | 00–1000 | — |
| skip_every | INT | 00–10 | — |
| max_count | INT | 101–1000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |