Nodes/ComfyUI-OpenAI-Image-API/OpenAI Image t2i/i2i (OpenAI API)
ComfyUI Node

OpenAI Image t2i/i2i (OpenAI API)

GPT Image inside your ComfyUI graph — no GPU, no weights, just your API key

By fudosanit·Created 5 months ago·Updated 5 months ago· 0
OpenAI Image t2i/i2i (OpenAI API)
  • image
  • image
  • revised_prompt
api_key
prompt
modelgpt-image-1
sizeauto
qualityauto
backgroundauto
n1

You can't download GPT Image. There are no weights to grab, no safetensors file, no GGUF someone's squeezed into 12GB of VRAM. It's a closed model - the only door is OpenAI's API. So when you want its text rendering and fidelity inside a ComfyUI workflow, next to your local upscaler and your masking, you reach for a wrapper node like this one.

OpenAIImage (OpenAI Image t2i/i2i (OpenAI API)) is exactly that: one node that takes your API key, sends your prompt to OpenAI's image endpoints, and drops the returned image back onto the canvas as if a local sampler had made it. It's a small pack - Japanese-authored, MIT-licensed, a single node, and its entire dependency list is requests. No model downloads, no CUDA, no 20GB of checkpoints. That's the whole appeal: for a model you physically cannot run locally, this is the friction-free on-ramp.

How it works

The node is a thin HTTP client, not a generator. The mechanism is blessedly simple and it's visible in the code:

  • No image connectedPOST /v1/images/generations (JSON, text-to-image)
  • image connectedPOST /v1/images/edits (multipart, image-to-image), where your ComfyUI IMAGE tensor gets converted to PNG and uploaded as the edit source (only the first frame is used, heads up)

That's the "t2i/i2i" in the name - it's not two nodes, it's one node that switches endpoints based on whether the image input is wired up. A 180-second timeout means slow gpt-image jobs won't strand your graph.

The clever part is the model-aware request shaping. For gpt-image-* models it never sends response_format (they reject it); for dall-e-* it explicitly asks for b64_json; background only goes out for gpt-image; and any value left at auto is dropped from the request so the API's own default applies. Invalid combos like DALL·E 2 with a 1536x1024 size aren't filtered by the node - they come back as OpenAI errors, surfaced in the red banner.

The inputs that matter

You'll set maybe four of these, ever:

  • api_key - your OpenAI key. Masked in the UI, but see the warning below.
  • prompt - what you want drawn.
  • model - the GPT Image line (gpt-image-1 is the default, plus -mini, -1.5, gpt-image-2) or the legacy DALL·E 2/3. The node passes the string straight through, so model validity is OpenAI's problem, not the node's.
  • image (optional) - plug a latent-free IMAGE in here and you've switched to i2i.

size, quality, and background are honestly mostly "leave on auto." n (1–10) returns multiple images as a batched IMAGE.

Outputs: an IMAGE tensor - which means it plugs straight into Save Image, or into your local upscalers and post-processing - plus revised_prompt, a STRING of OpenAI's safety-layer rewrite of your prompt. When the filter silently changes "cheeky grin" to something blander, that output is how you find out.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/fudosanit/ComfyUI-OpenAI-Image-API
cd ComfyUI-OpenAI-Image-API
pip install -r requirements.txt   # literally just requests

Restart ComfyUI and the node appears under the OpenAI category. Or search "OpenAI-Image-API" in ComfyUI Manager. No models to fetch - the only thing it needs is a key.

The honest tradeoffs

This is an API wrapper node, so the KB's four objections apply in full. Every image costs real money (gpt-image pricing adds up fast at scale). Your prompts - and in i2i, your reference images - leave the machine to a server you don't control. And the filter follows the model: you can't abliterate a closed API the way you strip refusals from a local checkpoint. If a prompt trips moderation you get OpenAI Content Moderation (HTTP 400, code=moderation_blocked) and that's the end of it. The community's verdict in a sentence: an API node is the right tool for a model you can't run, and the wrong default for one you can.

Two gotchas that actually burn people. First, the api_key field is masked in the UI but stored in plaintext in the saved workflow JSON - the README says it plainly, so scrub the key before you share a workflow. Second, this is a node whose whole job is to hold a credential and phone home, which is the exact shape of the thing that shipped credential-stealing malware once before. It's a small open-source pack; glance at the source before you trust it with a key. New custom nodes are arbitrary Python with no review process, and this one walks like a duck.

If you need a vetted path with prepaid credits, Comfy's own official API nodes cover the same GPT Image. But if you want one lightweight node that drops closed-model results straight into your local graph, this does the job with zero GPU drama.

CategoryOpenAI

Inputs (8)

NameTypeDefaultDescription
api_keySTRING
promptSTRING
modelCOMBOgpt-image-16 options: gpt-image-1, gpt-image-1-mini, gpt-image-2, gpt-image-1.5, dall-e-3, dall-e-2
sizeCOMBOauto9 options: auto, 1024x1024, 1536x1024, 1024x1536, 2048x2048, 1792x1024, +3
qualityCOMBOauto6 options: auto, low, medium, high, standard, hd
backgroundCOMBOauto3 options: auto, opaque, transparent
nINT11–10
imageoptIMAGE

Outputs (2)

NameTypeDescription
imageIMAGE
revised_promptSTRING