Nodes/GPT Image Bridge/GPT Image Bridge · Edit
ComfyUI Node

GPT Image Bridge · Edit

Editing an image with GPT — base image, up to 8 references, and an optional mask

By Liu-Bot24·Created 2 months ago·Updated about a month ago· 0
GPT Image Bridge · Edit
  • provider
  • base_image(Image 1)
  • references(Image 2 开始)
  • mask
  • image
  • revised_prompt
  • request_report
promptEdit this image
sizeauto
qualityauto
backgroundauto
output_formatpng
moderationauto
n1
timeout_sec300

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 a GPT_IMAGE_REFERENCES handle from the Edit Reference List (Image 2–9) node. That's how you attach extra images as visual context.
  • mask - a MASK for 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 edited IMAGE tensor.
  • 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.

CategoryGPT Image Bridge

Inputs (12)

NameTypeDefaultDescription
providerGPT_IMAGE_PROVIDER
base_image(Image 1)IMAGE
promptSTRINGEdit this image
sizeCOMBOauto4 options: auto, 1024x1024, 1536x1024, 1024x1536
qualityCOMBOauto4 options: auto, low, medium, high
backgroundCOMBOauto3 options: auto, opaque, transparent
output_formatCOMBOpng3 options: png, jpeg, webp
moderationCOMBOauto2 options: auto, low
nINT11–8
timeout_secINT30030–3600
references(Image 2 开始)optGPT_IMAGE_REFERENCES
maskoptMASK

Outputs (3)

NameTypeDescription
imageIMAGE
revised_promptSTRING
request_reportSTRING