Nano Banana 2 Lite
Text-to-Image • Google
google/nano-banana-2-lite
- Third-party
- Zero data retention
Google's fastest Gemini image generation model for rapid image creation and iteration.
| Model Info | |
|---|---|
| Context Window ↗ | 65,536 tokens |
| Terms and License | link ↗ |
| More information | link ↗ |
| Zero data retention | Yes |
| Pricing | <ul><li>Input (per 1M tokens)$0.25</li><li>Output (per 1M tokens)$30.00</li></ul> |
Usage
const response = await env.AI.run(
'google/nano-banana-2-lite',
{
prompt:
'A playful concept sketch of a compact solar-powered delivery robot rolling through a leafy neighborhood, bright morning light, clean product design',
aspect_ratio: '16:9',
},
)
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-2-lite",
"input": {
"prompt": "A playful concept sketch of a compact solar-powered delivery robot rolling through a leafy neighborhood, bright morning light, clean product design",
"aspect_ratio": "16:9"
}
}'

{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/google/nano-banana-2-lite/concept-sketch.jpg"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}
Examples
<details>
<summary>Product Render — Create a square PNG product image</summary>
const response = await env.AI.run(
'google/nano-banana-2-lite',
{
prompt:
'A studio product render of translucent wireless earbuds in a frosted glass charging case, soft gradient background, premium advertising style',
aspect_ratio: '1:1',
output_format: 'png',
},
)
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-2-lite",
"input": {
"prompt": "A studio product render of translucent wireless earbuds in a frosted glass charging case, soft gradient background, premium advertising style",
"aspect_ratio": "1:1",
"output_format": "png"
}
}'

{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/google/nano-banana-2-lite/product-render.png"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}
</details>
Parameters
prompt
stringrequired
▶image_input[]
arraymaxItems: 3
aspect_ratio
stringenum: match_input_image, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
output_format
stringenum: jpg, png
resolution
stringenum: 1K, 2K, 4K
image
stringformat: uri
API Schemas (Raw)
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/ai/models/google/nano-banana-2-lite/#page","headline":"Nano Banana 2 Lite","description":"Google's fastest Gemini image generation model for rapid image creation and iteration.","url":"https://developers.cloudflare.com/ai/models/google/nano-banana-2-lite/","inLanguage":"en","image":"https://developers.cloudflare.com/og-docs.png","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Google's Nano Banana 2.1 image generation and editing model, optimized for a balance of quality and performance. title: Nano Banana 2.1 image: https://developers.cloudflare.com/og-docs.png
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/llms.txt
Use this file to discover all available pages before exploring further.

