OpenAI GPT Image 2
OpenAI's current generator, with editing built into the same node
- IMAGE
OpenAI GPT Image 2 is the current-generation OpenAI image node, and it's a proper step past the old DALL·E 3 one: the model dropdown covers gpt-image-2 (plus the earlier gpt-image-1.5 and gpt-image-1), and the same node does both text-to-image and image editing - connect an image, optionally a mask, and describe what to change. Cloud partner node, ships with ComfyUI core, no install, billed per call against your Comfy account.
The editing story is the reason you'd pick this over older OpenAI nodes. GPT Image's whole pitch is natural-language editing - "make the sky stormy but keep the boats" - and this node hands that to you as optional IMAGE inputs, with a mask for when you want the edit confined to a region. That's a genuinely different workflow from DALL·E 3's generation-only box, and it's the one that keeps the node relevant.
How it works
No input images → it calls OpenAI's images/generations endpoint. Input images (with or without a mask) → it switches to the images/edits multipart call, uploading your image(s) and an RGBA mask. Either way the result comes back as a normal IMAGE tensor. The model dropdown is dynamic: pick gpt-image-2 and you get size, background, and quality options; the legacy models get their older option sets.
The inputs that matter
- prompt - the text, for generation or the edit instruction.
- model -
gpt-image-2(current),gpt-image-1.5, orgpt-image-1. The dynamic sub-options appear under the model you pick. - n - 1 to 8 images per run. The price badge multiplies per image; it's a range, so glance at it.
- size (under the model) - for gpt-image-2, a long list from 1024x1024 up to 3840x2160, plus
autoand aCustomoption with width/height fields. Custom has real constraints: multiples of 16, max edge 3840, aspect ratio ≤ 3:1, and total pixels between ~0.66M and ~8.3M. The node validates all of it before calling. - background (under the model) -
autooropaque, for whether you get a transparent-capable or opaque result. - image / mask (under the model) - the edit inputs. Mask without an image is rejected; mask + multiple images is rejected. Image size for the edit is capped by downscaling to ~4K before upload.
- seed - and yes, the tooltip still says "not implemented yet in backend." It gates re-running, nothing more.
Output is IMAGE, ready to save or process further.
Where people get burned
- The "Custom" size trap. "Custom" sounds like freedom; it's actually a contract. Non-multiple-of-16 dimensions, an edge over 3840, a ratio past 3:1, or a pixel count outside the window all throw errors. Read the error before blaming the node.
- Mask rules. Mask requires exactly one input image, same dimensions. The node enforces it, but build the mask to match your image in the first place.
- Model confusion. gpt-image-2's sub-options differ from the legacy models'. If you pick gpt-image-1 expecting gpt-image-2's sizes, you'll be hunting for inputs that aren't there.
- Cost is a range, not a number. The price badge shows a range because quality and size move the actual price. Big + high quality + 8 images is the expensive corner of this family.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Text prompt for GPT Image | |
| model | COMBO | 3 options: [object Object], [object Object], [object Object] | |
| n | INT | 11–8 | How many images to generate |
| seed | INT | 00–2147483647 | not implemented yet in backend |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |