> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yingtu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini 2.5 Flash Image parameters

> Build valid Gemini-native generation and editing requests for gemini-2.5-flash-image without unsupported image-size fields.

The prompt and optional source image belong in `contents[].parts[]`. This model
uses the shared Gemini-native body, with one important YingTu rule: omit
`generationConfig.imageConfig.imageSize`.

| Field                | Value for this model                |
| -------------------- | ----------------------------------- |
| Model path           | `gemini-2.5-flash-image`            |
| `responseModalities` | Include `IMAGE`; `TEXT` is optional |
| `aspectRatio`        | Optional; `1:1` was verified live   |
| `imageSize`          | Omit                                |
| `candidateCount`     | Omit or set to `1`                  |
| Top-level `n`        | Unsupported                         |
| YingTu price         | USD 0.020 per request               |

```json theme={"system"}
{
  "contents": [{
    "role": "user",
    "parts": [{"text": "A compact travel poster with one clear focal point"}]
  }],
  "generationConfig": {
    "responseModalities": ["TEXT", "IMAGE"],
    "imageConfig": {"aspectRatio": "1:1"}
  }
}
```

## Editing input

Add the source image after the instruction in the same `parts` array. Provide
raw Base64 bytes without a data-URL prefix and use the source file's real MIME
type.

```json theme={"system"}
{
  "contents": [{
    "role": "user",
    "parts": [
      {"text": "Keep the subject and replace the background with warm paper"},
      {"inlineData": {"mimeType": "image/png", "data": "BASE64_SOURCE_IMAGE"}}
    ]
  }],
  "generationConfig": {
    "responseModalities": ["TEXT", "IMAGE"],
    "imageConfig": {"aspectRatio": "1:1"}
  }
}
```

<Warning>
  Do not add `imageSize: "1K"` merely because the output is approximately 1K.
  Current YingTu parameter rules require that field to be absent for this model.
</Warning>

The verified responses used `role: "model"`, `finishReason: "STOP"`, and PNG
image data. Encoding is not guaranteed; always read `inlineData.mimeType`.
