# Gemini 3.1 Flash Image (Nano Banana 2)

Gemini 3.1 Flash Image (Nano Banana 2) is the GA release of the flash-tier image model in the Gemini 3.1 generation, pairing search-grounded generation and configurable thinking depth with a video-to-image capability no other Gemini image model offers.

- **Model ID:** `google/gemini-3.1-flash-image`
- **Type:** chat
- **Providers:** vertex, google
- **Context window:** 131,072
- **Maximum output tokens:** 32,768
- **Pricing:** $0.5/1M input tokens, $3/1M output tokens
- **Canonical page:** https://vercel.com/ai-gateway/models/gemini-3.1-flash-image

## Supported parameters

- **Parameters:** Not reported
- **Operations:** Not reported
- **Input modalities:** `text`, `image`, `audio`
- **Output modalities:** `text`, `image`
- **Aspect ratios:** Not reported
- **Resolutions:** Not reported
- **Durations:** Not reported
- **Frame rates:** Not reported
- **Maximum outputs per request:** Not reported
- **Maximum input images:** Not reported
- **Input image formats:** Not reported
- **Maximum input image size:** 7 MB

## Example

```ts
import { generateText } from 'ai'

const result = await generateText({
  model: 'google/gemini-3.1-flash-image',
  prompt: 'Render a picture of a red balloon.',
});
```

## About

Gemini 3.1 Flash Image (Nano Banana 2) is the general-availability release of the flash-tier image model in the Gemini 3.1 generation, released May 28, 2026. Gemini 3.1 Flash Image (Nano Banana 2) replaces `google/gemini-3.1-flash-image-preview`, which Google deprecated after the GA launch, and serves as the generalist of the Nano Banana family: the balance point between the pro tier's fidelity and the lite tier's speed.

The capabilities introduced in the preview carry into the GA model. Google Image Search grounding lets Gemini 3.1 Flash Image (Nano Banana 2) retrieve live visual reference data at generation time, improving accuracy on lesser-known landmarks, branded objects, and recent subjects. Configurable thinking levels (`minimal` and `high`) control how much Gemini 3.1 Flash Image (Nano Banana 2) reasons before rendering, and output options span 512p resolution plus narrow 1:4 and 1:8 aspect ratios alongside standard formats.

GA adds video-to-image input, a capability exclusive to Gemini 3.1 Flash Image (Nano Banana 2) among Google's image models. Pass a video file via direct upload or as a public YouTube URL, and Gemini 3.1 Flash Image (Nano Banana 2) analyzes the visual context, subjects, and actions in the footage to generate context-aware images such as thumbnails, posters, and infographics. The feature is in preview on Google's side, as is 4K output; 1K and 2K output are generally available.

Every generated image carries an invisible SynthID watermark for downstream identification of AI-generated content. Gemini 3.1 Flash Image (Nano Banana 2) accepts prompts within a context window of 131.1K tokens and returns text and images in the same multimodal response, with per-image billing by output resolution.

## What to consider

This is a multimodal model: call Gemini 3.1 Flash Image (Nano Banana 2) with `generateText` or `streamText` and set `responseModalities: ['TEXT', 'IMAGE']` in `providerOptions.google` to receive image output. Image generation is priced per image by output resolution, and text follows per-token rates; see the pricing panel on this page for current numbers. Note that 4K output and video input are preview capabilities on Google's side, while 1K and 2K output are generally available.

## When to use

### Best For
- **Production Image Workloads:** Teams that need the flash-tier balance of quality, speed, and cost behind a stable GA identifier
- **Video-Derived Imagery:** Thumbnails, posters, and infographics generated from uploaded video files or public YouTube URLs
- **Search-Grounded Generation:** Real-world landmarks, products, and recent subjects rendered with live Google Image Search data
- **Technical Diagrams and Infographics:** Compositions where the `high` thinking level improves spatial reasoning and label placement
- **Mixed Text and Image Output:** Single multimodal responses that return prose and generated images together

### Consider Alternatives When
- **Highest Visual Fidelity:** Professional compositing and fine-detail work favor `google/gemini-3-pro-image`
- **Maximum Speed and Volume:** High-throughput pipelines run at lower cost on `google/gemini-3.1-flash-lite-image`
- **Pure Image Generation API:** A dedicated text-to-image model like `google/imagen-4.0-generate-001` skips multimodal call patterns
- **Video Output Required:** Generated clips need the Veo model family rather than still images

## Best for

- **Production Image Workloads:** Teams that need the flash-tier balance of quality, speed, and cost behind a stable GA identifier
- **Video-Derived Imagery:** Thumbnails, posters, and infographics generated from uploaded video files or public YouTube URLs
- **Search-Grounded Generation:** Real-world landmarks, products, and recent subjects rendered with live Google Image Search data
- **Technical Diagrams and Infographics:** Compositions where the `high` thinking level improves spatial reasoning and label placement
- **Mixed Text and Image Output:** Single multimodal responses that return prose and generated images together

## Consider alternatives

- **Highest Visual Fidelity:** Professional compositing and fine-detail work favor `google/gemini-3-pro-image`
- **Maximum Speed and Volume:** High-throughput pipelines run at lower cost on `google/gemini-3.1-flash-lite-image`
- **Pure Image Generation API:** A dedicated text-to-image model like `google/imagen-4.0-generate-001` skips multimodal call patterns
- **Video Output Required:** Generated clips need the Veo model family rather than still images

## Frequently asked questions

### How is Gemini 3.1 Flash Image (Nano Banana 2) different from `google/gemini-3.1-flash-image-preview`?

Gemini 3.1 Flash Image (Nano Banana 2) is the general-availability release of the same flash-tier image model. Google deprecated the preview identifier after the GA launch, so new and existing production work should target Gemini 3.1 Flash Image (Nano Banana 2). Video-to-image input is also available only on the GA model.

### How does video-to-image input work?

Pass a video file, either via direct upload or as a public YouTube URL, alongside a text prompt. Gemini 3.1 Flash Image (Nano Banana 2) analyzes the visual context, subjects, and actions in the footage to generate context-aware images such as thumbnails, posters, and infographics. The capability is in preview on Google's side.

### Do I need to set `responseModalities` to get images?

Yes. Include `responseModalities: ['TEXT', 'IMAGE']` in `providerOptions.google` when calling `generateText` or `streamText`. Without this setting, Gemini 3.1 Flash Image (Nano Banana 2) returns text only.

### What resolutions does Gemini 3.1 Flash Image (Nano Banana 2) support?

Output spans 512p through 4K, priced per image by resolution. 1K and 2K output are generally available from Google, while 4K remains in preview. See the pricing panel on this page for per-resolution rates.

### What thinking levels does Gemini 3.1 Flash Image (Nano Banana 2) support?

`minimal` and `high`, set through `thinkingConfig.thinkingLevel` in `providerOptions.google`. Use `minimal` for speed on straightforward prompts and `high` for complex compositions, diagrams, and prompts that benefit from reasoning before rendering.

### How does Gemini 3.1 Flash Image (Nano Banana 2) compare to Gemini 3 Pro Image?

Gemini 3 Pro Image targets complex, professional work where accuracy outweighs speed. Gemini 3.1 Flash Image (Nano Banana 2) is the generalist in the family, balancing quality, latency, and cost for production workloads, and is the only Gemini image model that accepts video input.

### How do I call Gemini 3.1 Flash Image (Nano Banana 2) on AI Gateway?

Set the model to `google/gemini-3.1-flash-image` in the AI SDK and include the image response modality in provider options. AI Gateway handles provider routing, retries, and failover automatically.

### How does Zero Data Retention work with Gemini 3.1 Flash Image (Nano Banana 2) through AI Gateway?

Yes, Zero Data Retention is available for this model. Zero Data Retention is offered on a per-provider basis. See https://vercel.com/docs/ai-gateway/capabilities/zdr for details.

## Links

- [Model page](https://vercel.com/ai-gateway/models/gemini-3.1-flash-image)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://docs.cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/3-1-flash-image)
- [Provider pricing](https://cloud.google.com/vertex-ai/generative-ai/pricing)
