Prompt Feeder
Point it at a folder of prompts and walk away
- STRING
You've got a flat file of 80 prompts you scribbled while iterating, and you want one image per prompt - not 80 images of the same paragraph. The usual ComfyUI answer is wildcard syntax ({blonde|brunette}, __wildcard__, the stuff Impact Pack quietly owns), which varies tokens inside one prompt within a single run. Prompt Feeder solves the other problem: one prompt per queued run, so every line is its own job with its own seed and its own output file.
What it actually is
One node that holds a list of prompts and hands you one STRING at a time, plus a browser-side controller that drives the queue while you make coffee. You feed it three ways: type them straight into the node (edit mode), point it at a folder of .txt files and feed those line by line (library mode), or pick one file and loop a line range within it (single_file mode).
How the loop actually works
The node is registered as an output node in the source (OUTPUT_NODE = True) - output nodes are the ones ComfyUI's executor never caches away, so this genuinely runs every time the graph runs. On each run it resolves your list, returns the line at index as a plain string, and pushes a websocket message carrying the next index, whether one exists, and a preview. The bundled frontend JS listens for that: if you've pressed ▶ Run, it writes the next index into the index widget and queues one more job about half a second later.
So the loop lives in the browser and the websocket, not in the backend. Two practical consequences:
- Each iteration is an ordinary one-job queue, so it behaves like you pressing Queue yourself. ComfyUI caches aggressively and works backward from the output nodes, re-running only what changed - text encode, sampler - instead of reloading the checkpoint 80 times.
- Each iteration is a fresh run, so KSampler's
control_after_generateapplies per prompt. Leave it onrandomizeand every prompt gets its own seed - but set "widget control mode" to Before in ComfyUI's settings first, or the seed you see isn't the seed that just ran.
Because the frontend issues the next queue, keep the tab open. Close it mid-loop and the chain stops where it is.
The inputs you'll actually touch
Most of these are mode-dependent - the node dims what doesn't apply, and values survive a mode switch.
mode-edit,library, orsingle_file. Everything downstream depends on this one.text- your prompts, one per line, empty lines ignored. Onlyeditmode.directory+source_root- which subfolder inside your data source to read.source_rootstarts asprompt-feeder-dataand gains an entry for every external path you register.file- one filename (e.g.hero.txt). Its tooltip is the map:start_index/end_indexthen select a line range inside that one file.sort_mode-ascending,descending, orrandom. Random is reproducible viaseed, and file names sort naturally, soa10.txtlands aftera9.txt.index,start_index,end_index,seed,use_selection,selected_files- mostly automation real estate. Run resetsindexto 0 and advances it for you.end_index = 0means "to the end."
Output is a single STRING: wire it into CLIP Text Encode's text box.
Install
Manager → search "Prompt Feeder", or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/ketle-man/comfyui-prompt-feeder
# keep the folder name as comfyui-prompt-feeder
# restart ComfyUI
There are no pip dependencies and no models - the pyproject.toml declares none, and the code uses only what ComfyUI already ships (folder_paths, server.PromptServer). In a category where installing anything usually means a dependency conflict, that's the nicest thing about this pack.
Prompts live here, and folders inside it work fine:
ComfyUI/user/default/prompt-feeder-data/
├── character/
│ ├── eyes.txt
│ └── hair.txt
└── sample.txt
Files must be UTF-8, .txt, and 100KB or smaller. The library UI (📂 Lib) browses and edits them, and its ⚙ button registers other packs' text folders as read-only sources - path traversal is blocked and symlinks are skipped.
Where people get burned
The one that catches everyone: in library mode, start_index/end_index count files, not lines. Two files of three lines each with start_index=1 means "start at the second file," i.e. the fourth prompt overall. In single_file mode those same fields become a line range. The preview counter (2 / 6) is your ground truth for how many prompts the node thinks it has.
Smaller stuff: blank-only text in edit mode errors out rather than producing nothing, and a freshly registered external path sometimes won't show up in the source_root dropdown until you reload the page.
Should you reach for it
Honest framing: this is a small hobby pack with essentially no community footprint - no Reddit threads, nobody to ask. What you get in exchange is ~700 lines of readable MIT Python, zero dependencies, and a UI more thought-out than most one-person packs. If your job is "run this list of prompts overnight," reach for it. If your job is "vary a word inside one prompt," reach for wildcards instead.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | 3 options: edit, library, single_file | |
| text | STRING | One prompt per line. Empty lines are skipped. | |
| source_root | COMBO | prompt-feeder-data | Data source. Registered external paths (via the library's ⚙ Settings) are read-only (for reusing existing prompt/wildcard .txt files from other node packs). |
| directory | STRING | Subfolder name within the selected source_root. Leave empty to use its root directory. | |
| sort_mode | COMBO | 3 options: ascending, descending, random | |
| index | INT | 00–18446744073709550000 | — |
| start_index | INT | 00–18446744073709550000 | — |
| end_index | INT | 00–18446744073709550000 | — |
| seed | INT | 00–18446744073709550000 | — |
| use_selection | BOOLEAN | true | — |
| selected_files | STRING | [] | — |
| file | STRING | Filename (e.g. hero.txt) within the directory above. Used in single_file mode; start_index/end_index then select a line range within this file. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |