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

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 and nano-banana-2.1

High Resolution

1K / 2K / 4K on Pro, 2, and 2.1

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

Aspect Ratios

Resolution Options

  • nano-banana-fast — stays at 1K
  • nano-banana-2-lite — stays at 1K
  • nano-banana-pro, nano-banana-2, nano-banana-2.1 — 1K / 2K / 4K
Use nano-banana-2 or nano-banana-2.1 for unusual ratios such as 1:8 or 8:1. Use nano-banana-pro when you want the Pro model at 4K.

Available Endpoints


Explore the API Documentation

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