Skip to main content

Gemini Image Generation (Nano Banana)

Create and edit high-quality images using Google’s Nano Banana models. Supports text-to-image generation and image editing with multiple aspect ratios and resolutions up to 4K.

Supported Models

ModelDescriptionMax Resolution
nano-banana-fastFast generation (default) — balanced quality & speed1K
nano-banana-proProfessional quality — supports up to 4K4K
nano-banana-2Latest model — supports extended aspect ratios (1:4, 4:1, 1:8, 8:1)4K

Features

Text-to-Image

Generate images from text prompts with action: "generate"

Image Editing

Edit existing images using reference URLs with action: "edit"

Flexible Aspect Ratios

21:9, 16:9, 9:16, 4:3, 3:2, 5:4, 1:1, and more — up to 1:8 / 8:1 on nano-banana-2

High Resolution

1K / 2K / 4K output on Pro and 2 models

How to Use

1

Create an image task

Call POST /gemini/image/generate with your prompt, model, and aspect ratio. You’ll receive a taskId.
2

Poll for results

Use GET /gemini/task/result?taskId=xxx to poll until status is completed. The result contains the generated image.

Quick Example

curl -X POST "https://api.mountsea.ai/gemini/image/generate" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A futuristic city skyline at night, neon lights reflecting on wet streets",
    "action": "generate",
    "model": "nano-banana-pro",
    "aspect_ratio": "16:9",
    "resolution": "2K"
  }'

Aspect Ratios

RatioStandard Modelsnano-banana-2 Only
1:1, 4:3, 3:2, 5:4, 3:4, 4:5, 16:9, 9:16, 21:9, 2:3
1:4, 4:1, 1:8, 8:1

Resolution Options

  • nano-banana-fast — fixed 1K resolution
  • nano-banana-pro1K / 2K / 4K
  • nano-banana-21K / 2K / 4K
Use nano-banana-2 when you need unusual aspect ratios like 1:8 (vertical banner) or 8:1 (horizontal banner). Use nano-banana-pro for the highest quality output at 4K.

Available Endpoints

EndpointMethodDescription
/gemini/image/generatePOSTGenerate or edit images with Nano Banana
/gemini/task/resultGETGet task result by taskId

Explore the API Documentation

Looking for Gemini API SDK compatibility? See Gemini Compat to use the official @google/genai library directly.