💓Llama批量提示词@炮老师的小课堂
Batch image prompting that actually keeps the groups straight
- 🖼️A组图像
- 🖼️B组图像
- 🖼️C组图像
- 🖼️D组图像
- 📝 提示词列表
- 📄 完整响应
- ℹ️ 处理信息
Dapao_LlamaBatchPrompt is the pack's answer to a boring-but-real problem: you've got a folder of images and you need one prompt per image, all generated by a local model, without babysitting it. It's the same llama.cpp/GGUF inference core as the pack's chat node, but reorganized around bulk work. Feed it up to four aligned image groups (A/B/C/D), tell it what to do, and it walks the batch and hands you a list of prompts plus diagnostics.
The "对齐" (alignment) thing is the interesting part. The A/B/C/D groups are meant to be corresponding - A is the main image, B/C/D are supporting views or references for the same item. The node matches them by index, so image 3 in group A gets reasoned about together with image 3 in groups B/C/D, and the system prompt drives a per-item prompt. If your folders are ragged, a 🧩缺失处理策略 dropdown picks the behavior: strict error, reuse the single image, pad to the longest group, or ignore missing groups.
The three modes hiding in here
- With images: the A/B/C/D folder paths (or
🖼️A组图像…🖼️D组图像IMAGE inputs) drive the batch.🛡️多图模式最大提示词数量and🚦多图推理模式(逐条推理 vs 单次批量请求) control whether each item is one inference or many images packed into one call. - No images:
🔢无图默认数量lets it generate N prompts from pure text. That's a freebie - a local batch text-to-prompt expander. - The retry logic:
🛟失败重试次数(0–5) and🧪推理失败策略(失败占位继续 / 跳过失败继续 / 任一失败中断). If you're batch-running 200 items overnight, "占位继续" keeps the list index-aligned even when a call dies, so the output list still lines up with your inputs. That's the detail that makes this node production-usable instead of demo-ware.
Inputs and outputs that matter
The 📝系统提示词 default is a real meta-prompt ("你是专业的批量图像编辑提示词专家…") and 🧾元指令 is the per-item instruction - both editable, both the key to making output match your base model's prompt style. 📏图像最大边长 (default 1024), 🎲随机种子, 🌡️温度 (0.7), 🔁重复惩罚 (1.1), 🧠思考模式 and the Qwen3.8推理强度 control all carry over from the chat core.
Outputs are 📝提示词列表 (a STRING list - wire it to a batch text node or splitter), 📄完整响应, and ℹ️处理信息 (the diagnostic output that tells you what got aligned, reused, skipped, or failed).
Where people get burned
The alignment strictness. If groups A/B/C/D have different file counts and you left the strategy on 严格报错, the node will refuse to run - that's not a bug, that's the safety net. Set the strategy deliberately, and know that "单图复用" means every item in the short group gets the same supporting image, which is fine for style refs and wrong for per-item identity refs.
Installing it
Same pack, one install covers everything:
cd ComfyUI/custom_nodes
git clone https://github.com/paolaoshi/ComfyUI-llama_Dapao
then pip install -r requirements.txt and restart. The recurring pack gotcha applies: llama-cpp-python is pinned to the JamePeng fork at 0.3.47+ (stock PyPI 0.3.35 chokes on Qwen3.8 GGUFs with missing tensor 'blk.64.ssm_conv1d.weight'), and NVIDIA users should overlay a matching GPU wheel from the JamePeng releases. Models live in ComfyUI/models/LLM/. For a vision batch you'll also want the mmproj matching your model - without it, only the no-image mode will work.
Inputs (33)
| Name | Type | Default | Description |
|---|---|---|---|
| 🤖模型文件 | COMBO | 0 options: | |
| 🔌对话处理器 | COMBO | None | 22 options: None, LLaVA-1.5, LLaVA-1.6, Moondream2, nanoLLaVA, llama3-Vision-Alpha, +16 |
| 🖼️mmproj文件 | COMBO | None | 1 options: None |
| 📐上下文长度 | INT | 8192512–131072 | — |
| 💾显存限制(GB) | FLOAT | -1.0-1–999 | — |
| 🔢图像最小token | INT | 2561–4096 | — |
| 🔢图像最大token | INT | 13441–8192 | — |
| 📝系统提示词 | STRING | 你是一个专业的批量图像编辑提示词专家。你会严格根据每一组已对齐图片和用户元指令,为当前编号图片生成一个专属提示词。 | — |
| 🧾元指令 | STRING | 请根据当前组图片生成一个适合下游图像生成/图像编辑模型使用的最终提示词。 要求: 1. 只输出当前这一项的最终提示词文本。 2. 不输出编号、标题、Markdown、JSON、解释、寒暄或多余前后缀。 3. 必须保持与当前 A 图一一对应,不要描述其他编号图片。 4. 如果有 B/C/D 图,请按它们的角色说明理解并融合。 | — |
| 📂A组文件夹 | STRING | — | |
| 📂B组文件夹 | STRING | — | |
| 📂C组文件夹 | STRING | — | |
| 📂D组文件夹 | STRING | — | |
| 🧩缺失处理策略 | COMBO | 严格报错 | 4 options: 严格报错, 单图复用, 末张补齐, 忽略缺失组 |
| 🔢无图默认数量 | INT | 11–100 | — |
| 🛡️多图模式最大提示词数量 | INT | 00–10000 | — |
| 🚦多图推理模式 | COMBO | 逐条推理 | 2 options: 逐条推理, 单次批量请求 |
| 🛟失败重试次数 | INT | 00–5 | — |
| 🧪推理失败策略 | COMBO | 失败占位继续 | 3 options: 失败占位继续, 跳过失败继续, 任一失败中断 |
| 📏图像最大边长 | INT | 102464–4096 | — |
| 🎲随机种子 | INT | 00–18446744073709550000 | — |
| 📊最大输出token | INT | 10241–32768 | — |
| 🌡️温度 | FLOAT | 0.700–2 | — |
| 🎯top_p | FLOAT | 0.900–1 | — |
| 🔝top_k | INT | 400–200 | — |
| 🔁重复惩罚 | FLOAT | 1.100–2 | — |
| 🧠思考模式 | BOOLEAN | false | — |
| 🧠Qwen3.8推理强度 | COMBO | 关闭 | 仅 Qwen3.8 生效;关闭=不思考,自动/高=模型最高档,低/中等=降低思考强度。 |
| ⚡推理后卸载模型 | BOOLEAN | false | — |
| 🖼️A组图像opt | IMAGE | — | |
| 🖼️B组图像opt | IMAGE | — | |
| 🖼️C组图像opt | IMAGE | — | |
| 🖼️D组图像opt | IMAGE | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| 📝 提示词列表 | STRING | — |
| 📄 完整响应 | STRING | — |
| ℹ️ 处理信息 | STRING | — |