Nodes/Comfyui_Comfly/Comfly_gpt_image_edit
ComfyUI Node

Comfly_gpt_image_edit

Mask, Prompt, and Multi-Turn Edits

By ainewsto·Created 2 years ago·Updated 4 days ago· 362
Comfly_gpt_image_edit
  • image
  • mask
  • edited_image
  • response
  • chats
prompt
api_key
modelgpt-image-1
n1
qualityauto
sizeauto
seed0
clear_chatstrue
backgroundauto
output_compression100
output_formatpng
max_retries5
initial_timeout900
input_fidelitylow
partial_images0

The edit sibling in the GPT Image family. Where the plain Comfly_gpt_image node generates, this one changes: you hand it an image (and optionally a mask saying "only touch this area"), describe the alteration, and GPT Image does the rest. Same strong text-rendering and prompt-following as the generation node, applied to rework instead of creation.

Its superpower over a local inpaint is the same one as always with these closed models: it actually understands "change the shirt to a red flannel with the collar up" instead of pixel-blending in a vague reddish smear. If you've fought a local inpaint for an hour over a text-on-a-sign fix, you'll feel this in your bones.

How it works

Image + prompt (and optionally a MASK) go to the GPT Image API via the proxy. The mask tells it the region to regenerate; without a mask it edits the whole image. Result comes back as an IMAGE tensor plus a response string. And there's the conversation hook: the node exposes a chats output, and when you set clear_chats to false it keeps the conversation context - so you can re-edit your own previous output in a chain, same image, multiple rounds, like a back-and-forth with an artist instead of a one-shot.

The inputs that matter

  • image - the source you're editing. Required.
  • prompt - what to change. Precise language wins: "make the sign say OPEN, same font, same angle" beats "fix the sign."
  • mask - optional MASK input. Give it one for surgical region edits; skip it for whole-image rework.
  • model - gpt-image-1 / gpt-image-1.5, default gpt-image-1.
  • clear_chats - default true. Keep it true for one-shot edits; flip to false to enable the multi-turn chats workflow (editing previous results, stacking references).
  • input_fidelity - low (default) / high. High keeps the input closer to the original (better for subtle edits, slower); low gives the model more freedom.
  • partial_images - 03, default 0. How many of the output images feed back as reference for the next step. Bump it if you're chaining edits.
  • size / quality / background / output_format / output_compression - the standard GPT Image outputs config. transparent background is available here too, if you need an edited asset with alpha.
  • max_retries / initial_timeout - retry/timeout dials for flaky runs. Raise initial_timeout (default 900) if big edits keep dying on you.
  • seed - lock a take.

Outputs: edited_image (IMAGE), response (STRING), chats (STRING - the multi-turn context).

Install

Manager → Comfyui_Comfly, or:

cd ComfyUI/custom_nodes
git clone https://github.com/ainewsto/Comfyui_Comfly

Restart. Standard requirements.txt - no model downloads, GPU idle, key from ai.comfly.chat in Comflyapi.json or the node's api_key field.

Where people get burned

The clear_chats switch is the one that confuses people. If you edit, change your mind, and expect the same source to be re-edited, but you left clear_chats false from an earlier multi-turn run, the model can "remember" previous output instead of your fresh input - when in doubt, run one-shot edits with clear_chats true. And a real mask vs. no mask is the difference between a local edit and a full redraw; draw it, don't skip it. Finally, remember every round-trip in that multi-turn chat is another billed call - a 6-round conversation is 6 API calls, whatever it feels like in the graph.

CategoryComfly/Openai

Inputs (17)

NameTypeDefaultDescription
imageIMAGE
promptSTRING
maskoptMASK
api_keyoptSTRING
modeloptCOMBOgpt-image-12 options: gpt-image-1, gpt-image-1.5
noptINT11–10
qualityoptCOMBOauto4 options: auto, high, medium, low
sizeoptCOMBOauto4 options: auto, 1024x1024, 1536x1024, 1024x1536
seedoptINT00–18446744073709550000
clear_chatsoptBOOLEANtrue
backgroundoptCOMBOauto3 options: auto, transparent, opaque
output_compressionoptINT1000–100
output_formatoptCOMBOpng3 options: png, jpeg, webp
max_retriesoptINT51–10
initial_timeoutoptINT90060–1200
input_fidelityoptCOMBOlow2 options: low, high
partial_imagesoptCOMBO04 options: 0, 1, 2, 3

Outputs (3)

NameTypeDescription
edited_imageIMAGE
responseSTRING
chatsSTRING