PD: GPT Image 2 (comfyui_apikey)
GPT Image 2 in ComfyUI — multi-image editing without a GPU
- image
- mask
- files
- image
- info
- price
GPT Image 2 is the current top of OpenAI's image line, and this node runs it through ComfyUI's hosted API with your own ComfyUI key. The headline feature is multi-image editing - you feed several reference images, and the model composes from all of them. That's the thing that separates it from the GPT Image 1/1.5 node in the same pack, and it's genuinely useful for character references and product shots.
Why you'd reach for it
If you've been using the older GPT Image nodes, the jump to v2 is mostly about editing. Single-image edits work the same as before; multi-image input is where it earns its keep. It also supports big output sizes - up to 3840×2160 presets and custom dimensions to 3840 - which is a lot of resolution to ask of a local model. The KB's closed-source-models notes on GPT Image's strong text rendering and historically loose guardrails apply here too, along with the same warning about censorship unpredictability.
How it works
The node hits OpenAI-compatible endpoints on Comfy's proxy - https://api.comfy.org/proxy/openai/images/generations for text-to-image, /images/edits when you provide an image - with your key in the X-API-KEY header. Input images go up as multipart PNG (capped at 2048×2048), and a v2.0.1 fix normalized the MIME types of packed multi-image files so they arrive as clean image/png instead of the Gemini-style enum values - that was breaking the GPT Image 2 edit path specifically.
Inputs that matter
- api_key - your ComfyUI key from comfy.org/api-keys.
- prompt - generation or edit instructions.
- quality -
auto/low/medium/high(default auto). This is your cost lever. - background - only
autoandopaque; the tooltip is blunt: GPT Image 2 does not support transparent backgrounds. If you need transparency, use the GPT Image 1 node. - size - presets from 1024×1024 up to 3840×2160/2160×3840, plus
Customandauto. Withuse_custom_sizeon,custom_width/custom_heightoverride (both must be set; they step by 16 up to 3840). - num_images - 1–8 per call.
- seed - labeled "not implemented yet in backend," so don't count on reproducibility.
- Optional image (single editing), mask (inpainting, white replaced), and files - the multi-image path, which is exactly what
PD_comfyplus_imagefeeds.
Outputs: image, info, and price (USD/RMB/credits estimate).
Installing it
Same pack, same install:
cd ComfyUI/custom_nodes
git clone https://github.com/7BEII/comfyui-PD_comfy-api-node.git
Restart, find it under PD_Tools/Image_Generation. The README's pip install -r requirements.txt refers to a file that doesn't exist; the pack's real dependency (comfy_api_nodes) ships with ComfyUI Desktop.
Troubleshooting
- Black image out - the error placeholder;
infocarries the real message. - Multi-image edit fails - this was the v2.0.1 bug territory (bad MIME types from packed files). Update the pack, and make sure you're feeding
filesfromPD_comfyplus_imagerather than raw tensors when you have more than one reference. - "No transparent background?" - correct, that's a v2 limitation, not a bug. Plan for opaque.
- Custom size ignored -
use_custom_sizemust be on and both width and height set; they pair like two-factor auth.
Honest take: the multi-image editing makes this the pack's most interesting image node, but the opaque-only background is a real constraint for asset work. Keep the GPT Image 1 node around for transparency, use this for edits and big final frames.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | — | |
| prompt | STRING | Text prompt for GPT Image 2 | |
| model | COMBO | gpt-image-2 | 1 options: gpt-image-2 |
| seed | INT | 00–2147483647 | not implemented yet in backend |
| quality | COMBO | auto | GPT Image 2 quality |
| background | COMBO | auto | GPT Image 2 does not support transparent background |
| size | COMBO | 1024x1024 | Preset output size, or Custom with custom_width/custom_height |
| use_custom_size | BOOLEAN | false | Enable custom_width/custom_height size override. |
| custom_width | INT | 00–3840 | Custom width. Must be paired with custom_height. |
| custom_height | INT | 00–3840 | Custom height. Must be paired with custom_width. |
| num_images | INT | 11–8 | How many images to generate |
| imageopt | IMAGE | Optional reference image for image editing. | |
| maskopt | MASK | Optional mask for inpainting (white areas will be replaced) | |
| filesopt | GEMINI_INPUT_FILES | Optional packed multi-image files input, for example from PD_comfyplus_image. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| info | STRING | — |
| price | STRING | — |