File Batch Prompt Scheduler (CRT)
Run a folder of text prompts as a batch, and get the conditioning out
- clip
- conditioning
- batch_count
- prompts_text
Batching in ComfyUI is usually one prompt repeated N times, or a hardcoded list you edit in the node. If your prompts live in a folder - one per line, one per file, a pile of variations you keep in a text editor - CRT_FileBatchPromptScheduler is the node that turns that folder into a real batch run. It reads .txt files, encodes each prompt through your CLIP, and hands you the conditioning plus the count, so the rest of your graph runs once per prompt.
How it works
Point it at a folder, give it a clip, and it crawls the text files (optionally into subfolders), sorts them with natural ordering - prompt2.txt comes before prompt10.txt, not after - and cycles through them as the batch dimension. The selection is seed-driven: a consistent seed picks a consistent window, so incrementing the seed walks through your prompt list in a predictable order. There's also a shuffle mode you can enable for each run: it randomizes without repeats across incrementing seeds, so every prompt appears once before a new shuffled cycle starts - and no state is cached on disk between runs.
The inputs you'll actually set
folder_path- where the.txtfiles live.clip- your CLIP model, used to encode each prompt.batch_count- how many prompts to pull per run (1–64).seed- controls which slice of the file list you get. Increment to advance through variations.file_extension- default.txt.max_words- trims each prompt to the first N words.0(default) means "use the whole prompt." Handy for coarse sweeps where you only care about the leading subject.crawl_subfolders- recurse into subdirectories when looking for prompt files.print_index- logs which file index each batch item used; leave it on until you trust the ordering.
The three outputs
conditioning- the encoded batch, straight into your sampler.batch_count- anINTmirroring the count, useful if you're chaining to a KSampler that needs the number explicitly.prompts_text- the raw prompt text as aSTRING, handy for echoing into an overlay node or logging which prompt produced which image.
Where it shines and where it bites
This is a genuinely useful production tool: a folder of prompts you can edit in any editor, version-control, or generate with a script, and ComfyUI just executes it. The trap is the empty folder - with no .txt files it returns nothing and you'll chase a confusing graph error before you realize the path was wrong. Also, it's a scheduler, not a progress-keeper: it selects a window based on the seed, so "resume where I left off" means "bump the seed," not "the node remembers."
Install via ComfyUI Manager (CRT-Nodes) or git clone https://github.com/plugcrypt/CRT-Nodes.git into custom_nodes, install requirements.txt, restart.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| folder_path | STRING | — | |
| batch_count | INT | 11–64 | — |
| seed | INT | 00–18446744073709550000 | — |
| file_extension | STRING | .txt | — |
| max_words | INT | 0 | — |
| crawl_subfolders | BOOLEAN | false | — |
| print_index | BOOLEAN | true | — |
| Batch Randomizeopt | BOOLEAN | false | Shuffle without repeats across incrementing seeds. Every file is presented once before a new shuffled cycle begins. No cache is stored. Disabled keeps consecutive selection. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| conditioning | CONDITIONING | — |
| batch_count | INT | — |
| prompts_text | STRING | — |