Gemini 3.1 Flash Image (Nano Banana 2)
Gemini 3.1 Flash Image (Nano Banana 2) is the generally available flash-tier image generation and editing model in the Gemini 3.1 family, combining Google Image Search grounding, configurable thinking levels, and new video-to-image input with production-ready 1K and 2K output.
import { generateText } from 'ai'
const result = await generateText({ model: 'google/gemini-3.1-flash-image', prompt: 'Render a picture of a red balloon.',});Playground
Try out Gemini 3.1 Flash Image (Nano Banana 2) by Google. Usage is billed to your team at API rates. Free users (those who haven't made a payment) get $5 of credits every 30 days.
Your generated image will appear here
Providers
Route requests across multiple providers. Copy a provider slug to set your preference. Visit the docs for more info. Using a provider means you agree to their terms, listed under Legal.
| Provider |
|---|
P50 throughput on live AI Gateway traffic, in tokens per second (TPS). Visit the docs for more info.
P50 time to first token (TTFT) on live AI Gateway traffic, in milliseconds. View the docs for more info.
Direct request success rate on AI Gateway and per-provider. Visit the docs for more info.
More models by Google
| Model |
|---|
About Gemini 3.1 Flash Image (Nano Banana 2)
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 When Choosing a Provider
- Configuration: This is a multimodal model: call Gemini 3.1 Flash Image (Nano Banana 2) with
generateTextorstreamTextand setresponseModalities: ['TEXT', 'IMAGE']inproviderOptions.googleto 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. - Zero Data Retention: AI Gateway supports Zero Data Retention for this model via direct gateway requests (BYOK is not included). To configure this, check the documentation.
- Authentication: AI Gateway authenticates requests using an API key or OIDC token. You do not need to manage provider credentials directly.
When to Use Gemini 3.1 Flash Image (Nano Banana 2)
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
highthinking 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-001skips multimodal call patterns - Video Output Required: Generated clips need the Veo model family rather than still images
Conclusion
Gemini 3.1 Flash Image (Nano Banana 2) is the production target for flash-tier image generation on AI Gateway. Teams that built on the preview get the same search grounding, thinking control, and format flexibility behind a stable identifier, plus video-to-image input that no other Gemini image model offers. For image workloads that need current-subject accuracy and production reliability at flash cost, Gemini 3.1 Flash Image (Nano Banana 2) is the natural starting point in the family.