GPT Image 2 AIO
The whole OpenAI image API in one node, no GPU required
- mask
- image_1
- image_2
- image_3
- image_4
- image_5
- image_6
- image_7
- image_8
- images
- alpha_mask
- revised_prompt
- metadata
Let's be honest about why you're here: you want GPT Image's text rendering and prompt adherence, and there's no local version to download. OpenAI's image models are closed, full stop - no weights, no GGUF, no fine-tune. The only door is the API, and this node is that door, turned into a single box that drops its result into your ComfyUI graph like a local sampler made it. It's the flagship of the Comfyui_gpt_2.0 pack, and the one you'll actually reach for if you want OpenAI's image output inside your normal workflow instead of bouncing out to the ChatGPT tab.
What it actually does
Under the hood it's a thin HTTP client for api.openai.com/v1/images. No input image connected? It calls /generations (pure text-to-image). One or more of the eight image_1 through image_8 sockets plugged in? It switches to /edits automatically, uploading your images as PNGs. Same node, two entirely different API calls, zero manual switching - that's the "AIO" in the name, and it's the thing that makes this more than a toy wrapper.
That dual mode is the real point. GPT Image is famous for being able to take up to eight reference images and edit them coherently - restyle a product shot, swap a background, keep a subject consistent across variations. In ComfyUI terms this node is the only step you need between "load a reference image" and "get the edited result back," which fits naturally next to your local stuff: generate the composition locally, send it up to GPT for the polish that needs text, composite the result back down with a local upscaler.
The inputs that matter
You mostly set three things and leave the rest alone:
prompt- the whole game, as always.model_name-gpt-image-2(the moving alias) orgpt-image-2-2026-04-21(a pinned snapshot). Default is the alias; use the snapshot if you care about reproducibility.image_count- 1 to 4 images per generation call. Note it only applies to generation: once you connect a reference image, edits come back one at a time andimage_countis ignored.
Then the quality knobs, which all pass straight through to the API: aspect_ratio (Auto plus the usual 1:1, 16:9, 9:16, 21:9, …), image_size (1K/2K/4K), quality (auto/low/medium/high), background (auto/opaque/transparent), output_format (png/jpeg/webp), and moderation (auto/low). The mask input takes a ComfyUI MASK for localized edits - white region gets edited, black gets preserved, and the node converts it to the transparent-PNG-alpha form OpenAI's edit API actually expects.
Outputs
Four of them, and they cover the whole flow: images (the generated/edited IMAGE), alpha_mask (the alpha channel pulled out as a MASK - white where the image is transparent, handy if you asked for a transparent background and want to composite it), revised_prompt (OpenAI's rewritten version of your prompt, useful to learn what it actually listened to), and metadata (compact JSON with sizes, timestamps, and the revised prompts).
Installing it
Two routes, both easy. In ComfyUI Manager, search for Comfyui_gpt_2.0 and install. Or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Poo-DH/Comfyui_gpt_2.0
cd Comfyui_gpt_2.0
pip install -r requirements.txt
Dependencies are tiny - just python-dotenv and requests. No model files, no heavy DL packages; your GPU isn't involved at all. Then restart ComfyUI and add your OpenAI key - either a .env file inside the pack folder (OPENAI_API_KEY=...) or the node's api_key input, with the node input winning if both are set. That's it.
Where people get burned
The big one: when the API call fails, the node doesn't error the graph - it hands you a 64×64 black image and stuffs the real error into the metadata output. If you suddenly see tiny black squares, you didn't break ComfyUI; your call failed. Read the metadata string (a Text node will show it) and you'll get the actual message - usually a missing key (OPENAI_API_KEY is not configured...) or an API-side refusal.
Also keep two things in perspective. Moderation is baked into the model, not the node - the moderation input is pass-through, not a bypass, and a refusal will surface as a metadata error. And on cost: unless you're on Auto aspect ratio, the request OpenAI bills is always one of the ~1MP native sizes, and 1K/2K/4K mostly decides what you get after the node locally resizes the result (4K is a LANCZOS upscale to a 4096 long side, not native 4K generation). Every run is a metered call, so it adds up - but you're not paying for 4K when you ask for it.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | A polished product photo of a futuristic eyewear display. | — |
| model_name | COMBO | gpt-image-2 | 2 options: gpt-image-2, gpt-image-2-2026-04-21 |
| image_count | INT | 11–4 | — |
| aspect_ratio | COMBO | Auto | 11 options: Auto, 1:1, 2:3, 3:2, 3:4, 4:3, +5 |
| image_size | COMBO | 2K | 3 options: 1K, 2K, 4K |
| quality | COMBO | auto | 4 options: auto, low, medium, high |
| background | COMBO | auto | 3 options: auto, opaque, transparent |
| output_format | COMBO | png | 3 options: png, jpeg, webp |
| moderation | COMBO | auto | 2 options: auto, low |
| api_keyopt | STRING | — | |
| maskopt | MASK | — | |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — | |
| image_5opt | IMAGE | — | |
| image_6opt | IMAGE | — | |
| image_7opt | IMAGE | — | |
| image_8opt | IMAGE | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| alpha_mask | MASK | — |
| revised_prompt | STRING | — |
| metadata | STRING | — |