Nodes/comfyui-gpt-image/Ports OpenAI GPT Image 1
ComfyUI Node

Ports OpenAI GPT Image 1

This node calls OpenAI's image API from ComfyUI

By lceric·Created about a year ago·Updated about a year ago· 11
Ports OpenAI GPT Image 1
  • image
  • mask
  • IMAGE
prompt
api_base
auth_token
modelgpt-image-1
seed0
qualitylow
backgroundopaque
sizeauto
n1
moderationlow

GPT Image 1 is OpenAI's April 2025 image model - the one that made people in r/comfyui suddenly care about text rendering and natural-language prompts. This node drops it into your graph as a single box that takes a prompt and hands back an image. The honest version of that pitch: nothing runs on your GPU. GPTImage1Generate is a thin HTTP client that calls an image API and returns the result as a normal ComfyUI IMAGE tensor. No model download, no VRAM, no checkpoint. Just a bill from OpenAI at the end of the month.

Where it comes from

This is a fork of the official ComfyUI GPT-API node, and that provenance matters. The official node points at Comfy's own cloud API (api.comfy.org). It works, but it's Comfy's sandbox: fixed endpoint, fixed token, you pay Comfy and they pay OpenAI. comfyui-gpt-image (MIT, by lceric) takes that same node and unlocks the three fields the original hard-codes - api_base, auth_token, and model - so you can point it straight at OpenAI, or at any OpenAI-compatible endpoint you have a key for. That's the entire point of the pack, and it's the reason to install it over the official one.

How it works

When you queue the graph, the node POSTs to {api_base}/images/generations (or images/edits, if you feed it an image) with your prompt and a Bearer token. No OpenAI SDK involved - it's raw requests with pydantic models for the request/response. The image comes back as a URL or base64 blob, gets decoded, and lands in the output as an IMAGE tensor you can wire anywhere: Save Image, a preview, or straight into a local Flux pass for refinement.

One mechanism gotcha worth knowing: if you pass an input image, the node downscales it to roughly 1536×1024 before uploading. Don't waste time upscaling before you send it - it's thrown away.

The inputs that matter

  • prompt - the whole game. GPT Image 1's superpower is instruction-following and legible text in the image; write sentences, not tag soup.
  • api_base and auth_token - the boring but critical ones. Empty? The node falls back to what you saved in ComfyUI Settings (see below). Wrong? Instant 401 or connection error.
  • model - defaults to gpt-image-1; if you have access to a newer name like gpt-image-1-all, type it here. The field is a free string.
  • quality - low / medium / high. This is the cost knob as much as a quality knob; start at low while you're iterating.

The rest are set-and-forget. seed is the trap: the tooltip says it all - "not implemented yet in backend." It does nothing, so don't chase reproducibility with it. size (auto, 1024×1024, 1024×1536, 1536×1024), background (opaque/transparent), n (1–8 images), and moderation (low/auto) map straight to the API. image and mask switch you into editing/inpainting mode - white areas of the mask get replaced, and the mask only works with a single input image that matches its dimensions.

Install

Through ComfyUI Manager, search for comfyui-gpt-image. Or the manual way:

cd ComfyUI/custom_nodes
git clone https://github.com/lceric/comfyui-gpt-image
cd comfyui-gpt-image
pip install -r requirements.txt

Then restart ComfyUI. The requirements are Pillow, requests, numpy, torch - nothing exotic (you already have torch), and there are zero model files to fetch. Since v1.2.0 you can also stash api_base and auth_token under Settings → comfyui-gpt-image instead of typing them into every node; the web extension writes a config.json in the pack folder, and node fields always win over settings.

Common issues

  • 401 / auth errors - your auth_token is wrong, empty, or belongs to a different base URL. Double-check both together.
  • Connection or 404 errors - api_base is malformed. For OpenAI it needs to point at the /v1/ root (e.g. https://api.openai.com/v1/); an endpoint with no images/generations path will just fail.
  • "No images returned from API endpoint" - a provider quirk or an expired key; verify the model name is one the endpoint actually serves.
  • Node not showing up - you skipped the pip install or didn't restart. That's the whole list.

Should you reach for it?

Reach for it when you want GPT Image 1's text and instruction handling inside a mixed pipeline - generate with GPT, then refine with a local model, then tile-upscale, which is exactly the workflow people describe when they wire these API nodes in. Skip it if you wanted a local, cheap, or filter-free generation experience: this is a paid closed API with OpenAI's moderation attached, and the enthusiast community has never been warm to closed APIs for serious work. But as a bridge between the ChatGPT world and your node graph, it's about as frictionless as it gets.

CategoryPort ComfyUI GPT Image 1 Node

Inputs (12)

NameTypeDefaultDescription
promptSTRINGText prompt for GPT Image 1
api_baseoptSTRINGAPI Base URL
auth_tokenoptSTRINGAPI Auth Token
modeloptSTRINGgpt-image-1GPT Image Model
seedoptINT00–2147483647not implemented yet in backend
qualityoptCOMBOlowImage quality, affects cost and generation time.
backgroundoptCOMBOopaqueReturn image with or without background
sizeoptCOMBOautoImage size
noptINT11–8How many images to generate
imageoptIMAGEOptional reference image for image editing.
maskoptMASKOptional mask for inpainting (white areas will be replaced)
moderationoptCOMBOlowModeration level

Outputs (1)

NameTypeDescription
IMAGEIMAGE