Nano Banana 2 Lite
Fast image generation and editing with long prompts, automatic aspect ratio, and up to 10 reference images
功能特性
- Text-to-image generation
- Image-to-image editing
- Up to 10 reference images
- Prompts up to 20,000 characters
- Automatic and extreme aspect ratios
定价
| Mode | Credits |
|---|---|
| Fixed 1K output | 6 (~$0.07) |
端点
POST
/api/v1/images/generate参数
| 参数 | 类型 | 必需 | 描述 |
|---|---|---|---|
| model | string | 必需 | Must be "nano-banana-2-lite" |
| type | string | 可选 | "text-to-image" or "image-to-image" (default: text-to-image) |
| prompt | string | 必需 | Text description of the image to generate. Supports 3 to 20,000 characters. |
| aspect_ratio | string | 可选 | "auto", "1:1", "1:4", "1:8", "2:3", "3:2", "3:4", "4:1", "4:3", "4:5", "5:4", "8:1", "9:16", "16:9", or "21:9" (default: auto) |
| image_urls | string[] | 可选 | Input image URLs for image-to-image. Supports up to 10 JPEG, PNG, or WebP images, 30MB each. |
| input_image | string | 可选 | Deprecated. Alias for image_urls[0] |
| num_images | number | 可选 | Must be 1 |
请求示例(文生图)
{
"model": "nano-banana-2-lite",
"prompt": "A clean product photo of a translucent wireless speaker on a marble table, soft daylight, crisp details",
"aspect_ratio": "auto"
}请求示例(图生图)
{
"model": "nano-banana-2-lite",
"type": "image-to-image",
"prompt": "Keep the product shape and materials, change the scene into a bright minimalist studio campaign image",
"image_urls": ["https://tempfile.aiquickdraw.com/workers/nano/image_1772780968156_ygk0zm.png"],
"aspect_ratio": "16:9"
}响应示例
{
"success": true,
"data": {
"task_id": "task_nb2_lite_abc123",
"credits_used": 6,
"remaining_credits": 494,
"model": "nano-banana-2-lite"
}
}代码示例(文生图)
curl -X POST https://gateway.bananapro.site/api/v1/images/generate \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana-2-lite",
"prompt": "A clean product photo of a translucent wireless speaker on a marble table, soft daylight, crisp details",
"aspect_ratio": "auto"
}'代码示例(图生图)
curl -X POST https://gateway.bananapro.site/api/v1/images/generate \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana-2-lite",
"type": "image-to-image",
"prompt": "Keep the product shape and materials, change the scene into a bright minimalist studio campaign image",
"image_urls": ["https://tempfile.aiquickdraw.com/workers/nano/image_1772780968156_ygk0zm.png"],
"aspect_ratio": "16:9"
}'