Image Generation
Generate AI images with Google Labs Imagen
Image Generation
Generate AI images using Google's Imagen models through the client.images API.
Image generation requires reCAPTCHA configuration. See reCAPTCHA Configuration for setup instructions.
Upload Image
Upload an image for use as a reference in generation:
Upload Options
| Option | Type | Required | Description |
|---|---|---|---|
imageBase64 | string | Yes | Base64-encoded image (with or without data URL prefix) |
sessionId | string | Yes | Unique session identifier |
aspectRatio | AspectRatio | No | Target aspect ratio |
Generate Images
Generate images from a text prompt:
Generate Options
| Option | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Description of the image to generate |
sessionId | string | Yes | Unique session identifier |
aspectRatio | AspectRatio | Yes | Image aspect ratio |
projectId | string | No* | Project ID (auto-resolves if not provided) |
references | ImageReference[] | No | Reference images for style |
seed | number | No | Random seed for reproducibility |
count | number | No | Number of images (1-4, default: 1) |
model | ImageModel | No | Model to use |
prompts | string[] | No | Different prompts for each image |
* Auto-resolves to first available project if not set in client config
Using Reference Images
Generate images inspired by uploaded references:
Multiple Different Prompts
Generate images with different prompts in a single request:
Check Credit Status
Check your account's credit balance:
Image Models
| Model | Description |
|---|---|
nanobanana | Standard Imagen model (GEM_PIX) |
nanobananapro | Enhanced Imagen model (GEM_PIX_2) |
Aspect Ratios
| Ratio | Description |
|---|---|
16:9 | Landscape (default) |
9:16 | Portrait |
1:1 | Square |