Nodes/ComfyUI-dapaoAPI/通用图像生成(文生图)@炮老师的小课堂
ComfyUI Node

通用图像生成(文生图)@炮老师的小课堂

Point it at a relay, a reseller, or the official endpoint

By paolaoshi·Created 10 months ago·Updated a day ago· 217
通用图像生成(文生图)@炮老师的小课堂
    • 🖼️ 图像
    • ℹ️ 信息
    • 📄 原始JSON
    📝 提示词一只可爱的小猫,坐在窗台上,阳光洒在它身上,高清摄影
    🌐 API地址https://api.openai.com/v1/images/generations
    🔑 API密钥
    🤖 模型IDgpt-image-1
    📐 图片尺寸1024x1024
    ◀️ 自定义宽度1024
    ▲ 自定义高度1024
    📸 出图数量1
    📦 返回格式url
    📋 额外Body字段{}
    ⏱️ 超时时间180

    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) or b64_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.

    Category🤖dapaoAPI/🔮API通用工具🔮

    Inputs (11)

    NameTypeDefaultDescription
    📝 提示词STRING一只可爱的小猫,坐在窗台上,阳光洒在它身上,高清摄影
    🌐 API地址STRINGhttps://api.openai.com/v1/images/generations
    🔑 API密钥STRING
    🤖 模型IDSTRINGgpt-image-1
    📐 图片尺寸COMBO1024x10246 options: 1024x1024, 1024x1536, 1536x1024, 512x512, 768x768, 自定义
    ◀️ 自定义宽度INT102464–4096
    ▲ 自定义高度INT102464–4096
    📸 出图数量INT11–4
    📦 返回格式COMBOurl2 options: url, b64_json
    📋 额外Body字段optSTRING{}
    ⏱️ 超时时间optINT18010–600

    Outputs (3)

    NameTypeDescription
    🖼️ 图像IMAGE
    ℹ️ 信息STRING
    📄 原始JSONSTRING