GPT-Image-2 Text-to-Image
GPT-Image-2 Text-to-Image Is an API Call Wearing a Node
- image
- url
- response
GPT-Image-2 is one of those models you will never get as weights. OpenAI doesn't ship it, nobody has recreated it, and it isn't coming to a local ComfyUI install. So when you want its output inside a workflow - feeding your upscaler, feeding a video pipeline - the only door is the API. GPTImage2T2I is that door, shaped like a sampler.
It's a text-to-image node from kevinzilin/ComfyUI_OpenAI_GPTImage2, a small pack of three nodes that call OpenAI's image endpoints. This one sends your prompt to gpt-image-2 over the Images API and drops the returned image back on the canvas as a normal IMAGE tensor. No checkpoint to download, no VRAM, no CUDA. You could run this on a potato, because the potato is only doing HTTP.
How it works: it streams. The node calls images.generate with stream=True and partial-image previews, so ComfyUI's progress bar actually moves while the API renders, then it decodes the completed frames from base64 into a tensor. It feels like watching a local generation minus the fan noise. That streaming is also why the url output exists - streamed results come back inline, so the node just reports "(base64)" there instead of a hosted link. The third output, response, is a plain-text summary (model, size, quality, count) or the error message, which is handy for seeing what actually got sent.
The inputs that actually matter:
prompt(multiline) - the thing you want drawn. GPT-Image-2 is genuinely good at text and detailed scene descriptions, so prompt it like a model that can read, not like a diffusion checkpoint.api_key- paste your OpenAI key right into the node. No env var, no config file. It lives in the workflow JSON, so don't share workflows with a live key in them.width/height- 1024x1024 by default, stepped in 16s. The API validates before it sends: multiples of 16, max edge 3840px, roughly 0.65 to 8.3 megapixels, and aspect ratio no more than 3:1. 256x256 gets rejected for being under the pixel floor; 3840x3840 for blowing the ceiling.quality- auto/high/medium/low;autois a fine default.n- how many images, 1–4. Each one is billed separately, so don't leave it at 4 out of habit.
Optional inputs: proxy (for those of us whose network can't reach api.openai.com directly) and seed. Here's the honest bit: seed exists for workflow compatibility and metadata, but the current API call doesn't actually pass it. Don't expect reproducible generations - reproducibility isn't this node's job.
Install is the standard dance:
cd ComfyUI/custom_nodes
git clone https://github.com/kevinzilin/ComfyUI_OpenAI_GPTImage2
cd ComfyUI_OpenAI_GPTImage2
# ComfyUI's own python, not system python
E:\ComfyUI_windows_portable\python_embeded\python.exe -m pip install -r requirements.txt
ComfyUI Manager can do the clone for you if you search "ComfyUI_OpenAI_GPTImage2" - but you still need openai>=2.38.0 and httpx[socks] installed into ComfyUI's environment or the import fails. Then restart. No model files, ever.
Where people get burned: mostly the key (empty api_key gets you a red "API Key Required" placeholder image), a size that fails validation, or "Connection Failed" - which in this pack almost always means "set the proxy." If the API returns fine but no image comes back, check the prompt and model fields. One thing to know: the client disables TLS verification (verify=False) for proxy compatibility. Fine for a local proxy you control, worth remembering before you route it through anything untrusted.
Worth it? If you already pay for OpenAI and want GPT-Image-2 inline instead of copy-pasting from ChatGPT, absolutely - it's the cheapest way to get that model's output composable with the rest of your graph. Just remember it's a tool for a model you can't run locally, and that your prompt leaves the machine every time you hit Run.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| api_key | STRING | — | |
| width | INT | 1024256–3840 | — |
| height | INT | 1024256–3840 | — |
| quality | COMBO | auto | 4 options: auto, high, medium, low |
| n | INT | 11–4 | — |
| proxyopt | STRING | — | |
| seedopt | INT | 00–4294967295 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| url | STRING | — |
| response | STRING | — |