Nodes/ComfyUI-llama_Dapao/💓Llama批量提示词@炮老师的小课堂
ComfyUI Node

💓Llama批量提示词@炮老师的小课堂

Batch image prompting that actually keeps the groups straight

By paolaoshi·Created 4 months ago·Updated 2 days ago· 44
💓Llama批量提示词@炮老师的小课堂
  • 🖼️A组图像
  • 🖼️B组图像
  • 🖼️C组图像
  • 🖼️D组图像
  • 📝 提示词列表
  • 📄 完整响应
  • ℹ️ 处理信息
🤖模型文件
🔌对话处理器None
🖼️mmproj文件None
📐上下文长度8192
💾显存限制(GB)-1.0
🔢图像最小token256
🔢图像最大token1344
📝系统提示词你是一个专业的批量图像编辑提示词专家。你会严格根据每一组已对齐图片和用户元指令,为当前编号图片生成一个专属提示词。
🧾元指令请根据当前组图片生成一个适合下游图像生成/图像编辑模型使用的最终提示词。 要求: 1. 只输出当前这一项的最终提示词文本。 2. 不输出编号、标题、Markdown、JSON、解释、寒暄或多余前后缀。 3. 必须保持与当前 A 图一一对应,不要描述其他编号图片。 4. 如果有 B/C/D 图,请按它们的角色说明理解并融合。
📂A组文件夹
📂B组文件夹
📂C组文件夹
📂D组文件夹
🧩缺失处理策略严格报错
🔢无图默认数量1
🛡️多图模式最大提示词数量0
🚦多图推理模式逐条推理
🛟失败重试次数0
🧪推理失败策略失败占位继续
📏图像最大边长1024
🎲随机种子0
📊最大输出token1024
🌡️温度0.70
🎯top_p0.90
🔝top_k40
🔁重复惩罚1.10
🧠思考模式false
🧠Qwen3.8推理强度关闭
⚡推理后卸载模型false

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.

Category🍭大炮-llama-cpp

Inputs (33)

NameTypeDefaultDescription
🤖模型文件COMBO0 options:
🔌对话处理器COMBONone22 options: None, LLaVA-1.5, LLaVA-1.6, Moondream2, nanoLLaVA, llama3-Vision-Alpha, +16
🖼️mmproj文件COMBONone1 options: None
📐上下文长度INT8192512–131072
💾显存限制(GB)FLOAT-1.0-1–999
🔢图像最小tokenINT2561–4096
🔢图像最大tokenINT13441–8192
📝系统提示词STRING你是一个专业的批量图像编辑提示词专家。你会严格根据每一组已对齐图片和用户元指令,为当前编号图片生成一个专属提示词。
🧾元指令STRING请根据当前组图片生成一个适合下游图像生成/图像编辑模型使用的最终提示词。 要求: 1. 只输出当前这一项的最终提示词文本。 2. 不输出编号、标题、Markdown、JSON、解释、寒暄或多余前后缀。 3. 必须保持与当前 A 图一一对应,不要描述其他编号图片。 4. 如果有 B/C/D 图,请按它们的角色说明理解并融合。
📂A组文件夹STRING
📂B组文件夹STRING
📂C组文件夹STRING
📂D组文件夹STRING
🧩缺失处理策略COMBO严格报错4 options: 严格报错, 单图复用, 末张补齐, 忽略缺失组
🔢无图默认数量INT11–100
🛡️多图模式最大提示词数量INT00–10000
🚦多图推理模式COMBO逐条推理2 options: 逐条推理, 单次批量请求
🛟失败重试次数INT00–5
🧪推理失败策略COMBO失败占位继续3 options: 失败占位继续, 跳过失败继续, 任一失败中断
📏图像最大边长INT102464–4096
🎲随机种子INT00–18446744073709550000
📊最大输出tokenINT10241–32768
🌡️温度FLOAT0.700–2
🎯top_pFLOAT0.900–1
🔝top_kINT400–200
🔁重复惩罚FLOAT1.100–2
🧠思考模式BOOLEANfalse
🧠Qwen3.8推理强度COMBO关闭仅 Qwen3.8 生效;关闭=不思考,自动/高=模型最高档,低/中等=降低思考强度。
⚡推理后卸载模型BOOLEANfalse
🖼️A组图像optIMAGE
🖼️B组图像optIMAGE
🖼️C组图像optIMAGE
🖼️D组图像optIMAGE

Outputs (3)

NameTypeDescription
📝 提示词列表STRING
📄 完整响应STRING
ℹ️ 处理信息STRING