GPT Image Bridge · Edit
Editing an image with GPT — base image, up to 8 references, and an optional mask
- provider
- base_image(Image 1)
- references(Image 2 开始)
- mask
- image
- revised_prompt
- request_report
GPT Image Bridge · Edit is where the pack stops being "an API call in a box" and starts being genuinely useful: it sends an image to GPT Image and asks the model to change it. Out comes a normal ComfyUI IMAGE tensor, ready to plug into a save node, an upscaler, or the next stage of your workflow. Same trick as the Generate node, but now there's a base image that is explicitly the thing being edited.
The required inputs: a provider from either Provider node, base_image(Image 1) - the image to edit, and prompt (default "Edit this image"). Then the same generation params as Generate: size, quality, background, output_format, moderation, n (1–8), and timeout_sec (30–3600). No surprises there; they map to the standard GPT Image edit call, and auto values defer to the service.
The interesting inputs are the two optional ones:
references(Image 2 开始)- accepts aGPT_IMAGE_REFERENCEShandle from theEdit Reference List (Image 2–9)node. That's how you attach extra images as visual context.mask- aMASKfor region-restricted edits. It must exactly match the base image's dimensions, or the node refuses before it spends any of your money.
How the image roles work
The numbering is fixed and it matters. Image 1 is always the base - the edit target. Images 2 through 9 come from the Reference List, and they're only visual reference: no matter the connection order, a reference never replaces the base image, and the base stays the thing being modified. That's a deliberate design choice, and it's easy to trip on if you're used to img2img-style workflows where every input is fair game.
Since each reference entry is encoded independently, your references can be completely different sizes - no need to assemble an IMAGE batch. (In fact, if you try to feed one of the slots a batch, the pack will tell you to split it across numbered slots instead.)
Protocol routing follows the same auto logic as the rest of the pack: an API edit goes to /images/edits, a Codex OAuth edit also goes to /images/edits but with real limits - at most 5 ordered images (base + 4 references), no mask, no output_format. Those get quietly ignored and noted in the request report rather than erroring, which is a nice touch until you forget and wonder why your transparent-background PNG came back opaque. Mask support and output_format are API-path features.
Outputs
image- the editedIMAGEtensor.revised_prompt- the service's rewritten prompt, when one comes back.request_report- the redacted string with protocol, endpoint, timing, and error details. On any failure - a rejected prompt, an unsupported parameter, an auth problem - this is where the readable diagnosis is.
Install
Manager: search GPT Image Bridge, install, restart. Terminal route:
cd ComfyUI/custom_nodes
git clone https://github.com/Liu-Bot24/comfyui-gpt-image-bridge.git ComfyUI-GPT-Image-Bridge
cd ComfyUI-GPT-Image-Bridge && python -m pip install -r requirements.txt
Restart. numpy and Pillow are the only deps; there's nothing to download for the model side, because the model isn't local - which is exactly why this node exists. GPT Image has no open weights, so this is the "reach out and call it" path, the same category as Comfy's official Partner Nodes but with your own key or Codex login. That means the usual API-node caveats apply in full: per-call cost, prompts and images leaving your machine, and OpenAI's moderation enforced at the source - a node setting can't loosen that. The mask dimension check and the contiguous-reference rules are the two gotchas most likely to bite a first run, and both fail before any paid request goes out, so the blast radius is a fixable error, not a bill.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| provider | GPT_IMAGE_PROVIDER | — | |
| base_image(Image 1) | IMAGE | — | |
| prompt | STRING | Edit this image | — |
| size | COMBO | auto | 4 options: auto, 1024x1024, 1536x1024, 1024x1536 |
| 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 |
| n | INT | 11–8 | — |
| timeout_sec | INT | 30030–3600 | — |
| references(Image 2 开始)opt | GPT_IMAGE_REFERENCES | — | |
| maskopt | MASK | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| revised_prompt | STRING | — |
| request_report | STRING | — |