๐ผ๏ธ GPT-Image-2 Image to Image
Editing up to 9 reference images
- image_1
- image_2
- image_3
- image_4
- image_5
- image_6
- image_7
- image_8
- image_9
- image
- image_url
- request_id
Text-to-image is the boring half of this pack. The reason GPT-Image-2 is worth paying for is native image editing, and that's exactly what the ๐ผ๏ธ GPT-Image-2 Image to Image node exposes: you feed it up to nine reference images plus a prompt describing what to change, and it hands back a new image. No inpaint masks, no ControlNet, no regional prompters to coax it along. You describe the edit in plain English and the model just... does it.
That's a bigger deal than it sounds if you've spent time wrangling local img2img. Style transfer, product-shot reimagining, character consistency across references, "swap this background but keep the subject" - all of it collapses into one node and one prompt. The community has leaned on exactly this for storyboarding: generate a 16-cell plan with GPT-Image-2, then feed the frames to a video model. One node, nine references, zero fiddling.
How it works
The mechanism is the same remote-call pattern as the text-to-image node, with one extra step up front. Each IMAGE tensor you wire in gets squashed to its first frame, converted to a JPEG at quality 95, and POSTed to muapi's /upload_file endpoint with your key. The returned URLs go into the request payload as images_list, the whole thing gets POSTed to /api/v1/gpt-image-2-image-to-image, and the node polls every 5 seconds for up to 10 minutes until the result lands. Then it downloads the image and hands you a normal IMAGE tensor.
Two details from the source are worth knowing. First, only the first frame of any batch is used - wire a single image per input slot, not a batch. Second, the uploads happen before the generation, so more reference images means a longer preflight and a bigger bill. Nine references is a real feature, not a rounding error; use the ones that matter.
Inputs and outputs
The three inputs you actually set:
prompt(multiline STRING) - describes the transformation. The default, "Transform this product image into a premium e-commerce poster style," is a decent template: name the subject's role, then the target style.seed(INT) - not sent to the API. GPT-Image-2 has no seed control, so this exists purely to force ComfyUI to re-run the node instead of serving a cached result. It's your re-roll button.image_1throughimage_9(IMAGE, all optional) - the references. Wire LoadImage outputs in, or even chain another generation node'simageoutput here. At least one is required; the pack raisesValueError: At least one input image is required.if you queue it empty.api_key(optional STRING) - wire from the ๐ API Key node or leave blank to use the CLI config.
The outputs are identical to the text-to-image node: image (IMAGE, into PreviewImage/SaveImage), image_url (STRING, the CDN link), and request_id (STRING, for dashboard debugging).
Install and gotchas
Same install as the rest of the pack - ComfyUI Manager or:
cd ComfyUI/custom_nodes
git clone https://github.com/Anil-matcha/gpt-image-2-comfyui
pip install -r gpt-image-2-comfyui/requirements.txt
Dependencies are just requests, Pillow, numpy, and torch - all already present. No weights, no model download, no GPU requirement.
The failure modes are the ones you'd expect from a paid remote service. 401 is a bad key, 402 is out of credits, 429 is rate-limiting. Two less obvious ones: the JPEG q95 upload is lossy, so if you're editing fine detail the compression is doing some of the work before the model ever sees the image - start from a reasonably large source. And if your reference is a batch, remember only frame one survives, which is a silent surprise until you look at the output and wonder where your other frames went. None of it is fatal; this node is genuinely the one you'd reach for when you want GPT-Image-2's editing chops without leaving ComfyUI.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Transform this product image into a premium e-commerce poster style. | โ |
| seed | INT | 00โ18446744073709550000 | Not sent to the API โ GPT-Image-2 has no seed control. Changing this forces ComfyUI to re-run the node instead of reusing a cached result on repeat/batch generations. |
| api_keyopt | STRING | โ | |
| image_1opt | IMAGE | โ | |
| image_2opt | IMAGE | โ | |
| image_3opt | IMAGE | โ | |
| image_4opt | IMAGE | โ | |
| image_5opt | IMAGE | โ | |
| image_6opt | IMAGE | โ | |
| image_7opt | IMAGE | โ | |
| image_8opt | IMAGE | โ | |
| image_9opt | IMAGE | โ |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | โ |
| image_url | STRING | โ |
| request_id | STRING | โ |