Nodes/comfyui-PD_comfy-api-node/PD: GPT Image 2 (comfyui_apikey)
ComfyUI Node

PD: GPT Image 2 (comfyui_apikey)

GPT Image 2 in ComfyUI — multi-image editing without a GPU

By 7BEII·Created 10 months ago·Updated 9 days ago· 2
PD: GPT Image 2 (comfyui_apikey)
  • image
  • mask
  • files
  • image
  • info
  • price
api_key
prompt
modelgpt-image-2
seed0
qualityauto
backgroundauto
size1024x1024
use_custom_sizefalse
custom_width0
custom_height0
num_images1

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 auto and opaque; 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 Custom and auto. With use_custom_size on, custom_width/custom_height override (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_image feeds.

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; info carries 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 files from PD_comfyplus_image rather 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_size must 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.

CategoryPD_Tools/Image_Generation

Inputs (14)

NameTypeDefaultDescription
api_keySTRING
promptSTRINGText prompt for GPT Image 2
modelCOMBOgpt-image-21 options: gpt-image-2
seedINT00–2147483647not implemented yet in backend
qualityCOMBOautoGPT Image 2 quality
backgroundCOMBOautoGPT Image 2 does not support transparent background
sizeCOMBO1024x1024Preset output size, or Custom with custom_width/custom_height
use_custom_sizeBOOLEANfalseEnable custom_width/custom_height size override.
custom_widthINT00–3840Custom width. Must be paired with custom_height.
custom_heightINT00–3840Custom height. Must be paired with custom_width.
num_imagesINT11–8How many images to generate
imageoptIMAGEOptional reference image for image editing.
maskoptMASKOptional mask for inpainting (white areas will be replaced)
filesoptGEMINI_INPUT_FILESOptional packed multi-image files input, for example from PD_comfyplus_image.

Outputs (3)

NameTypeDescription
imageIMAGE
infoSTRING
priceSTRING