Skip to main content
Gemini 3.1 Flash Image, also known as Nano Banana 2, is the general-purpose image generation and editing model for workflows that need more flexibility than a 1K-only model. Its API model ID is gemini-3.1-flash-image. The model supports synchronous generation, asynchronous tasks, multiple reference images, three output tiers, and fourteen aspect ratios. That combination makes it a practical starting point for most new Nano Banana integrations.

Gemini 3.1 Flash Image capabilities

One model for drafts and final assets

Use 1K for prompt iteration and web assets, 2K for design work and product imagery, and 4K when the final deliverable will use the additional pixels. Changing the output tier does not require changing the model ID or request format.

Layout flexibility

The model includes common square, portrait, and landscape formats plus 1:4, 1:8, 4:1, and 8:1 for banners, long-form graphics, and unusual canvases.

Generation and editing in the same protocol

A text-to-image request contains a text part. An edit request adds one inlineData source image beside the instruction in contents[].parts[]. Both use the same generateContent schema. Google positions the upstream model around a balance of quality, speed, high-volume use, ratio adherence, and multilingual text rendering. See the Gemini 3.1 Flash Image model page.

Current API controls

Google’s upstream documentation also describes a 0.5K tier. The current gateway contract exposes only 1K, 2K, and 4K, so requests must not send 0.5K. The parameters page lists every accepted ratio and field location.

Workloads and model alternatives

Gemini 3.1 Flash Image is suited to product scenes, marketing assets, editorial images, social content, background replacement, and design pipelines that may move between resolutions. Choose another model when the constraint is clearer:
  • use gemini-3.1-flash-lite-image for a permanently 1K workflow that prioritizes an efficiency-focused model;
  • compare gemini-3-pro-image when complex typography, professional layouts, or high-value assets justify a premium request;
  • keep gemini-2.5-flash-image only while migrating a legacy integration.
The Nano Banana comparison separates lifecycle, output flexibility, and relative cost without treating one model as a universal quality winner. Use the dated pricing page for the current request price and traffic capacity and availability for gateway RPM, upstream 429, and availability scope. Neither page promises a fixed number of completed images per minute.

Response handling

The image is returned as Base64 in an inlineData part. A response may include both text and image parts, so clients must iterate through all candidates[].content.parts[] entries. Use inlineData.mimeType to choose the file format rather than hard-coding JPEG or PNG. For requests that can keep an HTTP connection open, use :generateContent. Queue-based systems, browser workflows, and clients behind shorter proxy timeouts should submit /v1/images/tasks with action=generate|edit and poll with a bounded deadline.

Start an integration

Review Flash parameters

Choose the output tier, aspect ratio, response type, and edit input.

Run complete examples

Generate, queue, edit, and save the returned image.
Last modified on September 3, 2026