Nano Banana 2
Next-generation image generation and editing with Google Search grounding, up to 14 reference images, and 4K output
기능
- Text-to-image generation
- Image-to-image transformation
- Google Search grounding
- Up to 14 reference images
- Extreme aspect ratios and up to 4K resolution
요금제
| Resolution | Credits |
|---|---|
| 1K | 7 (~$0.08) |
| 2K | 11 (~$0.12) |
| 4K | 15 (~$0.17) |
엔드포인트
POST
/api/v1/images/generate매개변수
| Parameter | 타입 | 필수 | 설명 |
|---|---|---|---|
| model | string | 필수 | Must be "nano-banana-2" |
| type | string | 선택 사항 | "text-to-image" or "image-to-image" (default: text-to-image) |
| prompt | string | 필수 | Text description of the image to generate. Supports up to 20,000 characters. |
| resolution | string | 선택 사항 | "1K", "2K", or "4K" (default: 1K) |
| aspect_ratio | string | 선택 사항 | "auto", "1:1", "16:9", "9:16", "4:3", "3:4", "1:4", "1:8", "4:1", "8:1", "21:9" |
| image_urls | string[] | 선택 사항 | Input image URLs or base64 for image-to-image. Supports up to 14 images. |
| input_image | string | 선택 사항 | Deprecated. Alias for image_urls[0] |
| google_search | boolean | 선택 사항 | Enable Google Search grounding for real-time information |
| google_image_search | boolean | 선택 사항 | Enable image search grounding. Requires google_search=true. |
| output_format | string | 선택 사항 | "jpg" or "png" (default: jpg) |
| num_images | number | 선택 사항 | Must be 1 |
요청 예시 (텍스트-투-이미지)
{
"model": "nano-banana-2",
"prompt": "A cinematic product photo of a transparent smart speaker on a glass table",
"resolution": "2K",
"aspect_ratio": "16:9",
"google_search": false
}요청 예시 (이미지-투-이미지)
{
"model": "nano-banana-2",
"type": "image-to-image",
"prompt": "Turn this product photo into a premium studio campaign image while preserving the product shape",
"image_urls": ["https://tempfile.aiquickdraw.com/workers/nano/image_1772780968156_ygk0zm.png"],
"resolution": "2K",
"aspect_ratio": "16:9"
}응답 예시
{
"success": true,
"data": {
"task_id": "task_nb2_abc123",
"credits_used": 11,
"remaining_credits": 489,
"model": "nano-banana-2"
}
}코드 예시 (텍스트-투-이미지)
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",
"prompt": "A cinematic product photo of a transparent smart speaker on a glass table",
"resolution": "2K",
"aspect_ratio": "16:9"
}'코드 예시 (이미지-투-이미지)
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",
"type": "image-to-image",
"prompt": "Turn this product photo into a premium studio campaign image while preserving the product shape",
"image_urls": ["https://tempfile.aiquickdraw.com/workers/nano/image_1772780968156_ygk0zm.png"],
"resolution": "2K",
"aspect_ratio": "16:9"
}'