Nodes/ComfyUI-AI-CustomURL/Generate Image (AI CustomURL)
ComfyUI Node

Generate Image (AI CustomURL)

Call DALL-E (or any compatible image API) and get a real IMAGE tensor out

By bowtiedbluefin·Created 10 months ago·Updated 10 months ago· 3
Generate Image (AI CustomURL)
    • images
    • urls
    base_urlhttps://api.openai.com/v1
    api_key
    prompt
    modeldall-e-3
    n1
    size1024x1024
    qualitystandard
    stylevivid
    response_formaturl
    advanced_params_json

    ComfyUI's whole identity is local generation - you're the one holding the GPU. But there are images you won't get locally no matter how good your rig is, and this node is the honest admission of that: it hits POST /images/generations on any OpenAI-compatible API and hands you back a real IMAGE tensor that flows through your graph like any locally-generated one. DALL-E 3 by default; swap the base_url and model and it becomes Venice.ai's flux-dev, Together's FLUX, or whatever else exposes the same endpoint shape.

    The neat part isn't the API call - it's the interface. The response image gets downloaded and converted into a standard batch IMAGE, so you can wire the output straight into an upscaler, a detailer, an img2img sampler, or just a preview node. The gap between "closed API result" and "local pipeline" disappears.

    How it works

    The node builds the standard image-generation request: prompt, model, n, size, plus quality, style, and response_format when they differ from defaults. It then iterates over data in the response. With response_format = "url" it downloads each image from its URL; with b64_json it decodes the base64 directly. Both paths land in the same IMAGE batch output, and urls comes back as a newline-joined string of the source URLs (or base64_encoded for the other mode).

    If anything fails - bad key, content filter, dead account - it doesn't crash the graph. You get a blank black 512×512 tensor on images and the error message on urls. That's arguably too forgiving (you may not notice the failure at a glance), but it means a mid-workflow hiccup won't nuke the whole queue.

    The inputs that matter

    • base_url + api_key + model - the trio every node in this pack needs. OpenAI defaults, but this is where you point it at another provider.
    • prompt - the description. This is the thing that actually determines quality; the API's content filter is real, so a rejected prompt shows up as an error rather than an image.
    • size - pick from 1024x1024, 1024x1792, 1792x1024 (DALL-E 3's portrait and landscape), or 512x512/256x256 (which realistically only DALL-E 2 accepts these days).
    • quality (standard/hd) and style (vivid/natural) are DALL-E-specific knobs; n lets you batch up to 10 results into one image batch.

    The optional advanced_params_json merges extra fields into the request - this is how the Image Advanced Parameters node plugs in.

    Installing it

    ComfyUI Manager → search "AI CustomURL" → Install, restart. Manual path:

    cd ComfyUI/custom_nodes
    git clone https://github.com/bowtiedbluefin/ComfyUI-AI-CustomURL
    cd ComfyUI-AI-CustomURL
    pip install -r requirements.txt
    

    No model downloads - it's a pure API pack. Dependencies are requests, aiohttp, pillow, numpy, torch, torchaudio, and opencv-python, almost all already present.

    Where people get burned

    • The advanced image params don't do anything on OpenAI. width, height, negative_prompt, guidance_scale, steps are diffusion-style parameters that DALL-E's endpoint ignores. They only matter on compatible providers that actually accept them (Venice's flux-dev is the classic example). If you're on OpenAI and "nothing changed", that's why.
    • Cost. Every generation is a billed API call; a batch of 10 is ten times the price. Watch quotas.
    • Auth and model typos. The usual 401 and "model not found" pair - verify base_url has the right path and the model name matches your account's access.

    This is a small, quiet project (single author, basically no community footprint as of writing), so manage expectations - but as a way to drop closed-source image generation into a local graph, it's about as simple as it gets.

    Categoryai_customurl

    Inputs (10)

    NameTypeDefaultDescription
    base_urlSTRINGhttps://api.openai.com/v1
    api_keySTRING
    promptSTRING
    modelSTRINGdall-e-3
    nINT11–10
    sizeCOMBO1024x10245 options: 1024x1024, 1024x1792, 1792x1024, 512x512, 256x256
    qualityCOMBOstandard2 options: standard, hd
    styleCOMBOvivid2 options: vivid, natural
    response_formatCOMBOurl2 options: url, b64_json
    advanced_params_jsonoptSTRING

    Outputs (2)

    NameTypeDescription
    imagesIMAGE
    urlsSTRING