openai / gpt-image-2 / editImage
Edit with gpt-image-2 from your ComfyUI graph — the model you'll never download
- images
- mask_image
- api_config
- images
- errors
- workflow_id
- raw_json
This is the node for the model you can't have: gpt-image-2 has no open weights, no local door, no download that will ever exist. The only way to use it is to call it - and this node calls it from inside your ComfyUI graph, running on Civitai's orchestration fleet (which routes it through fal), billed in Buzz. You get OpenAI's editing model sitting right next to your local nodes, wired into the same workflow.
The name is worth reading carefully: it's editImage, not create. You must supply an input image (the images input is required), and the model rewrites it to match your prompt. This is the whole point of gpt-image - instruction-driven photo editing at a quality level open models still chase. Add a mask_image and you get region-constrained editing: supply a mask along with your instruction (the API accepts a URL, data URL, or base64) and only that region changes while everything else holds. That mask-plus-instruction combo is what makes it feel like magic: "replace the background with a beach" while the subject stays untouched.
How it works
A thin client over Civitai's Orchestration API. Your images are converted to data URLs and sent with the prompt to the fleet, which forwards to OpenAI's model and returns the result - converted back into a native ComfyUI IMAGE tensor. The node long-polls (30-min default timeout), shows the workflow id and Buzz cost when done, and also exposes errors, workflow_id, and raw_json outputs for debugging.
The inputs that matter
- images (required,
IMAGE) - the source to edit. Wire aLoadImage(or a previous generation). - prompt (required, multiline) - the edit instruction. Be explicit; gpt-image follows instructions well but rewards specificity.
- mask_image (optional) - the editing region. Black = protected, white = editable. This is the single most powerful input on the node.
- quality -
low/medium/high, defaulthigh. High is the flagship output; low is for cheap drafts. - width / height - 256–3840. The tooltip says it plainly: leave them empty (blank = null) and the API infers output size from the input images; set both together if you want a specific output size.
- quantity - 1–4, default 1. Four billable jobs if you're not careful.
Install
Pack install: ComfyUI Manager → search "Civitai Comfy Nodes" (publisher civitai) → Install → restart. Or clone https://github.com/civitai/civitai-comfy-nodes.git into custom_nodes, pip install -r civitai-comfy-nodes/requirements.txt (just requests), restart.
Common issues
Credentials first: wire a Civitai Auth node into api_config or set CIVITAI_API_TOKEN (from civitai.com/user/account); headless installs need the env var.
Then the reality check on this one: your data leaves the machine and gets filtered by OpenAI's policy. gpt-image is a hosted, moderated model - there's no community bypass for refusals, and your prompt and image are processed by a service you don't control. If that's a dealbreaker, this isn't the node for you; if you're editing photos professionally, it's the best edit quality you can reach from a graph.
Cost is the other loud one - this is a premium closed model and every run is a Buzz charge. A full quantity: 4 batch of high quality is real money. Draft at low, verify, then spend.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| images | IMAGE | — | |
| output_formatopt | COMBO | 4 options: , jpeg, png, webP | |
| image_metadataopt | STRING | External metadata that will be stored with the image | |
| widthopt | INT | 1024256–3840 | When null, fal infers output size from the input images (image_size: "auto"). When set, the requested width is sent to fal as image_size.width. Both Width and Height must be set together, or both null. |
| heightopt | INT | 1024256–3840 | When null, fal infers output size from the input images (image_size: "auto"). When set, the requested height is sent to fal as image_size.height. Both Width and Height must be set together, or both null. |
| quantityopt | INT | 11–4 | — |
| qualityopt | COMBO | high | 3 options: low, medium, high |
| mask_imageopt | IMAGE | Either A URL, A DataURL or a Base64 string | |
| api_configopt | CIVITAI_CONFIG | Optional Civitai Auth connection; defaults to CIVITAI_API_TOKEN or stored OAuth login. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| errors | STRING | — |
| workflow_id | STRING | — |
| raw_json | STRING | — |