Prompt From Folder
Forty prompts, forty runs, no pasting
- prompt
- file
You already have the prompts. They're in a folder - a text file per idea, one per pose set, one per lighting study, forty of them, written over the last month. What you don't have is a way to run them in ComfyUI without pasting each one into CLIP Text Encode and hitting queue. Core ComfyUI has no node that reads a text file and hands it to a text input. Prompt From Folder is that node, and the reason it's worth the install rather than a five-line custom node of your own is the display: it tells you how many prompts are in the folder before you run, and which file it picked after.
It's a different animal from wildcards. The community's usual answer for variety is Impact Pack's __wildcard__ files and inline {a|b|c} syntax, which a great many workflows quietly depend on - but that's variation inside one prompt. Here it's one file, one complete prompt, no interpolation, and you can see which file produced the image in front of you.
How it works
The node scans ComfyUI/input/prompts/ (created on first load) and uses that scan for two things: it fills the folder dropdown, and it's the only source of acceptable folder names. A value that isn't in its own list is rejected, so ../ and /etc never reach the filesystem at all.
Picking is arithmetic, not magic. In sequence mode the index is seed % number_of_files; in random it's Python's random.Random(seed), so the same seed always lands on the same file. Files sort naturally, which is why 2.txt comes before 10.txt - number your files and the order is yours. Reads are UTF-8, whitespace-stripped, capped at 256 KB, opened without following a symlink or blocking on a FIFO.
Because it fingerprints the candidate files (name, mtime, size) rather than just its inputs, editing a prompt .txt re-runs the node even with a fixed seed - a deliberate bypass of ComfyUI's output cache, the same family as the NaN fingerprint from the plumbing layer. Edit, queue, see the new text.
Under the hood it's built on ComfyUI's V3 node API (comfy_entrypoint + get_node_list, no NODE_CLASS_MAPPINGS), which is a real constraint: you need ComfyUI 0.3.48 or later. The author developed it on v0.37.0.
Inputs and outputs
- folder - a folder under
input/prompts/;(root)means that directory itself. Press R in ComfyUI to refresh the list after you add one. A folder only appears if it, or something beneath it, actually holds a.txt. - include_subfolders - off by default. On, it draws from the whole tree below the folder.
- mode -
sequenceorrandom. - seed - the field everyone misreads. In
sequenceit is the position in the list, starting at 0 and wrapping, so with 12 files seed 12 is file 1 again. Inrandomit's the pick, and the same seed always gives you the same file. The control-after-generate dropdown follows the mode by itself:sequencesets it to increment,randomto randomize.
Two outputs. prompt is the file's text - wire it into CLIP Text Encode's text. file is the path relative to input/prompts/, a plain string that's handy on a Note node and awkward as a filename_prefix (you'd get 2.txt_00001_.png).
Install
Manager → search Prompt Folder, or the registry command:
comfy node install comfyui-prompt-folder
Or the manual route, which always works:
cd ComfyUI/custom_nodes
git clone https://github.com/nzkritik/comfyui-prompt-folder
Restart ComfyUI. There are no Python dependencies - no requirements.txt, an empty dependency set in pyproject.toml - so there's nothing to install and nothing to conflict with your other packs. Drop .txt files into ComfyUI/input/prompts/<somefolder>/, symlink a collection in if you'd rather keep it elsewhere (symlinked folders are followed, loops skipped), and press R.
Where people get burned
An empty folder is an error, not a no-op. Run it against a folder with no .txt in it and the run fails with No .txt prompt files in .... Same message if your prompts are in a subfolder and include_subfolders is off.
The seed is not your sampler's seed. It picks the file. It does nothing to your image noise. If your plan is a fair comparison across forty prompts, do the opposite of what looks intuitive: fix the sampler seed and let this one walk the list. Change both at once and you're comparing nothing.
Nothing moves the seed for you through the API. The reset-to-first-file on a folder or mode change, and the increment-after-generate, are frontend behaviours. Drive the node headless and you set seed yourself for each request.
The display box isn't saved with the workflow, and it isn't sent with the prompt - so the provenance doesn't survive either. The PNG you post carries the prompt text in its metadata, not the fact that it came from 03_lighting/7.txt.
One for the --listen crowd. Two small routes behind the node let anything that can reach your ComfyUI list folder names under input/prompts/. Nothing outside that tree, but worth knowing.
One trick that isn't in the README: point this at a LoRA dataset folder of 0001.png / 0001.txt caption pairs, fix your sampler seed, and queue the lot - a contact sheet of exactly what your trainer is being taught. The pack's sibling, Prompt To Folder, is the other half; it writes those .txt files for you, so anything an LLM node spits out can come back later as a folder you loop over.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| folder | COMBO | A folder under ComfyUI/input/prompts. Symlinked folders work too. | |
| include_subfolders | BOOLEAN | false | — |
| mode | COMBO | sequence | random: a seeded random pick. sequence: each prompt in file-name order, one per run. |
| seed | INT | 00–18446744073709550000 | Random: the same seed always picks the same prompt. Sequence: the position in the sorted list, so set this to increment to take the next prompt on every run. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| file | STRING | — |