# Nano Banana > Gemini Image Editor preserves authentic subject identity while enabling seamless image editing and manipulation. ## Overview - **Endpoint**: `https://api.segmind.com/v1/nano-banana` - **Model ID**: `nano-banana` - **Category**: Text-to-Image Generation - **Type**: Synchronous (Direct response) - **Average Latency**: ~7.3s (30-day average) - **Average Cost**: $0.03106 per run (observed across past runs, not a price — see Pricing) - **Provider**: GOOGLE_VERTEX ## Pricing - **Cost**: $0.040 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 Describe the image to generate or the changes to make to the reference images. - Default: `"Dancing Banana"` - **`image_urls`** (`array`, _optional_): Reference images Optional reference images used to guide generation. Nano Banana accepts up to 3 images. - Default: `[]` - Item type: string - **`system_prompt`** (`string`, _optional_): System prompt Optional high-level persona or style instructions applied to the generation. - Default: `""` - **`aspect_ratio`** (`string`, _optional_): Aspect ratio Choose the proportions of the generated image. - Default: `"1:1"` - Options: "1:1" (Square (1:1)), "2:3" (Portrait (2:3)), "3:2" (Landscape (3:2)), "4:3" (Landscape (4:3)), "3:4" (Portrait (3:4)), "4:5" (Portrait (4:5)), "5:4" (Landscape (5:4)), "16:9" (Widescreen (16:9)), "9:16" (Vertical (9:16)), "21:9" (Ultrawide (21:9)) - **`response_modalities`** (`string`, _optional_): Response format Return only the generated image or include a text response alongside it. - Default: `"TEXT_AND_IMAGE"` - Options: "TEXT_AND_IMAGE" (Text and image), "IMAGE" (Image only) **Required Parameters Example**: ```json { "prompt": "Dancing Banana" } ``` **Full Example**: ```json { "prompt": "Dancing Banana", "image_urls": [ "https://segmind-inference-inputs.s3.amazonaws.com/5ead6a2e-3e8d-4d07-a86d-5777fc6cb6f9-09a99645-3171-4742-be08-dfcfe7f0a4b2-1304f734-929b-4047-822d-4f59fca2179a-40457f0b-d422-4525-b3a5-19633a9cdac0.png" ], "system_prompt": "Keep the composition polished, cheerful, and suitable for a product campaign.", "aspect_ratio": "1:1", "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 Aka Gemini 2.5 Flash Image **Edited by Segmind Team on August 31, 2025.** #### What is Nano Banana? **Nano Banana** is Google DeepMind's most recently released model, designed to revolutionize image editing and modification, to ensure the subject's realistic essence is not compromised. Nano Banana will always render impressive results with close likeness to the natural features of humans, animals, and other objects, whose images undergo intricate modifications. Hence, no more surreal images (bid adieu to 'uncanny valley'), or missing essential details when compared to its original source. Nano Banana, a Gemini Image Editor, works intelligently to ensure that the images and their subjects preserve their realism and remain true to their source, even when their background and appearance are changed, or when a whole new image is being created by compositing varied pictures. #### Key Features - **Identity preservation** - Realistically preserves facial features, expressions, and unique characteristics - **Multi-step editing workflow** - Capable of applying sequential transformations without deterioration in quality - **Background replacement** - Effortlessly modifies environments without disrupting the subjects - **Creative style mixing** - Flawlessly combines artistic styles and visual elements from multiple sources - **Photo combination** - Composite varied images to create novel images or scenes - **Natural realism** - Achieve realistic results without the "AI-generated" tone - **Simple prompt interface** - Runs on simple and direct text descriptions, even for intricate edits #### Best Use Cases - Nano Banana is a great tool for **content creators**; they can use it to enhance portraits and lifestyle photography without distorting the subjects' realism. - **E-commerce businesses** can utilize it to create consistent product shots across different backgrounds and settings to advertise on their websites. - **Social media managers** can create engaging content by combining their brand's visual elements with real photography. - **Marketing teams** use it for all their campaign images, especially when they need their subjects to be perfect. - **Photography studios** can use it to touch up client photos while preserving their natural characteristics. #### Prompt Tips and Output Quality - When you use Nano Banana, you will get the best and desired results if you **write clear, descriptive prompts** that specify the change in the image you intend to produce without overcomplicating the request. - **Simple instructions** like "person in formal attire at outdoor wedding" will work better than lengthy technical descriptions. - For perfect results, you must **provide one prompt per edit** for primary transformation. - To change the backgrounds, **describe the lighting and mood** to ensure your intended effects. - Style transfers can be achieved by **providing the reference** of specific artistic movements or visual aesthetics, rather than ambiguous abstract concepts. ## Usage Guide ### Effective Guide to Using the Rendering Model This guide walks you through crafting prompts that get the best out of our rendering model. With a single `prompt` parameter, the key lies in strategic phrasing, clarity and creativity. #### 1. Understanding the `prompt` Parameter - **Type**: String - **Required**: Yes - **Description**: Your creative idea for rendering. Think of it as an instruction to an artist: the more descriptive, the richer the result. - **Default Example**: “Banana in a tuxedo during a gala event” #### 2. Best Practices for Prompt Crafting 1. **Be Specific** • Replace “dog” with “golden retriever puppy chasing a red ball in a sunlit park.” 2. **Use Style Tags** • Add “––photorealistic,” “––watercolor,” or “––cyberpunk” to convey artistic style. 3. **Define Mood & Lighting** • “Soft morning light,” “moody chiaroscuro,” or “neon-lit night.” 4. **Include Color Palette** • “Pastel tones,” “vibrant primaries,” or “monochrome.” 5. **Specify Composition** • “Top-down view,” “close-up portrait,” “wide-angle landscape.” #### 3. Use-Case Prompts & Recommendations | Use Case | Prompt Example | Focus | |-------------------------|--------------------------------------------------------------------------------|-------------------------------------------------------| | Fun & Whimsical | “Cat wearing aviator goggles flying a paper plane ––cartoon style” | Exaggeration & humor | | Product Concept Art | “Sleek matte-black wireless earbuds on marble pedestal ––photorealistic” | Clean lines, realistic materials, high detail | | Fantasy Illustration | “Dragon perched on emerald tower under stormy sky ––digital painting” | Epic scale, dramatic lighting, texture emphasis | | Sci-Fi Scene | “Cityscape of neon towers and flying cars at dusk ––cyberpunk, cinematic” | Futuristic elements, vibrant contrast, motion blur | | Educational Diagrams | “Human heart cross-section with labels ––line art, minimal color” | Clarity, labeling, simple color accents | #### 4. Iterative Refinement 1. **Review the output**: Identify areas to amplify (e.g., “make the glow stronger”). 2. **Adjust adjectives**: Swap “bright” for “dazzling” or “subdued.” 3. **Layer details**: Add environmental context (“fog rolling over hills”). 4. **Shorten or lengthen**: Remove unnecessary words or expand on specifics. #### 5. Tips & Tricks - **Use Analogies**: “Like a vinyl record spinning under neon lights.” - **Limit Jargon**: Keep language accessible unless targeting a niche style. - **Test Variations**: Tweak one element at a time to see its impact. - **Combine Styles**: “––surrealism meets art deco.” With thoughtful prompts, you’ll unlock the full potential of the rendering model—transforming simple ideas into striking visuals every time. ## FAQ ### How is Gemini Image Editor different from other AI image models? Nano Banana is the highly advanced model that specializes in identity preservation of images during edits, to maintain the authentic tone of the subject's original appearance, while other models usually distort faces and warp (or entirely lose) distinctive features. ### Can I make multiple edits to the same image? Yes, this model supports multi-step editing workflows that can undergo sequential transformations without any loss in quality. ### What types of subjects work best? The model is capable of working on any subject, and it excels with people, animals, and any type of objects for which upholding the identity and recognizable features are essential. ### Is this model open-source? No, Nano Banana is part of the Gemini AI image generator and is a proprietary model developed by Google DeepMind, hence it is accessible through their platform. ### What prompt length works best? It is suggested to keep the prompts concise and specific. Simple descriptions such as "subject in a new environment" will generally produce better results than complex instructions. ### How realistic are the edited images? The model focuses on natural realism to produce highly authentic results that maintain photographic quality rather than stylized AI aesthetics that may feel unreal or unnatural. ## Usage Examples ### cURL ```bash curl -X POST "https://api.segmind.com/v1/nano-banana" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "Dancing Banana", "image_urls": [ "https://segmind-inference-inputs.s3.amazonaws.com/5ead6a2e-3e8d-4d07-a86d-5777fc6cb6f9-09a99645-3171-4742-be08-dfcfe7f0a4b2-1304f734-929b-4047-822d-4f59fca2179a-40457f0b-d422-4525-b3a5-19633a9cdac0.png" ], "system_prompt": "Keep the composition polished, cheerful, and suitable for a product campaign.", "aspect_ratio": "1:1", "response_modalities": "TEXT_AND_IMAGE" }' ``` ### Python ```python import requests import json api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/nano-banana" data = { "prompt": "Dancing Banana", "image_urls": [ "https://segmind-inference-inputs.s3.amazonaws.com/5ead6a2e-3e8d-4d07-a86d-5777fc6cb6f9-09a99645-3171-4742-be08-dfcfe7f0a4b2-1304f734-929b-4047-822d-4f59fca2179a-40457f0b-d422-4525-b3a5-19633a9cdac0.png" ], "system_prompt": "Keep the composition polished, cheerful, and suitable for a product campaign.", "aspect_ratio": "1:1", "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'; const data = { "prompt": "Dancing Banana", "image_urls": [ "https://segmind-inference-inputs.s3.amazonaws.com/5ead6a2e-3e8d-4d07-a86d-5777fc6cb6f9-09a99645-3171-4742-be08-dfcfe7f0a4b2-1304f734-929b-4047-822d-4f59fca2179a-40457f0b-d422-4525-b3a5-19633a9cdac0.png" ], "system_prompt": "Keep the composition polished, cheerful, and suitable for a product campaign.", "aspect_ratio": "1:1", "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) - [API Documentation](https://www.segmind.com/models/nano-banana/api) - [Pricing Details](https://www.segmind.com/models/nano-banana/pricing) - [Platform Documentation](https://docs.segmind.com/)