ComfyUI Node

✏️ Gemini Edit Turn

The node that makes 'make the cat from turn 3 bigger' actually work

By jeremieLouvaert·Created 5 months ago·Updated 15 days ago· 2
✏️ Gemini Edit Turn
  • session
  • reference_image
  • session
  • image
  • text
  • turn_count
instruction
aspect_ratio1:1
resolution2K

Here's the whole reason the ComfyUI-Gemini-Conversation-Canvas pack exists, in one node. ✏️ Gemini Edit Turn takes an existing Gemini conversation and asks it to change something - and because the model genuinely remembers everything it generated, the change lands on that image, not a fresh one. "Add a red umbrella to the person on the left" keeps the person, the left, and the scene you already had. That's the thing local pipelines need ControlNet, IP-Adapter, and a stack of inpainting masks to approximate.

How it works

Every edit is a real conversation turn, sent to Google's API with the full history of the session so far. Under the hood the node rebuilds the chat from the serialized history riding along inside the session object, appends your instruction (and optionally a reference_image), and the API returns the updated image. The new image is saved as the next turn_###.png in the session folder, the history is updated inside the session dict, and the same session object flows out the other side ready for the next Edit Turn.

That design is why you can do multi-step edits in a single workflow run - just chain them:

[Session Start] → [Edit Turn: "change to blue"] → [Edit Turn: "add sunset sky"] → [Session Save]

Each node in the chain gets the session from the previous one, so a whole scene-refinement sequence executes in one queue run. And the session persists across runs too: load a saved session, add edits, save again, and the model still knows what it drew last Tuesday.

Inputs that matter

  • session - the conversation state, from Session Start, Session Load, or a previous Edit Turn. There's no correct answer here beyond "always wire it."
  • instruction - your natural-language edit. This is where the quality lives: "add a red umbrella to the person on the left" beats "add umbrella," and the README's own tip - you can reference previous turns, like "make the cat from turn 3 larger" - is the feature people underestimate.
  • reference_image (optional) - an IMAGE sent along with the instruction. Handy when you want the model to match something specific rather than what it already generated.
  • aspect_ratio and resolution - both can change between turns, which is a genuinely neat trick: start 1:1, switch to 16:9 for a cinematic crop, and the model re-composes the existing scene rather than starting over. auto aspect ratio lets the model pick.

Outputs

session (pass it to the next Edit Turn, a Save node, or a Gallery node), image (the freshly edited IMAGE tensor), text (the model's reply, often a summary of what it changed), and turn_count (the new turn number).

Install and gotchas

Same story as the rest of the pack - install through ComfyUI Manager (search "Gemini Conversation Canvas") or:

cd ComfyUI/custom_nodes/
git clone https://github.com/jeremieLouvaert/ComfyUI-Gemini-Conversation-Canvas
pip install -r ComfyUI-Gemini-Conversation-Canvas/requirements.txt

Restart ComfyUI. No model files, just the google-genai, filelock, and Pillow dependencies.

The gotchas, from the source and the community's experience with Gemini's image models: each turn is a separate API call, so a long edit chain is a long chain of billed requests - keep chains tight. And Gemini's safety filters are strict; when a turn trips one you'll get a "No image generated" RuntimeError suggesting you rephrase or check content safety. It's the model being cautious, not the node being broken. The one real quality trap is the filter-then-iterate loop: if a scene keeps getting refused on later turns, an innocent edit like "add a person in the background" can trigger it, and there's no local fallback - that edit is simply gone unless you try again.

CategoryGemini Conversation Canvas

Inputs (5)

NameTypeDefaultDescription
session*Gemini session from Session Start or previous Edit Turn
instructionSTRINGNatural language edit instruction (e.g. 'add rain to the scene')
reference_imageoptIMAGEOptional reference image to include with the edit instruction
aspect_ratiooptCOMBO1:1Aspect ratio (can change between turns)
resolutionoptCOMBO2KOutput resolution (can change between turns)

Outputs (4)

NameTypeDescription
session*
imageIMAGE
textSTRING
turn_countINT