Google Gemini 2.5 Flash Image Preview Edit

Google Gemini 2.5 Flash Image Preview Edit

Playground

Try it on WaveSpeedAI!

Google Gemini 2.5 Flash Image Preview is an image-to-image editing model with advanced creative controls for precise image edits. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.

Features

Gemini 2.5 Flash Image is Google’s state-of-the-art image generation and editing model. It is a new variant of the Gemini 2.5 family, specifically designed for fast, conversational, and multi-turn creative workflows. This model is made available to developers through the Gemini API, Google AI Studio, and Vertex AI.

Key Features

  • Native Image Generation and Editing: Gemini 2.5 Flash Image is a multimodal model that natively understands and generates images. This allows for a seamless, unified workflow for creating and editing visuals.
  • Multi-image Fusion: This powerful feature allows you to combine multiple input images into a single, cohesive, new visual. For example, you can integrate a product into a new scene or restyle a room by merging images of different furniture and decor.
  • Character and Style Consistency: A significant advancement is the ability to maintain a consistent character, object, or style across multiple prompts and images. This is essential for storytelling, branding, and generating a series of cohesive assets without needing time-consuming fine-tuning.
  • Conversational Editing: The model enables precise, targeted edits using natural language. You can make specific changes like blurring a background, removing an object, altering a subject’s pose, or colorizing a black-and-white photo by simply describing the desired outcome.
  • Visual Reasoning: Gemini 2.5 Flash Image benefits from the Gemini model’s deep world knowledge. It can go beyond simple photorealism to perform complex tasks that require genuine understanding, such as interpreting hand-drawn diagrams, assisting with educational queries, and following multi-step instructions.
  • SynthID Watermarking: To promote responsible AI and transparency, all images created or edited with Gemini 2.5 Flash Image are embedded with an invisible digital watermark from SynthID. This watermark helps identify the content as AI-generated or edited.

Authentication

For authentication details, please refer to the Authentication Guide.

API Endpoints

Submit Task & Query Result

set -euo pipefail

export WAVESPEED_API_KEY="your-api-key"

REQUEST_BODY=$(cat <<'JSON'
{
  "prompt": "A cinematic ocean wave at sunrise, highly detailed",
  "images": [
    "https://interactive-examples.mdn.mozilla.net/media/cc0-images/painted-hand-298-332.jpg"
  ],
  "aspect_ratio": "1:1",
  "output_format": "png"
}
JSON
)

# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
  -X POST "https://api.wavespeed.ai/api/v3/google/gemini-2.5-flash-image-preview/edit" \
  -H "Authorization: Bearer ${WAVESPEED_API_KEY}" \
  -H "Content-Type: application/json" \
  -d "${REQUEST_BODY}")

TASK=$(printf '%s' "${SUBMIT_RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "${TASK}" | jq -r '.id // empty')
if [ -z "${PREDICTION_ID}" ]; then
  printf 'Submission response did not contain a prediction id
' >&2
  exit 1
fi
RESULT_URL=$(printf '%s' "${TASK}" | jq -r '.urls.get // empty')
if [ -z "${RESULT_URL}" ]; then RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/${PREDICTION_ID}/result"; fi

# 2. Poll until the prediction finishes.
while true; do
  RESPONSE=$(curl --silent --show-error --fail-with-body \
    "${RESULT_URL}" \
    -H "Authorization: Bearer ${WAVESPEED_API_KEY}")
  RESULT=$(printf '%s' "${RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
  STATUS=$(printf '%s' "${RESULT}" | jq -r '.status // empty')

  case "${STATUS}" in
    completed) printf '%s\n' "${RESULT}" | jq '.outputs'; break ;;
    failed|cancelled|timeout) printf '%s\n' "${RESULT}" | jq . >&2; exit 1 ;;
    created|processing) sleep 2 ;;
    *) printf 'Unexpected status: %s
' "${STATUS}" >&2; exit 1 ;;
  esac
done

Parameters

Task Submission Parameters

Request Parameters

ParameterTypeRequiredDefaultRangeDescription
promptstringYes-The positive prompt for the generation.
imagesarray<string>Yes-1 ~ 10 itemsList of URLs of input images for editing. Up to 10 images can be provided.
aspect_ratiostringNo-1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9The aspect ratio of the generated media.
output_formatstringNopngpng, jpegThe format of the output image.
enable_sync_modebooleanNofalse-If set to `true`, the request attempts to wait for the generated result and return outputs in the same response. If the result is not ready within the sync wait window, the API can return a timeout body while the task continues processing. This option is only available via the API and is supported only by some models.
enable_base64_outputbooleanNofalse-If set to `true`, the prediction's `output` strings are returned as **naked base64** (no `data:<mime>;base64,` prefix). When `false` (default), outputs are returned as URLs pointing to our CDN.

Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
data.idstringUnique identifier for the prediction, Task Id
data.modelstringModel ID used for the prediction
data.outputsarrayOutput values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed)
data.urlsobjectObject containing related API endpoints
data.urls.getstringURL to retrieve the prediction result
data.statusstringStatus of the task: created, processing, completed, or failed
data.created_atstringISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”)
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds

Result Request Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Task ID

Result Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
dataobjectThe prediction data object containing all details
data.idstringUnique identifier for the prediction
data.modelstringModel ID used for the prediction
data.outputsarray<string | object>Array of generated outputs (empty when status is not completed). Items are usually URL strings, but may be text strings or structured result objects, depending on the model.
data.urlsobjectObject containing related API endpoints
data.urls.getstringURL to poll for the prediction result
data.statusstringStatus: created, processing, completed, or failed
data.created_atstringISO timestamp of when the request was created
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds
© 2026 WaveSpeedAI. All rights reserved.