Nano Banana
Text-to-Image • Google • ProxiedGoogle's fast image generation model producing high-quality images from text prompts.
| Model Info | |
|---|---|
| Terms and License | link ↗ |
| More information | link ↗ |
Usage
const response = await env.AI.run( 'google/nano-banana', { prompt: 'A cozy coffee shop interior with warm lighting, plants hanging from the ceiling, and a cat sleeping on a velvet armchair by the window', aspect_ratio: '16:9', }, { gateway: { id: 'default' }, })console.log(response)
Examples
Vintage Tokyo Poster — Retro travel poster style illustration
const response = await env.AI.run( 'google/nano-banana', { prompt: 'A vintage travel poster for Tokyo, Japan in the style of 1960s airline advertisements, with Mount Fuji in the background and cherry blossoms framing the scene', aspect_ratio: '9:16', }, { gateway: { id: 'default' }, })console.log(response)
Dewdrops Macro — Photorealistic macro photography
const response = await env.AI.run( 'google/nano-banana', { prompt: 'A photorealistic macro shot of dewdrops on a spider web at sunrise, with rainbow light refracting through each droplet', aspect_ratio: '1:1', }, { gateway: { id: 'default' }, })console.log(response)
Pixel Art Marketplace — Isometric pixel art scene
const response = await env.AI.run( 'google/nano-banana', { prompt: 'An isometric pixel art scene of a bustling medieval marketplace with merchants, knights, and a dragon perched on the town hall roof', aspect_ratio: '1:1', }, { gateway: { id: 'default' }, })console.log(response)
High Resolution Landscape — Generate a high-resolution 4K landscape image
const response = await env.AI.run( 'google/nano-banana', { prompt: 'A dramatic mountain landscape at golden hour with snow-capped peaks and a crystal clear alpine lake', aspect_ratio: '16:9', image_size: '4K', output_format: 'png', }, { gateway: { id: 'default' }, })console.log(response)
Parameters
stringrequiredarraymaxItems: 3stringenum: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9stringenum: jpg, png, webpstringenum: 1K, 2K, 4Kstringformat: uriAPI Schemas
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string" }, "image_input": { "maxItems": 3, "type": "array", "items": { "type": "string" } }, "aspect_ratio": { "type": "string", "enum": [ "1:1", "3:2", "2:3", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9" ] }, "output_format": { "type": "string", "enum": [ "jpg", "png", "webp" ] }, "image_size": { "type": "string", "enum": [ "1K", "2K", "4K" ] } }, "required": [ "prompt" ], "additionalProperties": false}{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "image": { "type": "string", "format": "uri" } }, "required": [ "image" ], "additionalProperties": false}