Nodes/CRT-Nodes/Text Loader Crawl Batch (CRT)
ComfyUI Node

Text Loader Crawl Batch (CRT)

Run a whole folder of prompts without retyping a thing

By PGCRT·Created 2 years ago·Updated a day ago· 132
Text Loader Crawl Batch (CRT)
    • text_output_1
    folder_path
    batch_count1
    seed0
    file_extension.txt
    max_words0
    crawl_subfoldersfalse

    Prompt batching is one of those things everyone eventually hacks together - a text file per prompt, a load node, a counter - and Text Loader Crawl Batch (CRT) is the version where the scaffolding is already built. It grabs a batch of .txt files from a folder in one run and hands them to your graph as strings. If you've got a folder of 50 prompts and you want 50 renders without babysitting the UI, this is the node you reach for.

    Like the other "Crawl" loaders in CRT-Nodes, it's folder-driven and seed-indexed. The workflow pattern: bump a seed, the node steps through your files, your sampler renders, a save node writes the result. Rinse, repeat, come back to a finished folder.

    How it works

    The node scans folder_path, filters by file_extension, and sorts the results in natural order - so 2.txt sorts before 10.txt, which is exactly what you want when your files are numbered. Then seed acts as an offset into that sorted list, and it reads batch_count files starting there. Set seed to 0 and it starts from the first file; bump seed by batch_count each run to walk the whole folder.

    Its outputs scale with batch_count - one text string per file loaded (the schema lists text_output_1, and more appear as you raise the batch size). Wire those into a positive prompt or a text-conditioning node.

    The inputs you actually set

    • folder_path - absolute path to the folder. The one input you can't skip.
    • batch_count (1–64) - how many files to load per run.
    • seed - the batch offset, not a randomness seed. 0 = start at the first file.
    • file_extension - default .txt; change it if your prompts live in .md or .prompt files.
    • max_words - cap each output at N words (0 = no limit). Handy when you're feeding a prompt budget and want every variant the same length.
    • crawl_subfolders - include files in subdirectories or not.

    Where it earns its keep

    • Long prompt sweeps: hundreds of prompt variants, one node, one seed counter.
    • A/B testing: put each variant in its own file, batch them through the same sampler and LoRA stack.
    • Multi-prompt batch renders: load several prompts at once into a batched workflow and sample them together.

    Gotchas

    • Empty folder or a bad path returns empty strings rather than erroring loudly - your KSampler will happily run on a blank prompt, so spot-check the text outputs if results look off.
    • The seed is an offset, not an index into "the file I want right now." To review file #7 in isolation you'd set seed to 6 (0-based) with batch_count 1.
    • Keep the extensions consistent - a folder mixing .txt and .md files only matches the one you set.

    Install is the shared CRT-Nodes story: ComfyUI Manager → search CRT-Nodes → install, or git clone https://github.com/PGCRT/CRT-Nodes into custom_nodes, then restart. It's a big suite with a heavy dependency list, but it degrades gracefully - if an optional import fails, the pack just skips that node instead of taking down ComfyUI.

    CategoryCRT/Load

    Inputs (6)

    NameTypeDefaultDescription
    folder_pathSTRINGPath to the folder containing the text files
    batch_countINT11–64Number of files to load in the batch
    seedINT00–18446744073709550000Acts as a batch offset. Set to 0 to start from the first file.
    file_extensionSTRING.txtThe file extension to filter for (e.g., .txt)
    max_wordsINT0Maximum number of words per output (0 for no limit)
    crawl_subfoldersBOOLEANfalseWhether to include files in subfolders

    Outputs (1)

    NameTypeDescription
    text_output_1STRING