Nodes/CRT-Nodes/File Batch Prompt Scheduler (CRT)
ComfyUI Node

File Batch Prompt Scheduler (CRT)

Run a folder of text prompts as a batch, and get the conditioning out

By PGCRT·Created 2 years ago·Updated 2 days ago· 132
File Batch Prompt Scheduler (CRT)
  • clip
  • conditioning
  • batch_count
  • prompts_text
folder_path
batch_count1
seed0
file_extension.txt
max_words0
crawl_subfoldersfalse
print_indextrue
Batch Randomizefalse

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 .txt files 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 - an INT mirroring the count, useful if you're chaining to a KSampler that needs the number explicitly.
  • prompts_text - the raw prompt text as a STRING, 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.

CategoryCRT/Conditioning

Inputs (9)

NameTypeDefaultDescription
clipCLIP
folder_pathSTRING
batch_countINT11–64
seedINT00–18446744073709550000
file_extensionSTRING.txt
max_wordsINT0
crawl_subfoldersBOOLEANfalse
print_indexBOOLEANtrue
Batch RandomizeoptBOOLEANfalseShuffle 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)

NameTypeDescription
conditioningCONDITIONING
batch_countINT
prompts_textSTRING