Gemini 2.5 Flash Image ( gemini-2.5-flash-image
) supports
improved editing of images and multi-turn editing, and contains updated safety
filters that provide a more flexible and less restrictive user experience.
For more information about model capabilities, see Gemini models .
Edit an image
Console
To edit images, do the following:
- Open Vertex AI Studio > Create prompt .
- Click Switch model
and select one of the following models from the
menu:
-
gemini-2.5-flash-image -
gemini-3-pro-image-preview
-
- In the Outputs panel, select Image and text from the drop-down menu.
- Click Insert media ( ) and select a source from the menu, then follow the dialog's instructions.
- Write what edits you want to make to the image in the Write a prompt text area.
- Click the Prompt ( ) button.
Gemini generates an edited version of the provided image based on your description. This process takes a few seconds, but can be comparatively slower depending on capacity.
Python
Install
pip install --upgrade google-genai
To learn more, see the SDK reference documentation .
Set environment variables to use the Gen AI SDK with Vertex AI:
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values # with appropriate values for your project. export GOOGLE_CLOUD_PROJECT = GOOGLE_CLOUD_PROJECT export GOOGLE_CLOUD_LOCATION = global export GOOGLE_GENAI_USE_VERTEXAI = True
Java
Learn how to install or update the Java .
To learn more, see the SDK reference documentation .
Set environment variables to use the Gen AI SDK with Vertex AI:
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values # with appropriate values for your project. export GOOGLE_CLOUD_PROJECT = GOOGLE_CLOUD_PROJECT export GOOGLE_CLOUD_LOCATION = global export GOOGLE_GENAI_USE_VERTEXAI = True
Go
Learn how to install or update the Go .
To learn more, see the SDK reference documentation .
Set environment variables to use the Gen AI SDK with Vertex AI:
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values # with appropriate values for your project. export GOOGLE_CLOUD_PROJECT = GOOGLE_CLOUD_PROJECT export GOOGLE_CLOUD_LOCATION = global export GOOGLE_GENAI_USE_VERTEXAI = True
Node.js
Install
npm install @google/genai
To learn more, see the SDK reference documentation .
Set environment variables to use the Gen AI SDK with Vertex AI:
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values # with appropriate values for your project. export GOOGLE_CLOUD_PROJECT = GOOGLE_CLOUD_PROJECT export GOOGLE_CLOUD_LOCATION = global export GOOGLE_GENAI_USE_VERTEXAI = True
REST
Run the following command in the terminal to create or overwrite this file in the current directory:
curl
-X
POST
\
-H
"Authorization: Bearer
$(
gcloud
auth
print-access-token )
"
\
-H
"Content-Type: application/json"
\
https:// ${
API_ENDPOINT
}
:generateContent
\
-d
'{
"contents": {
"role": "USER",
"parts": [
{"fileData": {
"mimeType": "image/jpg",
"fileUri": " FILE_NAME
"
}
},
{"text": "Convert this photo to black and white, in a cartoonish style."},
]
},
"generationConfig": {
"responseModalities": ["TEXT", "IMAGE"],
"imageConfig": {
"aspectRatio": "16:9",
},
},
"safetySettings": {
"method": "PROBABILITY",
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
},
}'
2
>/dev/null
>response.json
Gemini 2.5 Flash Image supports the following aspect ratios: 1:1
, 3:2
, 2:3
, 3:4
, 4:3
, 4:5
, 5:4
, 9:16
, 16:9
, and 21:9
.
Gemini generates an image based on your description. This process takes a few seconds, but can be comparatively slower depending on capacity.
Multi-turn image editing
Gemini 2.5 Flash Image and Gemini 3 Pro Image support improved multi-turn editing, which lets you respond to the model with changes after receiving an edited image response.
We recommended limiting the entire request file size to 50MB maximum.
To test out multi-turn image editing, see the following notebooks:
To see code samples related to multi-turn image creation and editing using Gemini 3 Pro Image, see Example of multi-turn image editing using thought signatures .
What's next?
See the following links for more information about Gemini image generation:

