PQ (Batch) / 批量队列
40 different prompts in one queue, one sampler pass
- clip
- positive
- prompt_text_list
PQ (Batch) is the sibling of PQ (Incremental) from the ComfyUI_PromptQueue pack, and it answers a different question. The incremental node runs your prompt list over time, one per click. This one turns the whole list into a single batched generation: type ten prompts, get ten images out of one queue - each image driven by a different prompt, not ten copies of the same one.
If you've ever set a big batch count expecting variety and gotten an army of near-identical images, this is the node that was missing. It's the ComfyUI-native answer to the old A1111 "prompts from file" script.
How it works
Same guts as its sibling: clip in, each line of 多行文本 is assembled with the 全局前缀 → 画师风格提示词 → line → 提示词后缀 chain, encoded via CLIP, and the individual conditionings are padded to the same token length and concatenated along the batch dimension. The KSampler then gets one conditioning whose batch size equals your line count. Set the KSampler's batch_size to the number of prompts and each output image corresponds to one line. If the numbers don't match you'll get mismatches or wasted renders - matching them is the whole game here.
Index setting in batch mode
索引设置 means something slightly different than in the incremental node, because there's no counter to advance:
0(default) - all lines, from the start.5- everything from the 6th line onward (the count is 0-based here, unlike the incremental node's 1-based indexing - a real quirk worth knowing).2,8,35- only those lines, in that order, again 0-based.
So "start from X" and "just these ones" both work, as long as you remember the 0-based counting. Handy when your file has 200 prompts and you only want to render the tail of it.
Outputs: positive CONDITIONING into the KSampler and prompt_text_list - a STRING of the selected prompts, newline-separated, for a ShowText node if you want to confirm which lines actually made it into the batch.
Presets and files
The full batch node keeps the whole preset system: 预设模板 applies a template (Pony, Nova, NoobAI, Nai4-hot, Realistic…), and 保存预设名称 / 保存预设 / 删除预设 let you save your own prefix+{p}+suffix combos to _prompt_queue_state/presets.json. Same as the incremental node: after saving or deleting a preset, run the workflow once, then refresh the browser or the dropdown won't update. And 使用文件 / 提示词文件夹 / 文件名 pull the list from a .txt (extension auto-appended), which is the realistic use for anything long enough to need a batch node.
Install
Pure Python, zero extra dependencies - just torch, which you already have.
cd ComfyUI/custom_nodes
git clone https://github.com/cyan9977/ComfyUI_PromptQueue.git
Restart, then look for PQ (Batch) / 批量队列 under the PromptQueue category. A couple of notes: parameter labels are Chinese-only, and this is a batch-dimension node, so if you were planning to also loop seeds inside the queue, you'll want to do that by stacking an incremental node instead - batch mode is "one pass, many prompts," not "many passes."
If you only ever render one prompt at a time, the incremental version is the one you want; reach for this when the goal is throughput on a fixed list.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| 全局前缀 | STRING | — | |
| 画师风格提示词 | STRING | — | |
| 多行文本 | STRING | A cat A dog | — |
| 提示词后缀 | STRING | — | |
| 使用文件 | BOOLEAN | false | — |
| 提示词文件夹 | STRING | — | |
| 文件名 | STRING | — | |
| 索引设置 | STRING | 0 | — |
| 预设模板 | 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_list | STRING | — |