Nodes/civitai-comfy-nodes/openai / gpt-image-2 / editImage
ComfyUI Node

openai / gpt-image-2 / editImage

Edit with gpt-image-2 from your ComfyUI graph — the model you'll never download

By civitai·Created 2 months ago·Updated about a month ago· 42
openai / gpt-image-2 / editImage
  • images
  • mask_image
  • api_config
  • images
  • errors
  • workflow_id
  • raw_json
prompt
output_format
image_metadata
width1024
height1024
quantity1
qualityhigh

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 a LoadImage (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, default high. 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.

CategoryCivitai/Image/openai

Inputs (10)

NameTypeDefaultDescription
promptSTRING
imagesIMAGE
output_formatoptCOMBO4 options: , jpeg, png, webP
image_metadataoptSTRINGExternal metadata that will be stored with the image
widthoptINT1024256–3840When 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.
heightoptINT1024256–3840When 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.
quantityoptINT11–4
qualityoptCOMBOhigh3 options: low, medium, high
mask_imageoptIMAGEEither A URL, A DataURL or a Base64 string
api_configoptCIVITAI_CONFIGOptional Civitai Auth connection; defaults to CIVITAI_API_TOKEN or stored OAuth login.

Outputs (4)

NameTypeDescription
imagesIMAGE
errorsSTRING
workflow_idSTRING
raw_jsonSTRING