Nano Banana

Gemini Image Editor preserves authentic subject identity while enabling seamless image editing and manipulation.


API

If you're looking for an API, you can choose from your desired programming language.

POST
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 import requests import base64 # Use this function to convert an image file from the filesystem to base64 def image_file_to_base64(image_path): with open(image_path, 'rb') as f: image_data = f.read() return base64.b64encode(image_data).decode('utf-8') # Use this function to fetch an image from a URL and convert it to base64 def image_url_to_base64(image_url): response = requests.get(image_url) image_data = response.content return base64.b64encode(image_data).decode('utf-8') # Use this function to convert a list of image URLs to base64 def image_urls_to_base64(image_urls): return [image_url_to_base64(url) for url in image_urls] api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/nano-banana" # Request payload data = { "prompt": "Dancing Banana", "image_urls": [ "https://segmind-resources.s3.amazonaws.com/input/09a99645-3171-4742-be08-dfcfe7f0a4b2-1304f734-929b-4047-822d-4f59fca2179a-40457f0b-d422-4525-b3a5-19633a9cdac0.png" ] } headers = {'x-api-key': api_key} response = requests.post(url, json=data, headers=headers) print(response.content) # The response is the generated image
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


promptstr *

Prompt to render


image_urlsstr ( default: )

A list of image urls.

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Resources to get you started

Everything you need to know to get the most out of Nano Banana

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 CasePrompt ExampleFocus
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.

Other Popular Models

Discover other models you might be interested in.

Cookie settings

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept all", you consent to our use of cookies.