ComfyUI Node

Dalle Image Generation

Outsource the GPU, keep the graph

By cleanlii·Created about a year ago·Updated about a year ago· 1
Dalle Image Generation
    • IMAGE
    prompt
    size
    n1

    DALL·E 3 in ComfyUI: outsource the GPU, keep the graph

    Dalle Image Generation is the honest version of what a lot of "cloud AI" nodes promise: type a prompt, it phones OpenAI's DALL·E 3 API, and a finished image lands back in your ComfyUI graph as a normal IMAGE tensor. No checkpoint to download, no VRAM eaten, no sampler settings to argue with. Just a per-image bill.

    Why you'd reach for it

    ComfyUI exists because the community prefers local generation - no censorship, no prompts leaving the machine, full control. This node is the counter-example on purpose. DALL·E 3's prompt understanding was genuinely ahead of local models when this pack shipped in April 2025, and that gap is still the argument: write a convoluted, multi-clause prompt and DALL·E 3 mostly does what you said, where a local model of similar vintage often doesn't. OpenAI has since moved past DALL·E 3 with GPT Image, but the endpoint still answers.

    So the niche is narrower than it used to be: a quick, fuss-free text-to-image that plugs into everything downstream. Because the output is a standard IMAGE, you can feed it straight into an upscaler or the rest of your workflow - cloud for the hard part, local for the polish.

    How it works

    The node reads your API key from a config.json in the pack folder, creates an AsyncOpenAI client, and calls images.generate with model="dall-e-3", your size, n, and response_format="b64_json". The base64 payload comes back, gets decoded, converted to RGBA, and stacked into the (B, H, W, C) tensor ComfyUI expects. Don't read too much into "async" - from ComfyUI's side this is a blocking node; the UI waits for the round-trip. The async is just how the SDK does networking.

    The three inputs that matter

    • prompt - a multiline box; this is the whole ballgame.
    • size - 1024x1024, 1024x1792 (portrait), or 1792x1024 (landscape). The big formats cost more per image.
    • n - 1 to 4, default 1. And here's the trap: the DALL·E 3 API only accepts n=1. Set it to 2 and OpenAI bounces the request with an error. The field exists because all three nodes in this pack share the same code skeleton; on generation it's effectively locked to 1.

    The single output is IMAGE, which wires into SaveImage or anything downstream.

    Installing it

    ComfyUI Manager - search "DalleImageNodes" (or cleanlii/comfyui-dalle-integration) - install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/cleanlii/comfyui-dalle-integration
    

    Then restart and install the one real dependency. torch, torchvision, and Pillow all ship with ComfyUI's Python, but openai doesn't:

    python -m pip install openai                 # Linux/macOS
    ./python_embeded/python.exe -m pip install openai   # Windows
    

    Finally, put a real key in config.json. It gets created automatically in the pack folder on first load, with a placeholder.

    { "openAI_API_Key": "sk-your-real-key" }
    

    Troubleshooting

    • 401s on every run: your config.json still has the placeholder sk-####... that gets auto-written the first time. Open it and paste a real key.
    • "n must be 1" style errors: you set n > 1. DALL·E 3 refuses it.
    • README tells you to copy a file that doesn't exist: it says to copy DalleImageNodes_async_final.py into custom_nodes - that name is stale. The pack is now a normal folder with __init__.py; clone the whole thing and you're done.
    • UI freezes for a few seconds: that's the API round-trip. Normal, not a hang.

    One honest caveat: this is a single-commit repository from April 2025 with no maintenance since. It works because it's simple - but treat it as a utility, not an ecosystem.

    CategoryOpenAI/Dalle

    Inputs (3)

    NameTypeDefaultDescription
    promptSTRING
    sizeCOMBO3 options: 1024x1024, 1024x1792, 1792x1024
    nINT11–4

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE