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 RatioResolutionTokens
1:11024x10241290
2:3832x12481290
3:21248x8321290
3:4864x11841290
4:31184x8641290
4:5896x11521290
5:41152x8961290
9:16768x13441290
16:91344x7681290
21:91536x6721290

Gemini 3 Pro - Resolution & Tokens

Aspect Ratio1K (1210 Tokens)2K (1210 Tokens)4K (2000 Tokens)
1:11024x10242048x20484096x4096
4:31200x8962400x17924800x3584
16:91376x7682752x15365504x3072
3:4896x12001792x24003584x4800
9:16768x13761536x27523072x5504
Note: 4K resolution (4096px) consumes significantly more tokens (2000) than 1K/2K resolutions.