Multi-turn Refinement

Iteratively refine images through conversation

Gemini 3 Pro supports multi-turn image editing, allowing you to refine images conversationally. You can request changes, translate text within images, or adjust styles without starting from scratch.

Conversational Editing

Modify images using natural language follow-ups

Consistent Context

Model remembers previous image state

1

1. Initial Creation

Start a chat session and generate the initial image. In this example, we create an educational infographic.

Python - Step 1: Create Infographic
from google import genai
from google.genai import types

client = genai.Client()

# Initialize chat with image generation config
chat = client.chats.create(
    model="gemini-3-pro-image-preview",
    config=types.GenerateContentConfig(
        response_modalities=['TEXT', 'IMAGE'],
        tools=[{"google_search": {}}]
    )
)

# Initial prompt
message = """Create a vibrant infographic that explains photosynthesis 
as if it were a recipe for a plant's favorite food. 
Show the 'ingredients' (sunlight, water, CO2) and the 'finished dish' (sugar/energy). 
The style should be like a page from a colorful kids' cookbook."""

response = chat.send_message(message)

for part in response.parts:
    if image:= part.as_image():
        image.save("photosynthesis.png")
2

2. Iterative Refinement

Send a follow-up message to modify the image. The model maintains the context and style of the original image.

Example: Language Localization

Update the text in the infographic from English to Spanish while keeping the visual style exactly the same.

Python - Step 2: Modify Text Language
# Continue the same chat session
message = "Update this infographic to be in Spanish. Do not change any other elements of the image."

# You can update config for the new turn
aspect_ratio = "16:9"
resolution = "2K"

response = chat.send_message(message,
    config=types.GenerateContentConfig(
        image_config=types.ImageConfig(
            aspect_ratio=aspect_ratio,
            image_size=resolution
        ),
    ))

for part in response.parts:
    if image:= part.as_image():
        image.save("photosynthesis_spanish.png")

Best Practices

Be Specific

Clearly state what should change AND what should stay the same (e.g., 'Do not change the background').

One Change at a Time

For complex edits, make one change per turn to ensure better control over the result.

Check History

The model uses chat history. If an edit goes wrong, you might need to restart or clear history.