๐ Folder Text Loader
Load every prompt in a folder as a list โ the lazy way to batch-iterate prompts
- text
- filename
You've got fifty .txt files, each holding a prompt, and you want to run all fifty through the same generation pipeline. The naive way is a text file with one prompt per line plus a big-batch node - but then every variation shares a single giant batch and you can't do per-prompt anything. ๐ Folder Text Loader does the list version: every .txt in a folder becomes one entry in an output list, and ComfyUI runs the downstream graph once per entry, in filename order.
It's the text sibling of the pack's Folder Image Loader, and it inherits the same design philosophy: list output, native per-item execution, no manual looping. If you've ever written a script just to feed prompts into ComfyUI one at a time, this node is that script, in node form.
What it gives you
Two outputs, both lists, aligned by index:
text- the file contents, one per.txtfile in the folder. This wires straight into a CLIP Text Encode, a prompt-enhancer, or this pack's Ideogram4 Text Encode.filename- the base filename, so you can know which prompt is currently being processed and - the useful part - feed it to Batch Image Saver'sๅๆไปถๅto name each output after its source prompt. One wire and your batch outputs are automatically labeledlake_at_dusk.png,cyberpunk_alley.png, instead ofimg_00007.png.
Like its image sibling, it hashes filenames plus modification times so new or edited .txt files re-trigger execution. Drop a file in the folder, hit run, it's picked up. Delete one, it's dropped.
The workflow shape
The cleanest setup: a folder of prompts, Folder Text Loader โ text encoder โ sampler โ Batch Image Saver with ๅๆไปถๅ connected. That's a complete "iterate over a folder of prompts, save each result named after its prompt" pipeline with four nodes and zero scripting. Toss in a folder of reference images via Folder Image Loader and you're building a mini prompt-to-image dataset runner.
Installing it
Part of the Louis Use pack:
cd ComfyUI/custom_nodes
git clone https://github.com/LouisLU1997/ComfyUI-louis-use Louis_use
Or "Louis Use" in ComfyUI Manager, then restart. No extra dependencies.
What to watch
- Only
.txtfiles are read - the folder's other files are ignored, so keeping prompts in a dedicated folder avoids surprises. - Empty folder โ error. Like its sibling, no text files means a ValueError. Don't point it at an empty directory.
- List semantics downstream. The
textoutput is a list, which means each item runs through the graph as a separate execution. Nodes that can't handle list inputs will complain - that's the list mode working, not a bug. - File order = filename order. Sorted by name, so number your files if order matters (
001_...,002_...).
For prompt sweeps, A/B testing variations, or regenerating a set of named outputs, this is one of those nodes you install once and end up using more than you expected.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | โ |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | STRING | โ |
| filename | STRING | โ |