Skip to content
Google logo

Nano Banana Pro

Text-to-ImageGoogleProxied

Google's higher-quality image generation model with improved detail and prompt adherence.

Model Info
Terms and Licenselink
More informationlink

Usage

TypeScript
const response = await env.AI.run(
'google/nano-banana-pro',
{
prompt:
'A sleek modern wireless headphone on a minimalist white marble surface with soft studio lighting and subtle shadows',
aspect_ratio: '1:1',
output_format: 'png',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Response 200 Product Photography

Examples

Fantasy Illustration — Epic fantasy scene
TypeScript
const response = await env.AI.run(
'google/nano-banana-pro',
{
prompt:
'An epic fantasy illustration of a wizard casting a spell in an ancient library, magical runes floating in the air, dust motes catching golden light streaming through stained glass windows',
aspect_ratio: '16:9',
image_size: '2K',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Response 200 Fantasy Illustration
Architectural Visualization — Modern architecture render
TypeScript
const response = await env.AI.run(
'google/nano-banana-pro',
{
prompt:
'A photorealistic architectural visualization of a modern glass house perched on a cliff overlooking the ocean at sunset',
aspect_ratio: '16:9',
image_size: '4K',
output_format: 'jpg',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Response 200 Architectural Visualization
Character Design — Game character concept art
TypeScript
const response = await env.AI.run(
'google/nano-banana-pro',
{
prompt:
'A detailed character design sheet for a steampunk inventor, showing front view, side view, and detail callouts for mechanical arm and goggles',
aspect_ratio: '3:2',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Response 200 Character Design

Parameters

prompt
stringrequired
aspect_ratio
stringenum: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
output_format
stringenum: jpg, png, webp
image_size
stringenum: 1K, 2K, 4K

API 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
}