> ## 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 3.1 Flash Image 参数

> 配置 Nano Banana 2 的 1K、2K、4K 生成、编辑和计费档位。

| 项目               | 当前规则                          |
| ---------------- | ----------------------------- |
| 模型 ID            | `gemini-3.1-flash-image`      |
| `imageSize`      | `1K`、`2K`、`4K`；省略按 1K         |
| `aspectRatio`    | 可选；已实测 `1:1`                  |
| `candidateCount` | 省略或设为 `1`                     |
| 1K/2K/4K 价格      | USD 0.025/USD 0.037/USD 0.055 |

```json theme={"system"}
{
  "contents": [{"role": "user", "parts": [{"text": "具有清晰留白的编辑产品场景"}]}],
  "generationConfig": {
    "responseModalities": ["TEXT", "IMAGE"],
    "imageConfig": {"aspectRatio": "4:3", "imageSize": "2K"}
  }
}
```

## 尺寸决定成本

* 1K 适合迭代、缩略图和多数应用界面。
* 2K 适合需要更多工作像素的产品图和编辑资产。
* 4K 只适合最终交付确实会使用额外像素的任务。

计费依据是请求档位，不是压缩后的文件体积。尺寸值必须大写，并位于
`generationConfig.imageConfig` 内。

编辑请求可接受 JPEG 来源；把真实 MIME 与 Base64 字节放入 `inlineData`。

<Warning>不要从模型 ID 推断输出格式。本次返回 JPEG，后续仍以响应 MIME 为准。</Warning>
