GPT img API Edit
The fastest way to edit an image with GPT inside ComfyUI
- image
- image
- revised_prompt
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 setOPENAI_API_KEYin your environment instead.model- defaults togpt-5.5, withgpt-5,gpt-5.4, andgpt-5.4-minias fallbacks.size- output dimensions; the list includesautoif you'd rather let OpenAI pick.moderation-low(default) orauto. OpenAI's moderation has a reputation for being unpredictable;lowis 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.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| prompt | STRING | edit this 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 |
| timeout_sec | INT | 30030–3600 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| revised_prompt | STRING | — |