“Make a photo of the man driving the car down the California coastline”
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.
Starting from
Batch from $0.022/image via Gemini API, Vertex AI
Popular formats
Prices shown are in USD
See all providersProvider Performance
Fastest generation through gemini at 25,839ms median latency with 73.7% 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 | 25,839ms | 42,574ms | 73.7% | 24,248ms |
| 2 | replicate | 30,023ms | 51,892ms | 40.9% | 30,023ms |
| 3 | vertex | 45,061ms | 105,302ms | 35.8% | 43,959ms |
| 4 | fal | 48,044ms | 102,396ms | 86.5% | 48,155ms |
Providers & Pricing (5)
Nano Banana 2 is available from 5 providers, with per-image pricing starting at $0.0225 through fal.ai.
All modes
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
fal/gemini-3.1-flash-image-preview-edit
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)
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
Code Examples
Text to Image
/v1/images/generationscurl -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": "",
"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: '',
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="",
size="1024x1024"
)
# { created: 1234567890, data: [{ url: "https://...", revised_prompt: "..." }] }
print(response.data[0].url)
Image Edit
/v1/images/editsParameter Reference
Core Parameters
| Parameter | Type | Description | Modes |
|---|---|---|---|
prompt
|
string | Required. Text prompt for image generation |
T2I
Edit
|
seed
|
integer | Random seed for reproducibility |
T2I
Edit
|
Size & Layout
| Parameter | Type | Description | Modes |
|---|---|---|---|
size
|
string |
Image dimensions as WxH pixels (e.g. "1024x1024") or aspect ratio (e.g. "16:9")
WxH determines both shape and scale (aspect_ratio and resolution are ignored when size is provided). W:H format is equivalent to aspect_ratio.
|
T2I
Edit
|
aspect_ratio
|
string |
Aspect ratio of the output image (e.g. "16:9", "1:1")
Controls shape independently of scale. Use with resolution to control both. If size is also provided, size takes precedence. Any ratio is accepted and mapped to the nearest supported value.
|
T2I
Edit
|
resolution
|
string |
Output resolution tier (e.g. "1K", "4K")
auto
0.5K
1K
2K
4K
Controls scale independently of shape. Higher tiers produce larger images and cost more. If size is also provided, size takes precedence for scale. Any tier is accepted and mapped to the nearest supported value.
|
T2I
Edit
|
| Output |
size
|
aspect_ratio
+
resolution
|
|
|---|---|---|---|
| Flexible | |||
| Auto | "auto" |
— | Model chooses optimal dimensions |
0.5K 14 sizes
| Output |
size
|
aspect_ratio
+
resolution
|
|
|---|---|---|---|
| 573 × 458 | "573x458" |
or |
"5:4"
+
"0.5K"
|
| 384 × 683 | "384x683" |
or |
"9:16"
+
"0.5K"
|
| 683 × 384 | "683x384" |
or |
"16:9"
+
"0.5K"
|
| 256 × 1024 | "256x1024" |
or |
"1:4"
+
"0.5K"
|
| 512 × 512 | "512x512" |
or |
"1:1"
+
"0.5K"
|
| 1024 × 256 | "1024x256" |
or |
"4:1"
+
"0.5K"
|
| 181 × 1448 | "181x1448" |
or |
"1:8"
+
"0.5K"
|
| 1448 × 181 | "1448x181" |
or |
"8:1"
+
"0.5K"
|
| 418 × 627 | "418x627" |
or |
"2:3"
+
"0.5K"
|
| 627 × 418 | "627x418" |
or |
"3:2"
+
"0.5K"
|
| 458 × 572 | "458x572" |
or |
"4:5"
+
"0.5K"
|
| 782 × 335 | "782x335" |
or |
"21:9"
+
"0.5K"
|
| 443 × 591 | "443x591" |
or |
"3:4"
+
"0.5K"
|
| 591 × 443 | "591x443" |
or |
"4:3"
+
"0.5K"
|
1K 14 sizes
| Output |
size
|
aspect_ratio
+
resolution
|
|
|---|---|---|---|
| 1183 × 887 | "1183x887" |
or |
"4:3"
+
"1K"
|
| 916 × 1145 | "916x1145" |
or |
"4:5"
+
"1K"
|
| 1145 × 916 | "1145x916" |
or |
"5:4"
+
"1K"
|
| 512 × 2048 | "512x2048" |
or |
"1:4"
+
"1K"
|
| 1024 × 1024 | "1024x1024" |
or |
"1:1"
+
"1K"
|
| 2048 × 512 | "2048x512" |
or |
"4:1"
+
"1K"
|
| 887 × 1182 | "887x1182" |
or |
"3:4"
+
"1K"
|
| 362 × 2896 | "362x2896" |
or |
"1:8"
+
"1K"
|
| 2896 × 362 | "2896x362" |
or |
"8:1"
+
"1K"
|
| 836 × 1254 | "836x1254" |
or |
"2:3"
+
"1K"
|
| 1254 × 836 | "1254x836" |
or |
"3:2"
+
"1K"
|
| 768 × 1365 | "768x1365" |
or |
"9:16"
+
"1K"
|
| 1365 × 768 | "1365x768" |
or |
"16:9"
+
"1K"
|
| 1563 × 670 | "1563x670" |
or |
"21:9"
+
"1K"
|
2K 14 sizes
| Output |
size
|
aspect_ratio
+
resolution
|
|
|---|---|---|---|
| 3129 × 1341 | "3129x1341" |
or |
"21:9"
+
"2K"
|
| 1774 × 2365 | "1774x2365" |
or |
"3:4"
+
"2K"
|
| 2365 × 1774 | "2365x1774" |
or |
"4:3"
+
"2K"
|
| 1832 × 2290 | "1832x2290" |
or |
"4:5"
+
"2K"
|
| 2290 × 1832 | "2290x1832" |
or |
"5:4"
+
"2K"
|
| 1536 × 2731 | "1536x2731" |
or |
"9:16"
+
"2K"
|
| 2731 × 1536 | "2731x1536" |
or |
"16:9"
+
"2K"
|
| 1024 × 4096 | "1024x4096" |
or |
"1:4"
+
"2K"
|
| 2048 × 2048 | "2048x2048" |
or |
"1:1"
+
"2K"
|
| 4096 × 1024 | "4096x1024" |
or |
"4:1"
+
"2K"
|
| 724 × 5793 | "724x5793" |
or |
"1:8"
+
"2K"
|
| 5792 × 724 | "5792x724" |
or |
"8:1"
+
"2K"
|
| 1672 × 2508 | "1672x2508" |
or |
"2:3"
+
"2K"
|
| 2508 × 1672 | "2508x1672" |
or |
"3:2"
+
"2K"
|
4K 14 sizes
| Output |
size
|
aspect_ratio
+
resolution
|
|
|---|---|---|---|
| 3548 × 4730 | "3548x4730" |
or |
"3:4"
+
"4K"
|
| 3345 × 5017 | "3345x5017" |
or |
"2:3"
+
"4K"
|
| 4580 × 3664 | "4580x3664" |
or |
"5:4"
+
"4K"
|
| 2048 × 8192 | "2048x8192" |
or |
"1:4"
+
"4K"
|
| 4096 × 4096 | "4096x4096" |
or |
"1:1"
+
"4K"
|
| 8192 × 2048 | "8192x2048" |
or |
"4:1"
+
"4K"
|
| 3072 × 5461 | "3072x5461" |
or |
"9:16"
+
"4K"
|
| 5461 × 3072 | "5461x3072" |
or |
"16:9"
+
"4K"
|
| 1448 × 11585 | "1448x11585" |
or |
"1:8"
+
"4K"
|
| 4729 × 3547 | "4729x3547" |
or |
"4:3"
+
"4K"
|
| 11584 × 1448 | "11584x1448" |
or |
"8:1"
+
"4K"
|
| 5016 × 3344 | "5016x3344" |
or |
"3:2"
+
"4K"
|
| 3663 × 4579 | "3663x4579" |
or |
"4:5"
+
"4K"
|
| 6256 × 2681 | "6256x2681" |
or |
"21:9"
+
"4K"
|
How these parameters work
size
Exact pixel dimensions
"1920x1080"
aspect_ratio
Shape only, default scale
"16:9"
resolution
Scale tier, preserves shape
"1K"
Priority when combined
size is most specific and always wins. aspect_ratio and resolution control shape and scale independently.
How matching works
7:1 on a model with
4:1 and 8:1,
you get 8:1.
0.5K 1K 2K 4K)
or megapixel tiers (0.25 1).
If the exact tier isn't available, you get the nearest one.
Media Inputs
| Parameter | Type | Description | Modes |
|---|---|---|---|
image
|
file |
Required.
Input image(s) to edit
Supports PNG, JPEG, WebP.
|
T2I
Edit
|
Output & Format
| Parameter | Type | Description | Modes |
|---|---|---|---|
response_format
|
string |
How to return the image
url
b64_json
Default:
"url" |
T2I
Edit
|
output_format
|
string |
Output image format
png
jpeg
gif
webp
avif
Gateway converts to requested format if provider doesn't support it natively.
|
T2I
Edit
|
output_compression
|
integer | Compression level for lossy formats (JPEG, WebP, AVIF) |
T2I
Edit
|
n
|
integer |
Number of images to generate
Default:
1Gateway generates multiple images in parallel even if provider only supports 1.
|
T2I
Edit
|
Additional Parameters
| Parameter | Type | Description | Modes |
|---|---|---|---|
enable_web_search
fal
|
boolean | Enable web search for the image generation task. This will allow the model to use the latest information from the web to generate the image. |
T2I
Edit
|
google_search
replicate
|
boolean | Use Google Web Search grounding to generate images based on real-time information (e.g. weather, sports scores, recent events). |
T2I
Edit
|
image_search
replicate
|
boolean | Use Google Image Search grounding to find web images as visual context for generation. When enabled, web search is also used automatically. |
T2I
Edit
|
limit_generations
fal
|
boolean | Experimental parameter to limit the number of generations from each round of prompting to 1. Set to `True` to to disregard any instructions in the prompt regarding the number of images to generate and ignore any intermediate images generated by the model. This may affect generation quality. |
T2I
Edit
|
safety_tolerance
fal
|
string |
The safety tolerance level for content moderation. 1 is the most strict (blocks most content), 6 is the least strict.
1
2
3
4
5
6
|
T2I
Edit
|
sync_mode
fal
|
boolean | If `True`, the media will be returned as a data URI and the output data won't be available in the request history. |
T2I
Edit
|
thinking_level
fal
|
string |
When set, enables model thinking with the given level ('minimal' or 'high') and includes thoughts in the generation. Omit to disable.
high
minimal
|
T2I
Edit
|
Parameter Normalization
How we handle parameters across different providers
Not every provider speaks the same language. When you send a parameter, we handle it in one of four ways depending on what the model supports:
| Behavior | What happens | Example |
|---|---|---|
passthrough |
Sent as-is to the provider | style, quality |
renamed |
Same value, mapped to the field name the provider expects | prompt |
converted |
Transformed to the provider's native format | size |
emulated |
Works even if the provider has no concept of it | n, response_format |
Parameters we don't recognize pass straight through to the upstream API, so provider-specific options still work.
Nano Banana 2 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.
Image Editing Landscape
Elo vs Cost
Elo vs Speed
Text-to-Image Landscape
Elo vs Cost
Elo vs Speed
Competition Results
“Give the person a full, thick head of natural hair with realistic texture, density, and a natural hairline. Preserve facial features and lighting.”
{
"action": "image_edit",
"reference": "uploaded neutral portrait",
"change": "Warm genuine Duchenne smile: lips curved up, slight natural teeth, soft eye crinkles, subtle cheek raise",
"details": "Realistic smiling skin (dimples if present, soft cheek shadows), slightly brighter eyes; keep exact eye shape/color/iris",
"preserve_exact": "Face identity/structure, eyes/nose/lips/eyebrows, hair, skin texture/pores/freckles, makeup, clothing, head pose, background, lighting, shadows, framing",
"no_changes": "No face shape change, no new features, no gaze shift, no hair/clothing/lighting/background edits",
"style": "Ultra-photorealistic 8K portrait, sharp face focus, natural soft lighting, realistic skin glow"
}
“Change the scene to night: a deep, dark sky with subtle, glistening stars visible behind the mountain.”
“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.”
“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.”
“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.”
“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”
“Give the person a full, thick head of natural hair with realistic texture, density, and a natural hairline. Preserve facial features and lighting.”
{
"action": "image_edit",
"reference": "uploaded neutral portrait",
"change": "Warm genuine Duchenne smile: lips curved up, slight natural teeth, soft eye crinkles, subtle cheek raise",
"details": "Realistic smiling skin (dimples if present, soft cheek shadows), slightly brighter eyes; keep exact eye shape/color/iris",
"preserve_exact": "Face identity/structure, eyes/nose/lips/eyebrows, hair, skin texture/pores/freckles, makeup, clothing, head pose, background, lighting, shadows, framing",
"no_changes": "No face shape change, no new features, no gaze shift, no hair/clothing/lighting/background edits",
"style": "Ultra-photorealistic 8K portrait, sharp face focus, natural soft lighting, realistic skin glow"
}
“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.”
“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.”
“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.”
Uncategorized
“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.”
“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.”
“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.”
“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.”
Top Matchups
See how Nano Banana 2 performs head-to-head against other AI models, ranked by community votes in blind comparisons.
vs Nano Banana Pro
Challenge: Over-the-top cartoon caricature
50% W · 50% L
vs FLUX.2 [dev] Turbo
Challenge: Geometric Composition
50% W · 50% L
vs GPT Image 1.5
Challenge: Vintage Cafe Logo
100% W · 0% L
vs Grok Imagine Image
Challenge: Modern Clean Menu
0% W · 100% L
vs Reve Image 1.0
Challenge: Night Sky Transformation
0% W · 100% L
Nano Banana 2 is best for
See all Use CasesThe model excels in Product, Branding, and Commercial categories with a 100% win rate and secures a #2 rank for text rendering at 93.5% accuracy. While dominant in commercial design and text integration, it shows comparatively lower performance in photorealism where it ranks #13 of 22 models.
Gallery
View all 19 imagesNano Banana 2 FAQ
How much does Nano Banana 2 cost?
Nano Banana 2 starts at $0.0225 per image through Lumenfall. Pricing varies by provider. Lumenfall does not add any markup to provider pricing.
What can Nano Banana 2 do?
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.
How do I use Nano Banana 2 via API?
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.
Which providers offer Nano Banana 2?
Nano Banana 2 is available through Vertex AI, fal.ai, Replicate, and Gemini API 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.
Try Nano Banana 2 in Playground
Generate images with custom prompts — no API key needed.