Nano Banana
Google's Gemini 2.5 Flash with native image generation. Higher quality results with support for both text-to-image generation and image editing.
POST
/api/v1/models/nano-banana/editGenerate or edit images using Gemini 2.5 Flash
Model
Gemini 2.5 Flash
Cost
8 credits/image
Avg. Time
5-8 seconds
Operating Modes
Nano Banana automatically detects the mode based on your input:
Generate Mode
When you provide only a prompt
Creates a new image from scratch based on your text description.
Edit Mode
When you provide imageUrl + prompt
Modifies an existing image based on your instructions.
Request Body
| Name | Type | Description |
|---|---|---|
promptrequired | string | Text description for generation or editing instructions |
imageUrl | string | Source image URL (include for edit mode, omit for generate mode) |
aspectRatio | stringDefault: 1:1 | Output aspect ratio (1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9) |
Generate Mode Example
"text">-purple-600">curl "text-blue-600">-X POST https://vydra.app/api/v1/models/nano"text-blue-600">-banana/edit \
"text-blue-600">-H "Authorization: Bearer YOUR_API_KEY" \
"text-blue-600">-H "Content">-Type: application/json" \
"text-blue-600">-d '{
"prompt": "A stunning aurora borealis over a frozen lake in Iceland, stars visible, reflection on ice, 8K quality",
"aspectRatio": "21:9"
}'Edit Mode Example
"text">-purple-600">curl "text-blue-600">-X POST https://vydra.app/api/v1/models/nano"text-blue-600">-banana/edit \
"text-blue-600">-H "Authorization: Bearer YOUR_API_KEY" \
"text-blue-600">-H "Content">-Type: application/json" \
"text-blue-600">-d '{
"imageUrl": "https://pub">-xxx.r2.dev/uploads/photo.jpg",
"prompt": "Transform this into a cyberpunk style with neon lights and rain effects",
"aspectRatio": "16:9"
}'Response
200 OKjson
{
"imageUrl": "https://pub-xxx.r2.dev/generated/nano-banana/org_123/1706234400000.png",
"mimeType": "image/png",
"mode": "generate",
"creditsCharged": 8,
"durationMs": 6240
}Response Fields
| Name | Type | Description |
|---|---|---|
imageUrl | string | Public URL of the generated/edited image |
mimeType | string | Image MIME type (image/png) |
mode | string | Operation mode: 'generate' or 'edit' |
creditsCharged | number | Credits deducted (always 8) |
durationMs | number | Processing time in milliseconds |
When to Use Nano Banana
✓ Great For
- • Higher quality output than Gemini 2.0 Flash
- • Complex scenes with multiple elements
- • Detailed photorealistic images
- • When you need both generate and edit capabilities
Consider Alternatives When
- • Speed is the priority (use Gemini 2.0 Flash)
- • Combining multiple reference images (use Flux 2 Edit)
- • Budget is constrained (Gemini 2.0 Flash is cheaper)
Model Comparison
| Feature | Gemini 2.0 | Nano Banana |
|---|---|---|
| Credits | 5 | 8 |
| Speed | ~3-5s | ~5-8s |
| Quality | Good | Better |
| Generate | ✓ | ✓ |
| Edit | ✓ | ✓ |
| Aspect Ratios | 10 | 10 |