Nodes/ComfyUI-dapaoAPI/🐠RH批量LLM提示词@炮老师的小课堂
ComfyUI Node

🐠RH批量LLM提示词@炮老师的小课堂

A/B/C/D image groups, one aligned prompt per image — RH's batch LLM writer

By paolaoshi·Created 10 months ago·Updated a day ago· 217
🐠RH批量LLM提示词@炮老师的小课堂
  • 🖼️ A组图像
  • 🖼️ B组图像
  • 🖼️ C组图像
  • 🖼️ D组图像
  • 📝 提示词列表
  • 📄 完整响应
  • ℹ️ 处理信息
🌐 API渠道国内版
🔑 API密钥
🤖 模型IDgoogle/gemini-3.1-flash-lite-preview
🎯 系统角色你是一个专业的批量图像编辑提示词专家。你会严格根据每一组已对齐图片和用户元指令,为当前编号图片生成一个专属提示词。
🧾 元指令请根据当前组图片生成一个适合下游图像生成/图像编辑模型使用的最终提示词。 要求: 1. 只输出当前这一项的最终提示词文本。 2. 不输出编号、标题、Markdown、JSON、解释、寒暄或多余前后缀。 3. 必须保持与当前 A 图一一对应,不要描述其他编号图片。 4. 如果有 B/C/D 图,请按它们的角色说明理解并融合。
📂 A组文件夹
📂 B组文件夹
📂 C组文件夹
📂 D组文件夹
🧩 缺失处理策略严格报错
🔢 无图默认数量1
🛡️ 多图模式最大提示词数量0
🚦 多图推理模式并发逐条请求
🚀 并发数4
🛟 失败重试次数1
🧪 推理失败策略失败占位继续
🖼️ 发送图片最长边1024
🗜️ 发送图片JPEG质量85
🌡️ 温度0.70
📝 最大输出令牌2048
🎲 Top_P1.00
🧠 推理强度none
🎲 随机种0
⏱️ 超时时间180
➕ 额外参数JSON{}

Here's the workflow this node exists for: you have a folder of reference images and you want an LLM to write one prompt per image for a downstream image generator or editor. Now add the twist that makes it genuinely hard - the reference images come in aligned groups (A/B/C/D), where A is the image you're writing for and B/C/D are the same row's context: the style reference, the product angle, the edited version. DapaoRHBatchLLMPromptNode is the RunningHub-pack node that does exactly this: reads A/B/C/D groups from folders or wired IMAGE inputs, aligns them, and emits a prompt per A-image, with concurrency, retries, and a failure policy so a 200-image batch runs unattended.

The inputs that matter

  • 🌐 API渠道 + 🔑 API密钥 - the RH rule: domestic/international keys don't cross. This node calls the RH LLM endpoint (llm.runninghub.cn), which is separate from the image/video API - so the key is a RunningHub LLM key.
  • 🤖 模型ID - 72 model IDs, default google/gemini-3.1-flash-lite-preview. The flash-lite default is the right call for a job where you want volume, not a flagship's price tag.
  • 🎯 系统角色 - defaults to "you are a professional batch image-editing prompt expert" who strictly writes one prompt per aligned group. This is the prompt-discipline contract; leave it unless you know why.
  • 🧾 元指令 - the meta-instruction block describing what each group's images mean and how to fuse them. The default is well-written - a good template to adapt rather than replace.
  • 📂 A组文件夹 / B组 / C组 / D组文件夹 - read entire folders of images. This is the scale path: point at folders, not individual wires. A/B/C/D组图像 (IMAGE inputs) are the small-scale alternative.
  • 🧩 缺失处理策略 - what happens when groups have unequal lengths (strict error default vs. tolerant fills).
  • 🔢 无图默认数量 - how many items to produce when a group is empty.
  • 🛡️ 多图模式最大提示词数量 - cap on prompts in multi-image mode (0 = no cap).
  • 🚦 多图推理模式 - 并发逐条请求 (concurrent per-item requests, default) vs the serial alternative. 🚀 并发数 - 4 default. 🛟 失败重试次数 - 1. 🧪 推理失败策略 - 失败占位继续 (placeholder-and-continue) default.
  • 🖼️ 发送图片最长边 (1024) and 🗜️ 发送图片JPEG质量 (85) - the compression that keeps token costs sane on image-heavy batches.
  • 🧠 推理强度 - four levels, default none. Some RH LLM models support a reasoning pass; this dials it.
  • Standard 🌡️ 温度 0.7, 📝 最大输出令牌 2048, 🎲 Top_P 1, 🎲 随机种 (cache-only), ⏱️ 超时时间 180, plus ➕ 额外参数JSON.

Outputs

📝 提示词列表 - a list of STRING, one prompt per aligned A-image (this is the deliverable), plus 📄 完整响应 and ℹ️ 处理信息 for auditing.

The honest read

This is a niche-but-real pattern - "aligned image groups → one downstream prompt each" is exactly what you'd hand-build with a loop and a VLM node, and this node packages the alignment, concurrency, retry, and failure policy so you don't have to. The llm-in-comfyui.md framing applies: the LLM is a translation layer between your aligned reference set and the downstream generator, and subject drift is the standing risk - which is why the default 元指令 insists on "only output the current item's prompt, one-to-one with image A." Keep that discipline in whatever you write.

Two cost realities: every item is a separate paid LLM call (72 model IDs means a wide price range - flash-lite exists so you don't pay flagship rates for 500 prompts), and the JPEG/1024 compression is your real money saver on image-heavy batches. Don't crank 发送图片最长边 up and wonder why the bill doubled.

Gotchas

  • Unequal groups - folder lengths that don't match will trip the strict error strategy; set 缺失处理策略 to tolerant if you're running ragged folders.
  • Placeholder-and-continue hides failures - the 提示词列表 will contain placeholder strings; audit 处理信息 before feeding the list downstream.
  • Key mismatch - image/video RH keys vs LLM keys may be different credentials; make sure the key actually has LLM access.
  • Chinese-only labels.

Install: ComfyUI Manager → "dapaoAPI", or git clone https://github.com/paolaoshi/ComfyUI-dapaoAPI.gitpip install -r requirements.txt → restart. RunningHub account + API key required.

Category🤖dapaoAPI/🦄RH功能专区🦄

Inputs (29)

NameTypeDefaultDescription
🌐 API渠道COMBO国内版国内版与国外版使用不同的 API 地址和 API 密钥,请选择与密钥一致的渠道。
🔑 API密钥STRING国内版和国外版密钥不通用。
🤖 模型IDCOMBOgoogle/gemini-3.1-flash-lite-preview复用 RH LLM 模型列表。
🎯 系统角色STRING你是一个专业的批量图像编辑提示词专家。你会严格根据每一组已对齐图片和用户元指令,为当前编号图片生成一个专属提示词。
🧾 元指令STRING请根据当前组图片生成一个适合下游图像生成/图像编辑模型使用的最终提示词。 要求: 1. 只输出当前这一项的最终提示词文本。 2. 不输出编号、标题、Markdown、JSON、解释、寒暄或多余前后缀。 3. 必须保持与当前 A 图一一对应,不要描述其他编号图片。 4. 如果有 B/C/D 图,请按它们的角色说明理解并融合。
📂 A组文件夹STRING
📂 B组文件夹STRING
📂 C组文件夹STRING
📂 D组文件夹STRING
🧩 缺失处理策略COMBO严格报错智能对齐找不到对应图片时的处理方式。默认严格报错,防止错位。
🔢 无图默认数量INT11–100完全没有接入图片/文件夹时使用。若指令里写了 10组/10个/十组,会优先自动识别文本数量。
🛡️ 多图模式最大提示词数量INT00–10000只限制有图/文件夹模式。0 表示不限制;例如填 50 时最多处理 A组前 50 项,避免误传大文件夹消耗大量 token。
🚦 多图推理模式COMBO并发逐条请求并发逐条请求每个任务只发当前配对图,通常更接近单独节点速度;单次批量请求会把所有图片塞进一次请求,图片多时可能很慢。
🚀 并发数INT41–20有图/文件夹模式下同时请求 RH LLM 的任务数量。过高可能触发限流,建议 2-6。
🛟 失败重试次数INT10–5单个图片配对任务失败后的额外重试次数。
🧪 推理失败策略COMBO失败占位继续失败占位继续会保留列表位置;跳过失败继续会减少输出数量;任一失败中断会直接报错。
🖼️ 发送图片最长边INT1024256–4096发送给 LLM 前会等比缩放图片,默认最长边 1024。调小更快更省 token;调大细节更多但更慢。
🗜️ 发送图片JPEG质量INT8540–100发送给 LLM 的 JPEG 压缩质量。默认 85,通常足够做提示词/编辑指令分析。
🌡️ 温度FLOAT0.700–2
📝 最大输出令牌INT20481–65536
🎲 Top_PFLOAT1.000–1
🧠 推理强度COMBOnone4 options: none, low, medium, high
🎲 随机种INT00–18446744073709550000只用于 ComfyUI 缓存控制;不会发送给 RH LLM。
⏱️ 超时时间INT18030–1200
🖼️ A组图像optIMAGE
🖼️ B组图像optIMAGE
🖼️ C组图像optIMAGE
🖼️ D组图像optIMAGE
➕ 额外参数JSONoptSTRING{}JSON对象,会合并到 RH 请求体;同名字段会覆盖节点控件生成的参数。

Outputs (3)

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