Comfly_gpt_image_edit
Mask, Prompt, and Multi-Turn Edits
- image
- mask
- edited_image
- response
- chats
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, defaultgpt-image-1. - clear_chats - default
true. Keep it true for one-shot edits; flip to false to enable the multi-turnchatsworkflow (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 -
0–3, default0. 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.
transparentbackground 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(default900) 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.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| prompt | STRING | — | |
| maskopt | MASK | — | |
| api_keyopt | STRING | — | |
| modelopt | COMBO | gpt-image-1 | 2 options: gpt-image-1, gpt-image-1.5 |
| nopt | INT | 11–10 | — |
| qualityopt | COMBO | auto | 4 options: auto, high, medium, low |
| sizeopt | COMBO | auto | 4 options: auto, 1024x1024, 1536x1024, 1024x1536 |
| seedopt | INT | 00–18446744073709550000 | — |
| clear_chatsopt | BOOLEAN | true | — |
| backgroundopt | COMBO | auto | 3 options: auto, transparent, opaque |
| output_compressionopt | INT | 1000–100 | — |
| output_formatopt | COMBO | png | 3 options: png, jpeg, webp |
| max_retriesopt | INT | 51–10 | — |
| initial_timeoutopt | INT | 90060–1200 | — |
| input_fidelityopt | COMBO | low | 2 options: low, high |
| partial_imagesopt | COMBO | 0 | 4 options: 0, 1, 2, 3 |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| edited_image | IMAGE | — |
| response | STRING | — |
| chats | STRING | — |