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 ↗ |
| Pricing | View pricing in the Cloudflare dashboard ↗ |
Usage
const response = await env.AI.run( 'google/nano-banana', { aspect_ratio: '16:9', 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', },)console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \ --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ --header "Content-Type: application/json" \ --data '{ "model": "google/nano-banana", "input": { "aspect_ratio": "16:9", "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" }}'
{ "gatewayMetadata": { "keySource": "Unified" }, "result": { "image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/google__nano-banana/cozy-coffee-shop.png" }, "state": "Completed"}Examples
Vintage Tokyo Poster — Retro travel poster style illustration
const response = await env.AI.run( 'google/nano-banana', { aspect_ratio: '9:16', 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', },)console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \ --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ --header "Content-Type: application/json" \ --data '{ "model": "google/nano-banana", "input": { "aspect_ratio": "9:16", "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" }}'
{ "gatewayMetadata": { "keySource": "Unified" }, "result": { "image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/google__nano-banana/vintage-tokyo-poster.png" }, "state": "Completed"}Dewdrops Macro — Photorealistic macro photography
const response = await env.AI.run( 'google/nano-banana', { aspect_ratio: '1:1', prompt: 'A photorealistic macro shot of dewdrops on a spider web at sunrise, with rainbow light refracting through each droplet', },)console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \ --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ --header "Content-Type: application/json" \ --data '{ "model": "google/nano-banana", "input": { "aspect_ratio": "1:1", "prompt": "A photorealistic macro shot of dewdrops on a spider web at sunrise, with rainbow light refracting through each droplet" }}'
{ "gatewayMetadata": { "keySource": "Unified" }, "result": { "image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/google__nano-banana/dewdrops-macro.png" }, "state": "Completed"}Pixel Art Marketplace — Isometric pixel art scene
const response = await env.AI.run( 'google/nano-banana', { aspect_ratio: '1:1', prompt: 'An isometric pixel art scene of a bustling medieval marketplace with merchants, knights, and a dragon perched on the town hall roof', },)console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \ --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ --header "Content-Type: application/json" \ --data '{ "model": "google/nano-banana", "input": { "aspect_ratio": "1:1", "prompt": "An isometric pixel art scene of a bustling medieval marketplace with merchants, knights, and a dragon perched on the town hall roof" }}'{ "gatewayMetadata": { "keySource": "Unified" }, "result": { "image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/google__nano-banana/pixel-art-marketplace.png" }, "state": "Completed"}High Resolution Landscape — Generate a high-resolution 4K landscape image
const response = await env.AI.run( 'google/nano-banana', { aspect_ratio: '16:9', image_size: '4K', output_format: 'png', prompt: 'A dramatic mountain landscape at golden hour with snow-capped peaks and a crystal clear alpine lake', },)console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \ --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ --header "Content-Type: application/json" \ --data '{ "model": "google/nano-banana", "input": { "aspect_ratio": "16:9", "image_size": "4K", "output_format": "png", "prompt": "A dramatic mountain landscape at golden hour with snow-capped peaks and a crystal clear alpine lake" }}'
{ "gatewayMetadata": { "keySource": "Unified" }, "result": { "image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/google__nano-banana/high-resolution-landscape.png" }, "state": "Completed"}Parameters
aspect_ratio
stringenum: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9▶image_input[]
arraymaxItems: 3image_size
stringenum: 1K, 2K, 4Koutput_format
stringenum: jpg, png, webpprompt
stringrequiredimage
stringformat: uri