Skip to content
Dashboard

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.

Image GenImplicit CachingReasoningVision (Image)Web Search
index.ts
import { generateText } from 'ai'
const result = await generateText({
model: 'google/gemini-3.1-flash-image',
prompt: 'Render a picture of a red balloon.',
});

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.