Gemini 3.1 Flash with image generation capabilities. High-efficiency image generation model with support for text rendering, reference images, search grounding, and thinking mode. The efficient counterpart to Gemini 3 Pro Image.
Capabilities
Details
gemini-3.1-flash-image-preview
Ready to integrate?
Access gemini-3.1-flash-image-preview via our unified API.
Providers & Pricing (4)
Nano Banana 2 is available from 4 providers, with per-image pricing starting at $0.0225 through fal.ai.
fal/gemini-3.1-flash-image-preview
Output
Pricing Notes (5)
- • $0.08 per image at 1K (standard rate)
- • 0.5K outputs charged at 0.75x ($0.06)
- • 2K outputs charged at 1.5x ($0.12)
- • 4K outputs charged at 2x ($0.16)
- • Web search adds $0.015 per request
replicate/gemini-3.1-flash-image-preview
Output
Pricing Notes (3)
- • $0.067 per output image at 1K
- • $0.101 per output image at 2K
- • $0.151 per output image at 4K
gemini/gemini-3.1-flash-image-preview
Input
Output
Pricing Notes (4)
- • $0.045 per output image at 512px (0.5K) (747 tokens)
- • $0.067 per output image at 1024x1024px (1K) (1120 tokens)
- • $0.101 per output image at 2048x2048px (2K) (1680 tokens)
- • $0.151 per output image at 4096x4096px (4K) (2520 tokens)
vertex/gemini-3.1-flash-image-preview
Input
Output
Pricing Notes (4)
- • $0.045 per output image at 512px (0.5K) (747 tokens)
- • $0.067 per output image at 1024x1024px (1K) (1120 tokens)
- • $0.101 per output image at 2048x2048px (2K) (1680 tokens)
- • $0.151 per output image at 4096x4096px (4K) (2520 tokens)
Provider Performance
Fastest generation through gemini at 13,298ms median latency with 91.6% success rate.
Aggregated from real API requests over the last 30 days.
Generation Time
Success Rate
Time to First Byte
Provider Rankings
| # | Provider | p50 Gen Time | p95 Gen Time | Success Rate | TTFB (p50) |
|---|---|---|---|---|---|
| 1 | gemini | 13,298ms | 24,656ms | 91.6% | 13,167ms |
| 2 | vertex | 29,915ms | 59,391ms | 76.7% | 29,412ms |
gemini-3.1-flash-image API OpenAI-compatible
Connect to Nano Banana 2 via the Lumenfall OpenAI-compatible API to integrate high-speed text-to-image generation and image editing into your workflow. The unified endpoint allows for programmatic creation of visual assets and precise modifications to existing images through a single interface.
https://api.lumenfall.ai/openai/v1
gemini-3.1-flash-image-preview
Text to Image Generate
Create images from text descriptions
curl -X POST \
https://api.lumenfall.ai/openai/v1/images/generations \
-H "Authorization: Bearer $LUMENFALL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-flash-image-preview",
"prompt": "A serene mountain landscape at sunset",
"size": "1024x1024"
}'
# Response:
# { "created": 1234567890, "data": [{ "url": "https://...", "revised_prompt": "..." }] }
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'YOUR_API_KEY',
baseURL: 'https://api.lumenfall.ai/openai/v1'
});
const response = await client.images.generate({
model: 'gemini-3.1-flash-image-preview',
prompt: 'A serene mountain landscape at sunset',
size: '1024x1024'
});
// { created: 1234567890, data: [{ url: "https://...", revised_prompt: "..." }] }
console.log(response.data[0].url);
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.lumenfall.ai/openai/v1"
)
response = client.images.generate(
model="gemini-3.1-flash-image-preview",
prompt="A serene mountain landscape at sunset",
size="1024x1024"
)
# { created: 1234567890, data: [{ url: "https://...", revised_prompt: "..." }] }
print(response.data[0].url)
Image Editing Edit
Transform existing images with text instructions
curl -X POST \
https://api.lumenfall.ai/openai/v1/images/edits \
-H "Authorization: Bearer $LUMENFALL_API_KEY" \
-F "model=gemini-3.1-flash-image-preview" \
-F "[email protected]" \
-F "prompt=Add a starry night sky to this image" \
-F "size=1024x1024"
# Response:
# { "created": 1234567890, "data": [{ "url": "https://...", "revised_prompt": "..." }] }
import OpenAI from 'openai';
import fs from 'fs';
const client = new OpenAI({
apiKey: 'YOUR_API_KEY',
baseURL: 'https://api.lumenfall.ai/openai/v1'
});
const response = await client.images.edit({
model: 'gemini-3.1-flash-image-preview',
image: fs.createReadStream('source.png'),
prompt: 'Add a starry night sky to this image',
size: '1024x1024'
});
// { created: 1234567890, data: [{ url: "https://...", revised_prompt: "..." }] }
console.log(response.data[0].url);
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.lumenfall.ai/openai/v1"
)
response = client.images.edit(
model="gemini-3.1-flash-image-preview",
image=open("source.png", "rb"),
prompt="Add a starry night sky to this image",
size="1024x1024"
)
# { created: 1234567890, data: [{ url: "https://...", revised_prompt: "..." }] }
print(response.data[0].url)
Benchmarks
Nano Banana 2 (Gemini 3.1 Flash Image) ranks #1 in text-to-image generation with an Elo of 1302 and #6 in image editing with an Elo of 1223. This high-efficiency model demonstrates top-tier performance against competitors, maintaining competitive rankings across both creative and technical generation tasks.
Competition Results
Studio Ghibli Anime Style
Image Editing“Transform this photo into a Studio Ghibli–inspired illustration. Use soft pastel colors, hand-painted textures, gentle lighting, dreamy backgrounds, and a warm, nostalgic mood”
Man and Car in California
Image Editing“Make a photo of the man driving the car down the California coastline”
Modern Clean Menu
Text-to-Image“Modern minimalist restaurant menu design, white background with colorful food photos in grid, sections for appetizers/pizza/mains, bold sans-serif fonts, vibrant accents, clean professional layout for casual dining.”
Adorable Baby Animals in Sunny Meadow
Text-to-Image“Hyper-photorealistic scene of fluffy baby animals—a golden retriever puppy, tabby kitten, baby bunny, and red fox kit—with big expressive eyes and ultra-detailed soft fur, playfully chasing butterflies and tumbling together in a lush wildflower meadow, warm golden sunrise light with god rays and dew sparkles, joyful wholesome vibe, 8K masterpiece.”
Vintage Cafe Logo
Text-to-Image“Vintage minimalist restaurant logo for "Caffè Florian", retro cloche dome with steam and "Est. 1720" banner, classic typography, warm brown and cream tones, subtle texture on light background, vector emblem style.”
Over-the-top cartoon caricature
Image Editing“Create a caricature of me and my job. Make it exaggerated and humorous, incorporating my profession as a tv show anchor and my love for dogs and hockey.”
Geometric Composition
Text-to-Image“A glass cube on a wooden table. Inside the cube is a small blue sphere. On top of the cube sits a red book. A green plant is behind the cube, partially visible through the glass. Soft window light from the left.”
Bald man challenge
Image Editing“Give the person a full, thick head of natural hair with realistic texture, density, and a natural hairline. Preserve facial features and lighting.”
Apollo 11: Journey to Tranquility
Text-to-Image“Create a clean, modern vector infographic poster about the Apollo 11 mission. NASA-inspired palette (navy, white, muted red, light gray). Flat-vector style, crisp lines, consistent iconography, subtle gradients only. Steps (stop at landing): 1. Launch (Saturn Vicon) 2. Earth Orbit (Earth + orbit ring icon) 3. Translunar (trajectory arc icon) 4. Lunar Orbit (Moon + orbit ring icon) 5. Descent (lunar module descending icon) 6. Landing (lunar module on the surface icon) Small supporting elements (minimal text): • Crew strip: three silhouette icons with only last names: Armstrong, Aldrin, Collins. • Landing site marker: Moon pin labeled "Tranquility" only. Layout constraints: generous margins, large readable labels, clean background with subtle stars. Vector-only, print-poster look, high resolution.”
Isometric Miniature Diorama Scenes
Text-to-Image“Create a clear, 45° top-down isometric miniature 3D cartoon scene of Japan's signature dish: sushi, with soft refined textures, realistic PBR materials, gentle lighting, on a small raised diorama base with minimal garnish and plate. Solid light blue background. At top-center: 'JAPAN' in large bold text, 'SUSHI' below it, small flag icon. Perfectly centered, ultra-clean, high-clarity, square format.”
Fantasy Warrior
Text-to-Image“Close portrait of a battle-worn paladin in ornate engraved plate armor, hair braided with small beads, faint scars and dirt on the skin, warm torchlight reflecting off metal, shallow depth of field, bokeh sparks, lifelike eyes, highly detailed texture on leather straps and cloth underlayer.”
Candid Street Photography
Text-to-Image“A candid street photo of an elderly Japanese man repairing a red bicycle in light rain, reflections on wet pavement, shallow depth of field, 50mm lens, natural skin texture, imperfect framing, motion blur from passing cars, cinematic but realistic, no stylization.”
Night Sky Transformation
Image Editing“Change the scene to night: a deep, dark sky with subtle, glistening stars visible behind the mountain.”
Best for
All categoriesGallery
View all 18 imagesNano Banana 2 FAQ
Nano Banana 2 starts at $0.0225 per image through Lumenfall. Pricing varies by provider. Lumenfall does not add any markup to provider pricing.
Nano Banana 2 supports Function calling, Structured output, Batch, Streaming, System prompt, Tool use, Grounding, Thinking, Code execution, and Json mode. It accepts text, image, audio, video, and file input and produces text and image output.
You can use Nano Banana 2 through Lumenfall's OpenAI-compatible API. Send requests to the unified endpoint with model ID "gemini-3.1-flash-image-preview". Code examples are available in Python, JavaScript, and cURL.
Nano Banana 2 is available through Gemini API, fal.ai, Vertex AI, and Replicate on Lumenfall. Lumenfall automatically routes requests to the best available provider.
Overview
Nano Banana 2 (slug: gemini-3.1-flash-image-preview) is a high-efficiency multimodal model developed by Google that bridges the gap between reasoning and visual synthesis. As the streamlined counterpart to the Gemini 3 Pro Image, it provides a unified interface for complex text generation and fast image creation. It is distinctive for its “Thinking Mode,” allowing the model to perform internal reasoning cycles before generating an image or structured text response.
Strengths
- High-Efficiency Generation: Optimized for speed and low latency, making it suitable for real-time applications where rapid image iteration is required.
- Complex Text Rendering: Excels at incorporating legible, accurate typography within generated images, a common failure point for many diffusion-based models.
- Deep Reasoning Integration: Features a native thinking mode that allows the model to process complex prompts, spatial relationships, and logical constraints before producing visual or textual output.
- Grounding and Tool Use: Supports search grounding and code execution, enabling the model to verify facts or perform calculations prior to generating content.
- Reference Image Support: Capable of using existing images as structural or stylistic guides to maintain consistency across generated assets.
Limitations
- Efficiency vs. Fidelity: While fast, it may lack the extreme aesthetic refinement and intricate textural detail found in the larger Gemini 3 Pro Image model.
- Preview Status: As a preview release, the model may exhibit occasional inconsistencies in following highly nuanced stylistic prompts compared to more mature, production-stable versions.
- Context Overhead: The use of internal reasoning (Thinking Mode) can increase processing time for simple tasks where a direct generation would have sufficed.
Technical Background
Part of the Gemini 3.1 Flash family, this model utilizes a multimodal transformer architecture trained for both discriminative and generative tasks. It integrates a latent diffusion-based image generation head directly into the language model pipeline, allowing for seamless transitions between modalities. By employing a “distilled” training approach, Google has optimized the model for high throughput while retaining the core reasoning capabilities of the Gemini 3.1 architecture.
Best For
Nano Banana 2 is ideal for building interactive design tools, rapid prototyping of social media assets, and automated content pipelines where both text and imagery are required. Its support for structured output and JSON mode makes it an excellent choice for developers needing to programmatically control visual attributes. You can experiment with these multimodal features and integrate them into your workflow through Lumenfall’s unified API and playground.
Top Matchups
See how Nano Banana 2 performs head-to-head against other AI image models, ranked by community votes in blind comparisons.
vs FLUX.2 [dev] Turbo
Geometric Composition
50% W · 50% L
vs Nano Banana Pro
Isometric Miniature Diorama Scenes
0% W · 100% L
vs Seedream 5.0 Lite
Over-the-top cartoon caricature
50% W · 50% L
vs GPT Image 1.5
Vintage Cafe Logo
100% W · 0% L
vs Nano Banana Pro
Man and Car in California
0% W · 100% L
Try Nano Banana 2 in Playground
Generate images with custom prompts — no API key needed.