Nodes/GPT img/GPT img API Edit
ComfyUI Node

GPT img API Edit

The fastest way to edit an image with GPT inside ComfyUI

By hub2vu·Created 4 months ago·Updated 4 months ago· 3
GPT img API Edit
  • image
  • image
  • revised_prompt
promptedit this image
api_key
modelgpt-5.5
qualitymedium
size1024x1024
moderationlow
timeout_sec300

Local diffusion will get you 90% of the way to a good image edit, and then it stalls exactly where GPT doesn't: text baked into the image, a face or a logo staying intact while everything around it changes, and a fussy instruction like "change the collar, keep the fabric." That's what GPT img API Edit is for. Drop in any ComfyUI IMAGE, type what you want changed, and the edit happens at OpenAI's end while your GPU idles.

This is the API route, so you pay per edit with an OpenAI API key - no local model download, no VRAM math, just a bill. If you'd rather spend your ChatGPT subscription than API credits, the OAuth sibling (GPT img OAuth Edit) is the same node minus the key.

How it works

The node encodes your image as a base64 PNG and POSTs it to OpenAI's Responses API (/v1/responses) with the image_generation tool set to action: edit. The response streams back, the node grabs the image out of the stream, decodes it, and hands you a normal ComfyUI IMAGE tensor. Your graph doesn't know or care that the heavy lifting happened in the cloud; this is just another image source.

The inputs that matter

  • image - the IMAGE tensor you're editing. Wire in a Load Image node or the output of anything upstream.
  • prompt - what to change. Be specific; "make it sunset" beats "make it better."
  • api_key - leave blank and set OPENAI_API_KEY in your environment instead.
  • model - defaults to gpt-5.5, with gpt-5, gpt-5.4, and gpt-5.4-mini as fallbacks.
  • size - output dimensions; the list includes auto if you'd rather let OpenAI pick.
  • moderation - low (default) or auto. OpenAI's moderation has a reputation for being unpredictable; low is the loose setting.

Outputs

  • image - the edited result, a standard IMAGE you can Preview, Save, or pass downstream.
  • revised_prompt - the prompt OpenAI actually generated the image from after rewriting yours. Wire it to a Show Text node; you'll learn a lot about how the model interpreted you.

Install

Manager search may not find "GPT img" yet - the pack's registry version is still marked Pending, so the README says manual install is the reliable path right now:

cd ComfyUI/custom_nodes
git clone https://github.com/hub2vu/Comfyui-GPT-img-node.git GPT-img

Restart ComfyUI. There's no Python dependency to install - the pack ships with an empty dependency list and uses urllib, plus the numpy/PIL/torch ComfyUI already has.

Common issues

The node errors with a clear message if there's no API key and no OPENAI_API_KEY. Generations can be slow, so timeout_sec defaults to 300 seconds and goes up to 3600. And every run is a billed call - this node doesn't even offer n, it's one image in, one billed edit out. Keep that in mind before you throw it in a loop.

Where people get burned: pasting an API key into a shared workflow and committing it to git. The README is blunt about it - don't commit API keys into workflows or repositories.

CategoryGPT img

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
promptSTRINGedit this 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
timeout_secINT30030–3600

Outputs (2)

NameTypeDescription
imageIMAGE
revised_promptSTRING