GPT img API Generate
ChatGPT image generation, now a plain ComfyUI node
- reference_image
- image
- revised_prompt
People keep asking the same question on r/comfyui: can I run ChatGPT's image generation inside ComfyUI? GPT img API Generate is that node. Type a prompt, it goes to OpenAI's Responses API, and an image comes back as a standard ComfyUI IMAGE. No checkpoint, no VAE, no LoRA hunt - the model lives entirely in the cloud and your local GPU never gets touched.
The catch is the billing. This is the API route, so every image costs credits from an OpenAI API key. If you want the "use my ChatGPT subscription" experience instead, that's what GPT img OAuth Generate is for - same node, no key, rides your login.
How it works
The node builds a request for OpenAI's Responses API (/v1/responses) with the image_generation tool set to action: generate. Your prompt goes in a user message, your system_prompt goes in as a developer message, and the result streams back over SSE. The node pulls the base64 PNG out of the stream, decodes it to a tensor, and hands you the image plus the revised_prompt - the prompt OpenAI actually used after its own rewrite.
The inputs that matter
prompt- the image you want. This is the one you'll touch most.api_key- leave empty and setOPENAI_API_KEYin your environment if you prefer.model- defaults togpt-5.5; the list also hasgpt-5,gpt-5.4, andgpt-5.4-mini.n- how many images to generate, 1 to 8. Each one is a separate billed API call.size- includesautoif you don't want to choose, plus the usual squares and wide/tall ratios.quality-low,medium,high. Medium is the default and honestly the sensible starting point.
There are also optional sockets: system_prompt_input and user_prompt_input override the widgets when connected, and reference_image accepts an IMAGE (up to 5 frames) as a visual reference. A connected prompt socket wins over the widget text.
Outputs
image- the generated result as a ComfyUI IMAGE. Withn> 1 you get a batch, so a Preview node shows them all.revised_prompt- the rewritten prompt, handy for debugging why the result drifted from what you asked.
Install
Manager search may not have it yet (the registry version is still Pending), so clone it manually:
cd ComfyUI/custom_nodes
git clone https://github.com/hub2vu/Comfyui-GPT-img-node.git GPT-img
Restart ComfyUI and look for the "GPT img" category. No Python packages to install - the pack has an empty dependency list.
Common issues
The big one is money: with n set high and quality set to high, a single run is several billed API calls. Start with n = 1 and medium quality until you've got the prompt right. Timeouts default to 300 seconds and can be raised to 3600. And if you ever see an auth error, check that the API key in the widget (or OPENAI_API_KEY) is actually valid - and don't commit that key to a shared workflow.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | a cinematic image | — |
| api_key | STRING | — | |
| model | COMBO | gpt-5.5 | 4 options: gpt-5.5, gpt-5, gpt-5.4, gpt-5.4-mini |
| quality | COMBO | medium | 3 options: low, medium, high |
| size | COMBO | 1024x1024 | 13 options: 1024x1024, 1536x1024, 1024x1536, 1360x1024, 1024x1360, 1824x1024, +7 |
| moderation | COMBO | low | 2 options: low, auto |
| n | INT | 11–8 | — |
| timeout_sec | INT | 30030–3600 | — |
| system_prompt | STRING | You are an image generation assistant. Use the image_generation tool to create the requested image. Preserve the user's prompt, requested style, language, subject, and composition as closely as possible. Return image output, not explanatory text. | — |
| system_prompt_inputopt | STRING | — | |
| user_prompt_inputopt | STRING | — | |
| reference_imageopt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| revised_prompt | STRING | — |