Boyo Prompt Loop
Batched Prompts From a Text File, Sequenced for Loops
- prompt_config
The one prompt per queue run grind gets old fast. If you've got 20 prompts you want to run through the same workflow, you shouldn't be clicking "Queue" 20 times. BoyoPromptLoop is the front half of a prompt-batching setup: it reads a list of prompts from a .txt file and packages them into a config object that a loop can walk through one at a time. The back half is BoyoPromptInjector, which actually hands each prompt to your sampler on the right iteration.
What it does
It has a text_file dropdown listing the .txt files in the pack's prompts/ folder, and a mode:
sequential- walks the list in order, starting fromstart_seedas an offset and wrapping when it hits the end.random- picks prompts in a seeded, reproducible random order. Samestart_seed, same sequence, every run.single- ignores the file and repeats onesingle_promptfor every pass. Good for a "same prompt, different seed/denoise" sweep.
loop_count (default 5) controls how many prompts get generated into the config. There are also prefix and suffix strings that get wrapped around every prompt - handy for appending a consistent style tag or negative-adjacent context to a list of short prompts.
How it works under the hood
The first time the node loads, it creates the prompts/ folder inside the pack directory and writes a sample_prompts.txt so the dropdown isn't empty. Each line of your file becomes one prompt (blank lines are skipped; empty file falls back to three placeholder prompts). The output is a single PROMPT_LOOP_CONFIG object - not a string. That's important: you can't plug this directly into a text encoder. It's a container you hand to BoyoPromptInjector, which extracts the per-iteration prompt.
# inside ComfyUI/custom_nodes/Boyonodes/prompts/
# one prompt per line:
a cinematic portrait, golden hour
a cinematic portrait, blue hour
a cinematic portrait, rain
Where it fits
This is built for the pack's "bastard loops" - genuine iterative loops around a sampler. Wire prompt_config from this node into BoyoPromptInjector, feed the injector your loop counter, and each loop pass samples a different prompt automatically. Pair it with a folder-based image saver and you've got a batch-run harness without any scripting.
Installing it
Ships with Boyonodes (DragonDiffusionbyBoyo):
cd ComfyUI/custom_nodes
git clone https://github.com/DragonDiffusionbyBoyo/Boyonodes
Restart ComfyUI or install "Boyonodes" via ComfyUI Manager. No extra Python deps for this node.
Gotchas
- The
prompts/folder lives inside the pack directory (custom_nodes/Boyonodes/prompts/), not your ComfyUI root. People look in the wrong place constantly. randommode re-seeds per iteration internally, so it's reproducible but not a true shuffle without replacement - you can get repeats within one batch.- The dropdown refreshes at load time; if you add a file while ComfyUI is running, restart or reload the node.
It's the "list of prompts in, loop-ready config out" piece of the puzzle - boring, but it turns a 20-queue day into one run.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| text_file | COMBO | 1 options: sample_prompts.txt | |
| mode | COMBO | 3 options: sequential, random, single | |
| start_seed | INT | 00–4294967295 | — |
| loop_count | INT | 51–100 | — |
| prefixopt | STRING | — | |
| suffixopt | STRING | — | |
| single_promptopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prompt_config | PROMPT_LOOP_CONFIG | — |