PQ (Incremental) / 增量队列
Run a whole prompt list overnight — PQ (Incremental) is the queue ComfyUI should have shipped
- clip
- positive
- prompt_text
ComfyUI has no built-in "run these 40 prompts, one per image, and don't make me sit here" mode. People have been asking for the A1111 prompt-queue equivalent since 2023, and the stock answer - a big batch count - only gets you the same prompt many times. PQ (Incremental) from cyan9977's ComfyUI_PromptQueue pack is the fix: it holds a list of prompts, hands them to the sampler one at a time, and remembers where it left off between runs. Set it up before bed, wake up to a finished sequence.
How it works
The node is a CLIP-encoder wrapper with a counter bolted to it. You feed it a clip input, it builds each prompt, encodes it into CONDITIONING, and - here's the trick - it only emits one line per run, advancing a persistent counter stored in custom_nodes/ComfyUI_PromptQueue/_prompt_queue_state/state.json. Run it again and it moves to the next line. Change the prompt list and it detects the change and resets to the top, so appending new lines resumes rather than restarts.
The prompt itself is assembled from four parts joined with commas: 全局前缀 (global prefix, only added if you fill it), 画师风格提示词 (artist/style prefix), the current 多行文本 line, and 提示词后缀 (suffix). That's a nice separation for people who keep their quality tags in one box and their actual ideas in another.
The input that actually matters: 索引设置
Every other field is self-explanatory. 索引设置 is the one to learn, and it's deceptively simple:
-1(or blank, the default) - memory mode. Resume from wherever the counter is. This is the overnight mode.0- reset and start from line 1, incrementing each run. Great for a clean full run.5- run only line 5, no advancing. Use this to debug one prompt in isolation.2,8,35- cycle through only those lines. Pick your favorites and let it loop.
The other two you'll touch: 使用文件 / 提示词文件夹 / 文件名 let you pull the list from a .txt (one prompt per line, extension added automatically) instead of the text box - handy when the list comes from a spreadsheet. 预设模板 applies a template like Pony (score_9, score_8_up...), NoobAI, or Nai4-hot, with {p} standing in for your line.
Outputs: positive CONDITIONING into the KSampler, and prompt_text - a STRING you can route into a ShowText node to see exactly what got encoded. Do this once; the assembled prompts aren't visible anywhere in the UI otherwise.
Batch-size trick
Because only one prompt comes out per run, you can crank the KSampler's batch_size to 4 and get four images of the same prompt with different seeds - a poor-man's "generate 4, keep the good one." That's the intended error-tolerance workflow and it works well.
Install and gotchas
No dependencies, no model files - it's plain Python on top of your existing torch/CLIP. Install via ComfyUI Manager (search "ComfyUI_PromptQueue"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/cyan9977/ComfyUI_PromptQueue.git
Then restart ComfyUI. Two things that bite people: the node UI is in Chinese (parameter names aren't translated, though display names are bilingual like "PQ (Incremental) / 增量队列"), and after saving or deleting a preset you must run the workflow once and then refresh the browser page before the dropdown updates. If you copy workflows between machines, note the counter lives in state.json and is keyed per node, so a duplicated node resumes its own count.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| 全局前缀 | STRING | — | |
| 画师风格提示词 | STRING | — | |
| 多行文本 | STRING | A cat A dog | — |
| 提示词后缀 | STRING | — | |
| 使用文件 | BOOLEAN | false | — |
| 提示词文件夹 | STRING | — | |
| 文件名 | STRING | — | |
| 索引设置 | STRING | -1 | — |
| 预设模板 | COMBO | None | 11 options: None, Pony, Pony_realistic, Nova, NovaFurry, NoobAI, +5 |
| 保存预设名称 | STRING | — | |
| 保存预设 | BOOLEAN | false | — |
| 删除预设 | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| positive | CONDITIONING | — |
| prompt_text | STRING | — |