通用图像生成(图像编辑)@炮老师的小课堂
One node for every OpenAI-compatible /images/edits API, with multi-image support
- 🖼️ 图像1
- 🖼️ 图像2
- 🖼️ 图像3
- 🖼️ 图像4
- 🖼️ 图像
- ℹ️ 信息
- 📄 原始JSON
This is the editing counterpart to the pack's universal text-to-image node, and the two are designed to be used as a pair. DapaoUniversalImageEditNode ("通用图像生成(图像编辑)@炮老师的小课堂") speaks the OpenAI POST /images/edits dialect: you feed it images, a prompt, and an endpoint, and it posts the lot as a multipart request, then decodes the returned image back into the graph. Same idea as its sibling, but built for the edit side of the API - and it's the node you reach for when you want GPT Image 2-style "change this, keep that" editing without being locked into one vendor's UI.
Inputs that matter
- 📝 编辑提示词 - the edit instruction. Default is a generic "edit based on the input, keep the subject clear, improve quality," so you'll want to replace it.
- 🖼️ 图像1 - required, the primary image being edited. 图像2 / 3 / 4 are optional additional references (the pack's README shows multi-image Nano Banana editing through exactly this kind of node).
- 🌐 API地址 - defaults to
https://api.openai.com/v1/images/edits; swap for any compatible relay. - 🤖 模型ID - default
gpt-image-2. - 📐 图片尺寸 - presets or 自定义 (width/height 64–4096, step 64).
- 📸 出图数量 - 1–4.
- 📦 返回格式 -
urlorb64_json.
The optional 📋 额外Body字段 JSON is where you smuggle in vendor-specific parameters, and ⏱️ 超时时间 (default 180s) handles slow relays. Outputs: 🖼️ 图像 (IMAGE), ℹ️ 信息, 📄 原始JSON.
The honest framing
Same story as its sibling, so I'll keep this short. This node's entire value is that it's unopinionated: one UI, any /images/edits endpoint. That's fantastic when you're A/B-testing resellers for price or region access, and it's the reason the pack's README demonstrates it against both official and third-party APIs. It's also the node to be careful with, because "paste any API address and key" is exactly the convenience a malicious relay would love. Two ground rules: verify the endpoint you're pointing at before you paste a key into it, and check the 原始JSON output first when something fails - most "the node is broken" reports turn out to be "the API refused the image size / format / model name," and the raw response says which.
Install
cd ComfyUI/custom_nodes/
git clone https://github.com/paolaoshi/ComfyUI-dapaoAPI.git
cd ComfyUI-dapaoAPI
pip install -r requirements.txt
Restart ComfyUI and it's under the dapaoAPI menu. No model files, no extra deps beyond the pack's requirements.txt (requests, Pillow, torch, numpy).
One size nitpick worth knowing: the image you feed should roughly match the requested size or the API will reject it - 1024x1024 default with a 1536-wide source is a classic 400. Downscale the input first if in doubt. Otherwise, this is the rare utility node that does exactly one thing and lets you decide who's behind it.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| 📝 编辑提示词 | STRING | 请根据输入图片进行编辑,保持主体清晰,提升画面质量 | — |
| 🌐 API地址 | STRING | https://api.openai.com/v1/images/edits | — |
| 🔑 API密钥 | STRING | — | |
| 🤖 模型ID | STRING | gpt-image-2 | — |
| 🖼️ 图像1 | IMAGE | — | |
| 📐 图片尺寸 | COMBO | 1024x1024 | 6 options: 1024x1024, 1024x1536, 1536x1024, 512x512, 768x768, 自定义 |
| ◀️ 自定义宽度 | INT | 102464–4096 | — |
| ▲ 自定义高度 | INT | 102464–4096 | — |
| 📸 出图数量 | INT | 11–4 | — |
| 📦 返回格式 | COMBO | url | 2 options: url, b64_json |
| 🖼️ 图像2opt | IMAGE | — | |
| 🖼️ 图像3opt | IMAGE | — | |
| 🖼️ 图像4opt | IMAGE | — | |
| 📋 额外Body字段opt | STRING | {} | — |
| ⏱️ 超时时间opt | INT | 18010–600 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| 🖼️ 图像 | IMAGE | — |
| ℹ️ 信息 | STRING | — |
| 📄 原始JSON | STRING | — |