# Nano Banana 2 Lite > Generate and edit photorealistic images in about four seconds with Google's fastest Gemini image model. ## Overview - **Endpoint**: `https://api.segmind.com/v1/nano-banana-2-lite` - **Model ID**: `nano-banana-2-lite` - **Category**: Image-to-Image Transformation - **Type**: Synchronous (Direct response) - **Average Latency**: ~11.2s (30-day average) - **Average Cost**: $0.04147 per run (observed across past runs, not a price — see Pricing) - **Provider**: GOOGLE ## Pricing - **Cost**: $0.042 per generation ## API Information This model uses a **synchronous response pattern**: 1. Make a POST request with your parameters 2. Receive the output directly in the response (binary for images/videos/audio, JSON for text) 3. No polling required - response is immediate ### Input Schema The API accepts the following input parameters: - **`prompt`** (`string`, _required_): Prompt Text description of the image to generate; required. Be specific about subject, lighting, camera. - Default: `"A photorealistic close-up product photograph of a rustic artisan coffee bag standing on a warm wooden cafe counter. The kraft-paper packaging has a beautifully printed label reading 'NANO ROAST' in bold vintage serif lettering, with 'Single Origin - Medium Roast' in smaller elegant script beneath it. Soft morning window light, gentle bokeh of a cozy cafe interior in the background, roasted coffee beans scattered on the counter, shallow depth of field, crisp focus on the label, high-end commercial product photography, 8k."` - **`system_prompt`** (`string`, _optional_): System prompt Optional. High-level persona/style rules applied to every generation (e.g. 'You are a product photographer; always use soft studio lighting'). Steers output like a system instruction. Leave blank to omit. - **`image_urls`** (`array`, _optional_): Input Image List Optional reference image URLs for editing or multi-image composition. Add up to 14. Up to 14 image URLs; base64 is not supported. - Item type: string - **`aspect_ratio`** (`string`, _optional_): Aspect ratio Output shape from 15 presets; default 1:1. Use 16:9 cinematic, 9:16 mobile, auto adaptive. - Default: `"1:1"` - Options: "auto" (auto), "1:1" (1:1), "2:3" (2:3), "3:2" (3:2), "4:3" (4:3), "3:4" (3:4), "4:5" (4:5), "5:4" (5:4), "16:9" (16:9), "9:16" (9:16), "21:9" (21:9), "1:4" (1:4), "4:1" (4:1), "1:8" (1:8), "8:1" (8:1) - **`output_resolution`** (`string`, _optional_): Output resolution Image resolution; only 1K is supported. Leave at 1K for every generation. - Default: `"1K"` - Options: "1K" (1K) - **`output_format`** (`string`, _optional_): Output format File type, jpg or png; default jpg. Choose png for sharper edges and text. - Default: `"jpg"` - Options: "jpg" (jpg), "png" (png) - **`seed`** (`integer`, _optional_): Seed Random integer seeding generation for reproducibility. Reuse a value to reproduce an image. - Default: `778812` - **`thinking_level`** (`string`, _optional_): Thinking level Reasoning depth, minimal or high; default high. Use high for complex prompts, minimal faster. - Default: `"high"` - Options: "minimal" (minimal), "high" (high) - **`safety_tolerance`** (`integer`, _optional_): Safety tolerance Content moderation strictness from 1 to 6; default 4. Lower is stricter, higher permissive. - Default: `4` - Options: "1" (1), "2" (2), "3" (3), "4" (4), "5" (5), "6" (6) - **`response_modalities`** (`string`, _optional_): Response modalities Return IMAGE only or TEXT_AND_IMAGE; default TEXT_AND_IMAGE. Use IMAGE to skip text output. - Default: `"TEXT_AND_IMAGE"` - Options: "TEXT_AND_IMAGE" (TEXT_AND_IMAGE), "IMAGE" (IMAGE) **Required Parameters Example**: ```json { "prompt": "A photorealistic close-up product photograph of a rustic artisan coffee bag standing on a warm wooden cafe counter. The kraft-paper packaging has a beautifully printed label reading 'NANO ROAST' in bold vintage serif lettering, with 'Single Origin - Medium Roast' in smaller elegant script beneath it. Soft morning window light, gentle bokeh of a cozy cafe interior in the background, roasted coffee beans scattered on the counter, shallow depth of field, crisp focus on the label, high-end commercial product photography, 8k." } ``` **Full Example**: ```json { "prompt": "A photorealistic close-up product photograph of a rustic artisan coffee bag standing on a warm wooden cafe counter. The kraft-paper packaging has a beautifully printed label reading 'NANO ROAST' in bold vintage serif lettering, with 'Single Origin - Medium Roast' in smaller elegant script beneath it. Soft morning window light, gentle bokeh of a cozy cafe interior in the background, roasted coffee beans scattered on the counter, shallow depth of field, crisp focus on the label, high-end commercial product photography, 8k.", "system_prompt": "sample text", "image_urls": [], "aspect_ratio": "1:1", "output_resolution": "1K", "output_format": "jpg", "seed": 778812, "thinking_level": "high", "safety_tolerance": 4, "response_modalities": "TEXT_AND_IMAGE" } ``` ### Output Schema The API returns a synchronous response based on the model type: **For Image/Video/Audio Models**: - Response contains binary data (image/png, video/mp4, audio/mp3) - Content-Type header indicates the media type - Save the response body directly to a file **For Text Models**: - Response is JSON with the generated text - Structure varies by model **HTTP Response Codes**: - **200 - OK**: Request successful, output in response body - **400 - Bad Request**: Invalid parameters - **401 - Unauthorized**: Invalid or missing API key - **404 - Not Found**: Model not found - **406 - Not Acceptable**: Insufficient credits - **429 - Too Many Requests**: Rate limit exceeded - **500 - Server Error**: Internal server error ## About ### Nano Banana 2 Lite — Text-to-Image and Image Editing Model #### What is Nano Banana 2 Lite? Nano Banana 2 Lite is Google's fastest, most cost-efficient image model in the Nano Banana family, technically known as **Gemini 3.1 Flash-Lite Image**. It is built for rapid ideation and high-velocity developer pipelines, returning a **text-to-image** result in roughly four seconds. A single drop-in API handles **text-to-image generation, image editing, and multi-image composition**, and because it is multimodal it can return text alongside images. Despite the speed focus, it keeps reliable prompt adherence, strong character consistency, and legible in-image text rendering, making it Google's recommended upgrade from the legacy Nano Banana (Gemini 2.5 Flash Image). #### Key Features - **Fast text-to-image**: outputs in about four seconds for interactive prototyping and high-volume pipelines - **Image editing and multi-image composition**: pass reference images through `image_urls` to edit or blend up to 14 inputs - **1K output across 15 aspect ratios**: from `1:1` feeds to `16:9` cinematic and `9:16` mobile - **Multimodal responses**: choose `IMAGE` only or `TEXT_AND_IMAGE` - **Consistent characters** across rapid generations for storyboards and try-ons - **Legible in-image text** for labels, captions, and localized ad copy - **SynthID watermark** embedded in every output #### Best Use Cases - **A/B testing ad creatives**: spin up localized ad variations and layout concepts in seconds - **Social and app content at scale**: power consumer features where a user is waiting on the result - **Storyboarding and virtual try-ons**: keep character and product identity stable across frames - **E-commerce mockups**: generate product scenes and contextual layouts quickly - **Image-to-video pipelines**: produce a fast base image, then animate it with a video model - **Rapid prototyping**: explore directions cheaply before committing to a heavier model #### Prompt Tips and Output Quality Be explicit: combine subject, environment, lighting, and camera, for example "Studio photo of a red ceramic mug, softbox lighting, 50mm, shallow depth of field." Set `aspect_ratio` intentionally: `9:16` for stories, `16:9` for cinematic, `1:1` for feeds. Switch `output_format` to `png` for crisp edges and text. Keep `thinking_level` on `high` for complex prompts and `minimal` for the fastest drafts. Reuse a `seed` to reproduce a composition, and pass `image_urls` to anchor style or edit an existing image. ## Usage Guide ### How to Use Nano Banana 2 Lite Nano Banana 2 Lite (Gemini 3.1 Flash-Lite Image) is tuned for speed and volume. Use it when you need many images fast, then escalate to a heavier model only for final, high-stakes assets. #### 1. Craft the Prompt - **Be explicit**: combine subject, environment, lighting, and camera. > "Studio shot of a vintage leather jacket on a wooden mannequin, softbox key light, 85mm, shallow depth of field." - **Anchor style or edit**: pass reference URLs in `image_urls` to guide composition or edit an existing image. - **Repeat key details**: reuse colors, props, and character names across prompts for series consistency. #### 2. Core Parameters ```json { "prompt": "...", "image_urls": [], "aspect_ratio": "1:1", "output_format": "jpg", "thinking_level": "high", "output_resolution": "1K", "response_modalities": "TEXT_AND_IMAGE", "seed": 778812 } ``` #### 3. Settings by Use Case 1. **Ads and social** - `aspect_ratio`: `16:9` for banners, `9:16` for stories - `output_format`: `png` for crisp text and edges - `thinking_level`: `high` for layouts with copy 2. **E-commerce and try-ons** - `aspect_ratio`: `1:1` for grids, `4:5` for portrait feeds - `image_urls`: reference catalog shots for a consistent look 3. **Storyboards and concepts** - `aspect_ratio`: `21:9` for panoramas - `thinking_level`: `minimal` for the fastest iterations - `seed`: fix a value to lock a recurring character #### 4. Recommended Settings - **Fastest drafts**: `thinking_level` `minimal`, `output_format` `jpg`, `aspect_ratio` `1:1`. - **Final polish**: `thinking_level` `high`, `output_format` `png`. - **Reproducibility**: set a fixed `seed` and keep the prompt constant. - **Resolution**: only `1K` is supported, so leave `output_resolution` at `1K`. - **Output type**: use `response_modalities` `IMAGE` to skip the text response when you only need pixels. #### 5. Pro Tips - **Batch variations**: hold the prompt template constant and vary one adjective or camera angle. - **Image-to-video**: generate a base image here, then animate it with a video model. - **Subject consistency**: lock a character name and reuse it across calls. ## FAQ ### Is Nano Banana 2 Lite open-source? No. It is a hosted Google model (Gemini 3.1 Flash-Lite Image) accessed via API. ### Can it edit images or only generate them? Both. It supports text-to-image, image editing, and multi-image composition through `image_urls`. ### What resolution does it output? Outputs are generated at 1K resolution; higher 2K or 4K canvases are not supported on Lite. ### How is it different from Nano Banana 2 and Pro? Lite is speed-first; Nano Banana 2 is the generalist workhorse; Nano Banana Pro targets complex, high-fidelity work. ### Are outputs watermarked? Yes. Every image carries an invisible SynthID watermark identifying it as AI-generated. ### Can I generate non-square images for ads and video? Yes. Choose from 15 aspect ratios including `16:9`, `9:16`, `21:9`, and ultra-wide formats. ## Usage Examples ### cURL ```bash curl -X POST "https://api.segmind.com/v1/nano-banana-2-lite" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A photorealistic close-up product photograph of a rustic artisan coffee bag standing on a warm wooden cafe counter. The kraft-paper packaging has a beautifully printed label reading 'NANO ROAST' in bold vintage serif lettering, with 'Single Origin - Medium Roast' in smaller elegant script beneath it. Soft morning window light, gentle bokeh of a cozy cafe interior in the background, roasted coffee beans scattered on the counter, shallow depth of field, crisp focus on the label, high-end commercial product photography, 8k.", "system_prompt": "sample text", "image_urls": [], "aspect_ratio": "1:1", "output_resolution": "1K", "output_format": "jpg", "seed": 778812, "thinking_level": "high", "safety_tolerance": 4, "response_modalities": "TEXT_AND_IMAGE" }' ``` ### Python ```python import requests import json api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/nano-banana-2-lite" data = { "prompt": "A photorealistic close-up product photograph of a rustic artisan coffee bag standing on a warm wooden cafe counter. The kraft-paper packaging has a beautifully printed label reading 'NANO ROAST' in bold vintage serif lettering, with 'Single Origin - Medium Roast' in smaller elegant script beneath it. Soft morning window light, gentle bokeh of a cozy cafe interior in the background, roasted coffee beans scattered on the counter, shallow depth of field, crisp focus on the label, high-end commercial product photography, 8k.", "system_prompt": "sample text", "image_urls": [], "aspect_ratio": "1:1", "output_resolution": "1K", "output_format": "jpg", "seed": 778812, "thinking_level": "high", "safety_tolerance": 4, "response_modalities": "TEXT_AND_IMAGE" } response = requests.post( url, json=data, headers={ 'x-api-key': api_key, 'Content-Type': 'application/json' } ) if response.status_code == 200: # For image/video/audio models, response.content contains the binary data with open('output.png', 'wb') as f: f.write(response.content) print('Generation complete, saved to output.png') else: print(f"Error: {response.status_code}") print(response.text) ``` ### JavaScript ```javascript const apiKey = 'YOUR_API_KEY'; const url = 'https://api.segmind.com/v1/nano-banana-2-lite'; const data = { "prompt": "A photorealistic close-up product photograph of a rustic artisan coffee bag standing on a warm wooden cafe counter. The kraft-paper packaging has a beautifully printed label reading 'NANO ROAST' in bold vintage serif lettering, with 'Single Origin - Medium Roast' in smaller elegant script beneath it. Soft morning window light, gentle bokeh of a cozy cafe interior in the background, roasted coffee beans scattered on the counter, shallow depth of field, crisp focus on the label, high-end commercial product photography, 8k.", "system_prompt": "sample text", "image_urls": [], "aspect_ratio": "1:1", "output_resolution": "1K", "output_format": "jpg", "seed": 778812, "thinking_level": "high", "safety_tolerance": 4, "response_modalities": "TEXT_AND_IMAGE" }; const response = await fetch(url, { method: 'POST', headers: { 'x-api-key': apiKey, 'Content-Type': 'application/json', }, body: JSON.stringify(data), }); if (response.ok) { // For image/video/audio models, response contains binary data const blob = await response.blob(); const downloadUrl = URL.createObjectURL(blob); // Create download link const a = document.createElement('a'); a.href = downloadUrl; a.download = 'output.png'; a.click(); console.log('Generation complete'); } ``` ## Additional Resources ### Documentation - [Model Playground](https://www.segmind.com/models/nano-banana-2-lite) - [API Documentation](https://www.segmind.com/models/nano-banana-2-lite/api) - [Pricing Details](https://www.segmind.com/models/nano-banana-2-lite/pricing) - [Platform Documentation](https://docs.segmind.com/)