通用图像生成(文生图)@炮老师的小课堂
Point it at a relay, a reseller, or the official endpoint
- 🖼️ 图像
- ℹ️ 信息
- 📄 原始JSON
Here's a genuinely useful ComfyUI trick: a lot of image APIs - GPT Image, DALL·E, and every reseller that mirrors them - speak the same OpenAI POST /images/generations dialect. One well-built node can drive all of them. DapaoUniversalTextToImageNode ("通用图像生成(文生图)@炮老师的小课堂") is that node. It's the text-to-image half of the pack's universal pair, and unlike the pack's Seedream/Seedance nodes it doesn't hard-code any vendor: you give it a URL, a key, and a model name, and it does an OpenAI-compatible generations call.
What you set
The required inputs are the whole point:
- 📝 提示词 - the prompt.
- 🌐 API地址 - defaults to
https://api.openai.com/v1/images/generations, but this is a free-form string. Point it at gptbest-style relays, official Gemini image endpoints, or any compatible service. - 🔑 API密钥 and 🤖 模型ID - default
gpt-image-1, change to whatever the endpoint expects. - 📐 图片尺寸 - presets (1024x1024, 1024x1536, 1536x1024, 512x512, 768x768) or 自定义 for the width/height fields (64–4096, step 64).
- 📸 出图数量 - 1–4.
- 📦 返回格式 -
url(default) orb64_json.
Optional: 📋 额外Body字段 (a JSON blob merged into the request body - this is how you pass vendor-specific params the node doesn't have fields for) and ⏱️ 超时时间.
Outputs are 🖼️ 图像 (IMAGE - decoded and dropped back into the graph), ℹ️ 信息, and 📄 原始JSON.
Why this matters
The official ComfyUI Partner Nodes are a vetted, prepaid-credit storefront over the same closed models - that's the safe path. This node exists for the other 90% of the ecosystem: the resellers and relays that undercut official pricing, unlock regions, or simplify billing. That's genuinely valuable, and it's also the exact thing the KB's external-API essay warns about - a node that holds your key and calls the network by design is the shape of the category that already shipped malware once. So the two rules are: know who you're pointing at, and don't put a key in a relay you don't trust with both it and your images. The node itself is thin, open, and does what it says.
Install
cd ComfyUI/custom_nodes/
git clone https://github.com/paolaoshi/ComfyUI-dapaoAPI.git
cd ComfyUI-dapaoAPI
pip install -r requirements.txt
Restart. No downloads, no models - the "setup" is deciding which endpoint you're targeting.
Common failure: defaulting to gpt-image-1 on an endpoint that doesn't carry it, then blaming the node. Check the vendor's model ID, and if a call returns JSON that isn't an image, look at the 原始JSON output - it will tell you what the API actually complained about. One more note: this node's sibling (通用图像生成(图像编辑) for /images/edits) covers the edit path, so if you're building a multi-vendor image setup, the pair together handles both sides of the API.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| 📝 提示词 | STRING | 一只可爱的小猫,坐在窗台上,阳光洒在它身上,高清摄影 | — |
| 🌐 API地址 | STRING | https://api.openai.com/v1/images/generations | — |
| 🔑 API密钥 | STRING | — | |
| 🤖 模型ID | STRING | gpt-image-1 | — |
| 📐 图片尺寸 | 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 |
| 📋 额外Body字段opt | STRING | {} | — |
| ⏱️ 超时时间opt | INT | 18010–600 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| 🖼️ 图像 | IMAGE | — |
| ℹ️ 信息 | STRING | — |
| 📄 原始JSON | STRING | — |