ModelsPricingEnterprise
500+ AI Model API, All In One API.Just In CometAPI
Models API
Developer
Quick StartDocumentationAPI Dashboard
Company
About usEnterprise
Resources
AI ModelsBlogChangelogSupport
Terms of ServicePrivacy Policy
© 2026 CometAPI · All rights reserved
Home/Models/Google/Nano Banana
G

Nano Banana

Per Request:$0.039
Gemini 2.5 Flash Image (aka nano-banana), Google's most advanced image generation and editing model. This update enables you to blend multiple images into a single one, maintain character consistency to tell rich stories, perform targeted transformations using natural language, and leverage Gemini's world knowledge to generate and edit images.
Commercial Use
Playground
Overview
Features
Pricing
API
Versions

Key features

  • Native image generation & editing — generate images or edit existing photos via natural-language prompts. (Generate / Edit).
  • Multi-image fusion — combine multiple input images into one photorealistic scene.
  • Character consistency — keep the same subject or character appearance across edits and prompts. (Consistency).
  • SynthID watermarking — all outputs include an invisible SynthID to identify AI-generated content. (Watermark).

Technical details

  • Architecture & positioning: built on the Gemini 2.5 Flash family — designed as a low-latency “Flash” variant that trades a little model size/throughput for much faster per-call response and cost efficiency while retaining stronger reasoning than earlier Flash tiers.
  • Input formats & limits: accepts inline base64 images for small inputs and file uploads via the File API for larger images (recommended for >20 MB). Supports common MIME types (JPEG, PNG).
  • Modes of operation: text-to-image, image editing (inpainting / semantic masking), style transfer, multi-image composition, and interleaved text+image responses (useful for illustrated instructions, recipes, or mixed content).
  • Provenance & safety mechanisms: visible watermarks on AI outputs plus hidden SynthID markers and policy enforcement layers to limit explicit disallowed content.

Benchmark performance

Nano Banana

Limitations & known risks

  • Content policy constraints: models enforce content policies (e.g., disallowing explicit sexual content and some illicit content), but enforcement is not perfect — generating images of public figures or controversial icons may still be possible in some scenarios, so policy checks are essential. )
  • Failure modes: possible identity drift in extreme edits, occasional semantic misalignment (when prompts are under-specified), and artifacts in very complex scenes or extreme viewpoint changes.
  • Provenance & misuse: while watermarks and SynthID are present, these do not prevent misuse — they assist detection and attribution but are not a substitute for human review in sensitive workflows.

Typical use cases

  • Product & ecommerce: place/catalog products into lifestyle shots via multi-image fusion.
  • Creative tooling / design: fast iterations in design apps (Adobe Firefly integration cited).
  • Photo editing & retouching: localized edits from natural language (remove objects, change color/lighting, restyle).
  • Storytelling / character assets: keep characters consistent across panels and scenes.

Features for Nano Banana

Explore the key features of Nano Banana, designed to enhance performance and usability. Discover how these capabilities can benefit your projects and improve user experience.

Pricing for Nano Banana

Explore competitive pricing for Nano Banana, designed to fit various budgets and usage needs. Our flexible plans ensure you only pay for what you use, making it easy to scale as your requirements grow. Discover how Nano Banana can enhance your projects while keeping costs manageable.
Comet Price (USD / M Tokens)Official Price (USD / M Tokens)Discount
Per Request:$0.039
Per Request:$0.04875
-20%

Sample code and API for Nano Banana

Access comprehensive sample code and API resources for Nano Banana to streamline your integration process. Our detailed documentation provides step-by-step guidance, helping you leverage the full potential of Nano Banana in your projects.
Python
JavaScript
Curl
from google import genai
from google.genai import types
import os

# Get your CometAPI key from https://api.cometapi.com/console/token, and paste it here
COMETAPI_KEY = os.environ.get("COMETAPI_KEY") or "<YOUR_COMETAPI_KEY>"
BASE_URL = "https://api.cometapi.com"

client = genai.Client(
    http_options={"api_version": "v1beta", "base_url": BASE_URL, "timeout": 600000},
    api_key=COMETAPI_KEY,
)

prompt = (
    "Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme"
)

response = client.models.generate_content(
    model="gemini-2.5-flash-image",
    contents=[prompt],
)

# Output directory
OUTPUT_DIR = os.path.join(os.path.dirname(__file__), "..", "output")
os.makedirs(OUTPUT_DIR, exist_ok=True)

for part in response.parts:
    if part.text is not None:
        print(part.text)
    elif part.inline_data is not None:
        image = part.as_image()
        output_path = os.path.join(OUTPUT_DIR, "gemini-native-image.png")
        image.save(output_path)
        print(f"Image saved to: {output_path}")

Python Code Example

from google import genai
from google.genai import types
import os

# Get your CometAPI key from https://api.cometapi.com/console/token, and paste it here
COMETAPI_KEY = os.environ.get("COMETAPI_KEY") or "<YOUR_COMETAPI_KEY>"
BASE_URL = "https://api.cometapi.com"

client = genai.Client(
    http_options={"api_version": "v1beta", "base_url": BASE_URL, "timeout": 600000},
    api_key=COMETAPI_KEY,
)

prompt = (
    "Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme"
)

response = client.models.generate_content(
    model="gemini-2.5-flash-image",
    contents=[prompt],
)

# Output directory
OUTPUT_DIR = os.path.join(os.path.dirname(__file__), "..", "output")
os.makedirs(OUTPUT_DIR, exist_ok=True)

for part in response.parts:
    if part.text is not None:
        print(part.text)
    elif part.inline_data is not None:
        image = part.as_image()
        output_path = os.path.join(OUTPUT_DIR, "gemini-native-image.png")
        image.save(output_path)
        print(f"Image saved to: {output_path}")

JavaScript Code Example

import { GoogleGenAI } from "@google/genai";
import * as fs from "node:fs";
import * as path from "node:path";
import { fileURLToPath } from "node:url";

// Get your CometAPI key from https://api.cometapi.com/console/token, and paste it here
const COMETAPI_KEY = process.env.COMETAPI_KEY || "<YOUR_COMETAPI_KEY>";
const BASE_URL = "https://api.cometapi.com";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

async function main() {
  const ai = new GoogleGenAI({
    apiKey: COMETAPI_KEY,
    httpOptions: { baseUrl: BASE_URL },
  });

  const prompt =
    "Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme";

  const response = await ai.models.generateContent({
    model: "gemini-2.5-flash-image",
    contents: prompt,
  });

  // Output directory
  const outputDir = path.join(__dirname, "..", "output");
  if (!fs.existsSync(outputDir)) {
    fs.mkdirSync(outputDir, { recursive: true });
  }

  for (const part of response.candidates[0].content.parts) {
    if (part.text) {
      console.log(part.text);
    } else if (part.inlineData) {
      const imageData = part.inlineData.data;
      const outputPath = path.join(outputDir, "gemini-native-image.png");
      const buffer = Buffer.from(imageData, "base64");
      fs.writeFileSync(outputPath, buffer);
      console.log(`Image saved to: ${outputPath}`);
    }
  }
}

main();

Curl Code Example

#!/bin/bash
# Get your CometAPI key from https://api.cometapi.com/console/token, and paste it here

# Output directory
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
OUTPUT_DIR="$SCRIPT_DIR/../output"
mkdir -p "$OUTPUT_DIR"

curl -s -X POST \
  "https://api.cometapi.com/v1beta/models/gemini-2.5-flash-image:generateContent" \
  -H "x-goog-api-key: $COMETAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{
      "parts": [
        {"text": "Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme"}
      ]
    }]
  }' \
  | grep -o '"data": "[^"]*"' \
  | cut -d'"' -f4 \
  | base64 --decode > "$OUTPUT_DIR/gemini-native-image.png"

echo "Image saved to: $OUTPUT_DIR/gemini-native-image.png"

Versions of Nano Banana

The reason Nano Banana has multiple snapshots may include potential factors such as variations in output after updates requiring older snapshots for consistency, providing developers a transition period for adaptation and migration, and different snapshots corresponding to global or regional endpoints to optimize user experience. For detailed differences between versions, please refer to the official documentation.
version
gemini-2.5-flash-image

More Models

D

Doubao Seedream 4-5

D

Doubao Seedream 4-5

Per Request:$0.04
Seedream 4.5 is ByteDance/Seed’s multimodal image model (text→image + image editing) that focuses on production-grade image fidelity, stronger prompt adherence, and much-improved editing consistency (subject preservation, text/typography rendering, and facial realism).
F

FLUX 2 PRO

F

FLUX 2 PRO

Free
Per Request:$0.1
FLUX 2 PRO is the flagship commercial model in the FLUX 2 series, delivering state-of-the-art image generation with unprecedented quality and detail. Built for professional and enterprise applications, it offers superior prompt adherence, photorealistic outputs, and exceptional artistic capabilities. This model represents the cutting edge of AI image synthesis technology.
F

FLUX 2 FLEX

F

FLUX 2 FLEX

Per Request:$0.01
FLUX 2 FLEX is the versatile, adaptable model designed for flexible deployment across various use cases and hardware configurations. It offers scalable performance with adjustable quality settings, making it ideal for applications requiring dynamic resource allocation. This model provides the best balance between quality, speed, and resource efficiency.
R

Black Forest Labs/FLUX 2 PRO

R

Black Forest Labs/FLUX 2 PRO

Per Request:$0.075
FLUX 2 PRO is the flagship commercial model in the FLUX 2 series, delivering state-of-the-art image generation with unprecedented quality and detail. Built for professional and enterprise applications, it offers superior prompt adherence, photorealistic outputs, and exceptional artistic capabilities. This model represents the cutting edge of AI image synthesis technology.
R

Black Forest Labs/FLUX 2 FLEX

R

Black Forest Labs/FLUX 2 FLEX

Per Request:$0.24
FLUX 2 FLEX is the versatile, adaptable model designed for flexible deployment across various use cases and hardware configurations. It offers scalable performance with adjustable quality settings, making it ideal for applications requiring dynamic resource allocation. This model provides the best balance between quality, speed, and resource efficiency.
R

Black Forest Labs/FLUX 2 DEV

R

Black Forest Labs/FLUX 2 DEV

Per Request:$0.075
FLUX 2 DEV is the development-friendly version optimized for research, experimentation, and non-commercial applications. It provides developers with powerful image generation capabilities while maintaining a balance between quality and computational efficiency. Perfect for prototyping, academic research, and personal creative projects.