OpenAI Image Edit
Gpt-image inpainting and edits straight from your graph
- client
- images
- mask
- extra_body
- image
- response
OpenAI Image Edit is the pack's paid-API shortcut: it sends your image (and optionally a mask) to OpenAI's gpt-image editing endpoint and gets back a finished edit - no local model, no VRAM, just money. If you've ever wanted the polish of a frontier image model mid-workflow without running a 12B model locally, this is the node. It pairs with the pack's Create OpenAI Client, which handles the key and the HTTP plumbing.
This is the edit half, so it's built for instruction-style changes: "change the background," "make the person smile," "replace the car with a bicycle." If you feed it a mask, it becomes inpainting - the model only touches the masked region. No mask, and it's a full-image edit where the prompt rules. Either way, the heavy lifting happens on OpenAI's servers, so the node is really just a well-formed API call plus image decoding back to a ComfyUI tensor.
What you set
- client - an
OPENAI_CLIENTfromCreate OpenAI Client. Required; there's no bypass. - images - what you're editing. A tensor from any image source.
- prompt - the instruction. This is 90% of the quality right here.
- mask (optional) - restrict edits to a region. Must match the image's dimensions.
- model - defaults to
gpt-image-2;gpt-image-1,gpt-image-1.5,gpt-image-1-mini, anddall-e-2are the other options. - size -
autolets the model pick, or force one of the presets like1024x1024or2048x2048;customlets you type your own. - background, input_fidelity, quality, output_format - the expected gpt-image controls for transparency, how closely to stick to the source, and output encoding.
Two outputs: image (the edited tensor, ready for a Save Image node) and response (the raw API response object, useful if you want the model name or metadata that got used).
Install
ComfyUI Manager → "Duanyll Nodepack" → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/Duanyll/duanyll_nodepack
cd duanyll_nodepack && pip install -r requirements.txt
The pack's requirements pull in opencv-python-headless, kornia, insightface, matplotlib, and the Volcengine Ark SDK regardless - this node only genuinely needs requests.
The fine print nobody tells you
This costs real money, per image, and the n input (up to 10) multiplies that. Watch it. Also, gpt-image edits run at a fixed native resolution and get resized to match the API's requirements, so if your input is odd-sized, expect the result to come back at a different resolution than you sent - check size if that matters.
The other gotcha is the upload path. The client it depends on supports two upload modes, multipart_form (default) and json_base64; the field name matters for some OpenAI-compatible proxies, so if a third-party endpoint keeps rejecting your requests, flip image_upload_mode and the multipart_image_field on the client node and retry.
The honest framing: this is an obscure pack, and nobody's writing guides about it. For a genuinely local alternative you'd run Flux Kontext or Qwen-Image-Edit (both of which this pack also touches) - but if you specifically want the gpt-image results in your workflow, this is the only path, and it works.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| client | OPENAI_CLIENT | — | |
| images | IMAGE | — | |
| prompt | STRING | — | |
| maskopt | MASK | — | |
| modelopt | COMBO | gpt-image-2 | 5 options: gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini, dall-e-2 |
| sizeopt | COMBO | auto | 11 options: auto, custom, 1024x1024, 1536x1024, 1024x1536, 2048x2048, +5 |
| custom_sizeopt | STRING | — | |
| qualityopt | COMBO | auto | 5 options: auto, high, medium, low, standard |
| backgroundopt | COMBO | auto | 3 options: auto, transparent, opaque |
| input_fidelityopt | COMBO | auto | 3 options: auto, high, low |
| output_formatopt | COMBO | auto | 4 options: auto, png, jpeg, webp |
| output_compressionopt | INT | 1000–100 | — |
| moderationopt | COMBO | auto | 2 options: auto, low |
| nopt | INT | 11–10 | — |
| useropt | STRING | — | |
| extra_bodyopt | * | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| response | * | — |