Settings & Tokens
Configuration options and cost details
Output Type
By default, the model returns both text and images. You can configure it to return only images to save bandwidth or simplify processing.
Python - Image Only Response
response = client.models.generate_content(
model="gemini-2.5-flash-image",
contents=[prompt],
config=types.GenerateContentConfig(
response_modalities=['Image']
)
)Aspect Ratios
Control the shape of your generated images using the aspect_ratio field. If not specified, it defaults to 1:1 (square).
Python - Set 16:9 Aspect Ratio
config=types.GenerateContentConfig(
image_config=types.ImageConfig(
aspect_ratio="16:9"
)
)Gemini 2.5 Flash - Resolution & Tokens
| Aspect Ratio | Resolution | Tokens |
|---|---|---|
| 1:1 | 1024x1024 | 1290 |
| 2:3 | 832x1248 | 1290 |
| 3:2 | 1248x832 | 1290 |
| 3:4 | 864x1184 | 1290 |
| 4:3 | 1184x864 | 1290 |
| 4:5 | 896x1152 | 1290 |
| 5:4 | 1152x896 | 1290 |
| 9:16 | 768x1344 | 1290 |
| 16:9 | 1344x768 | 1290 |
| 21:9 | 1536x672 | 1290 |
Gemini 3 Pro - Resolution & Tokens
| Aspect Ratio | 1K (1210 Tokens) | 2K (1210 Tokens) | 4K (2000 Tokens) |
|---|---|---|---|
| 1:1 | 1024x1024 | 2048x2048 | 4096x4096 |
| 4:3 | 1200x896 | 2400x1792 | 4800x3584 |
| 16:9 | 1376x768 | 2752x1536 | 5504x3072 |
| 3:4 | 896x1200 | 1792x2400 | 3584x4800 |
| 9:16 | 768x1376 | 1536x2752 | 3072x5504 |
Note: 4K resolution (4096px) consumes significantly more tokens (2000) than 1K/2K resolutions.