Nano Banana API
Nano Banana 的 Buble API 参数、mode、价格与调用示例。
Nano Banana API
Nano Banana 适合快速图片生成和实用的图生图改造工作流。
模型 key
google/nano-banana— Nano Banana
支持的 mode 与输入
| 模型 | Mode | 名称 | 输入要求 |
|---|---|---|---|
google/nano-banana | text_to_image | 文生图 | Prompt max 5000 chars |
google/nano-banana | image_to_image | 图生图 | Prompt max 5000 chars Images reference: 1-10 files, 30 MB, formats jpg, png, webp, bmp, gif |
参数
| 模型 | 参数 | 默认值 | 可选值 | 适用 mode |
|---|---|---|---|---|
google/nano-banana | output_format | png | png, jpeg | 全部 mode |
google/nano-banana | aspect_ratio | 1:1 | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 5:4, 4:5, 21:9, auto | 全部 mode |
价格
| 模型 | 价格 |
|---|---|
google/nano-banana | 每张图片 1 credit |
生产建议
- 显式传入
mode。 - 只使用上表列出的参数值。
- 媒体输入类 mode 请先用
POST /api/v1/files上传素材。 - 如果页面包含多个变体,请使用你真正需要的模型 key。
示例:文生图
curl https://buble.ai/api/v1/generations \
-H "Authorization: Bearer $BUBLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/nano-banana",
"mode": "text_to_image",
"prompt": "A premium editorial product image of a minimalist ceramic coffee grinder on a warm walnut counter, soft studio lighting",
"aspect_ratio": "1:1",
"output_format": "png"
}'示例:图生图
Upload an image first, then pass the returned URL to image_urls.
curl https://buble.ai/api/v1/generations \
-H "Authorization: Bearer $BUBLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/nano-banana",
"mode": "image_to_image",
"prompt": "Transform the source into a clean commercial product image while preserving the main object",
"image_urls": ["https://example.com/source.png"],
"aspect_ratio": "1:1",
"output_format": "png"
}'