Nodes/GPT img/GPT img API Generate
ComfyUI Node

GPT img API Generate

ChatGPT image generation, now a plain ComfyUI node

By hub2vu·Created 4 months ago·Updated 4 months ago· 3
GPT img API Generate
  • reference_image
  • image
  • revised_prompt
prompta cinematic image
api_key
modelgpt-5.5
qualitymedium
size1024x1024
moderationlow
n1
timeout_sec300
system_promptYou 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_input
user_prompt_input

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 set OPENAI_API_KEY in your environment if you prefer.
  • model - defaults to gpt-5.5; the list also has gpt-5, gpt-5.4, and gpt-5.4-mini.
  • n - how many images to generate, 1 to 8. Each one is a separate billed API call.
  • size - includes auto if 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. With n > 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.

CategoryGPT img

Inputs (12)

NameTypeDefaultDescription
promptSTRINGa cinematic image
api_keySTRING
modelCOMBOgpt-5.54 options: gpt-5.5, gpt-5, gpt-5.4, gpt-5.4-mini
qualityCOMBOmedium3 options: low, medium, high
sizeCOMBO1024x102413 options: 1024x1024, 1536x1024, 1024x1536, 1360x1024, 1024x1360, 1824x1024, +7
moderationCOMBOlow2 options: low, auto
nINT11–8
timeout_secINT30030–3600
system_promptSTRINGYou 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_inputoptSTRING
user_prompt_inputoptSTRING
reference_imageoptIMAGE

Outputs (2)

NameTypeDescription
imageIMAGE
revised_promptSTRING