Text Batch
Batch prompts from a box or a file
- prompt
- status
- current_index
- total
- completed
Text Batch is the beefed-up cousin of Text Queue Processor. Same core job - feed ComfyUI a list of prompts and let it run through them one generation at a time - but with two upgrades that matter once your prompt list stops being three lines in a text box: it can read from a file, and it uses a block separator so a single "prompt" can span multiple lines.
That second part is the reason to pick this one. Plenty of good prompts are paragraphs, or have line breaks baked in. With a plain newline split, every line becomes its own generation and your carefully structured prompt gets shredded. Text Batch defaults its separator to ---, so you write each full prompt as a block and put a --- between blocks. Now a prompt can be as long and multi-line as you want.
How it works
Like the rest of aidec's queue nodes, it leans on a server-side counter instead of a real loop. Each time the workflow runs it emits the block at current_index, then advances. It's an output node, so it re-queues itself and marches through the whole list unattended. The difference from the plain queue processor is auto_stop - when it reaches the end it halts cleanly on its own rather than depending on something downstream to notice completed.
The inputs that matter
- input_mode -
textto type your prompts into the node, orfileto point it at a.txton disk. File mode is the one you'll want once the list gets long or you're generating prompts elsewhere. - text_file - the path, when you're in file mode.
- input_text - the multiline box, when you're in text mode.
- separator_type / separator -
newlinefor one-line-per-prompt, or leave it as-is withseparatorset to---for multi-line blocks. This is the headline feature; use it. - start_index - where the walk begins (0 normally).
- auto_stop - leave it on so the batch ends itself.
The main output is prompt - note it's named prompt, not text like the queue processor - which you wire into CLIP Text Encode. Alongside it you get current_index, total, completed, and status. Route current_index into a filename or seed so your outputs stay traceable to the list.
Installing it
cd ComfyUI/custom_nodes && git clone https://github.com/aidec/Comfyui_TextBatch_aidec, then restart ComfyUI. (Or ComfyUI Manager → Install via Git URL with that repo link.) Nothing to download beyond the code itself - no models, no extra Python packages - and it shows up under the TextBatch category.
Where people get burned
- Separator mismatch. If your file uses blank lines between prompts but the node is set to split on
---, you'll get one giant "prompt." Match the separator to how your file is actually written - that's the single most common way this goes sideways. - File paths. In file mode, give it a real, absolute path the ComfyUI process can read. A relative path or a typo'd folder just yields an empty batch. On a hosted/serverless ComfyUI, "on disk" means the server's disk, not your laptop's.
start_indexis sticky. After a full run, reset it to 0 before going again. It doesn't rewind on its own.- One tab at a time. The counter is shared server state across the whole ComfyUI instance, so don't run this batch alongside another queue in a second window - they'll corrupt each other's position.
If Text Queue Processor felt too limited the moment your prompts got longer than a line, this is the one you actually wanted.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| input_mode | COMBO | text | 2 options: text, file |
| text_file | STRING | Enter the path to your text file here | — |
| input_text | STRING | Enter your text here... | — |
| separator_type | COMBO | newline | 2 options: newline, custom |
| separator | STRING | --- | — |
| start_index | INT | 00–10000 | — |
| auto_stop | BOOLEAN | true | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| status | STRING | — |
| current_index | INT | — |
| total | INT | — |
| completed | BOOLEAN | — |