Nano Banana 2
Next-generation image generation and editing with Google Search grounding, up to 14 reference images, and 4K output
Fonctionnalités
- Text-to-image generation
- Image-to-image transformation
- Google Search grounding
- Up to 14 reference images
- Extreme aspect ratios and up to 4K resolution
Tarification
| Resolution | Credits |
|---|---|
| 1K | 7 (~$0.08) |
| 2K | 11 (~$0.12) |
| 4K | 15 (~$0.17) |
Point de terminaison
POST
/api/v1/images/generateParamètres
| Paramètre | Type | Obligatoire | Description |
|---|---|---|---|
| model | string | Obligatoire | Must be "nano-banana-2" |
| type | string | Facultatif | "text-to-image" or "image-to-image" (default: text-to-image) |
| prompt | string | Obligatoire | Text description of the image to generate. Supports up to 20,000 characters. |
| resolution | string | Facultatif | "1K", "2K", or "4K" (default: 1K) |
| aspect_ratio | string | Facultatif | "auto", "1:1", "16:9", "9:16", "4:3", "3:4", "1:4", "1:8", "4:1", "8:1", "21:9" |
| image_urls | string[] | Facultatif | Input image URLs or base64 for image-to-image. Supports up to 14 images. |
| input_image | string | Facultatif | Deprecated. Alias for image_urls[0] |
| google_search | boolean | Facultatif | Enable Google Search grounding for real-time information |
| google_image_search | boolean | Facultatif | Enable image search grounding. Requires google_search=true. |
| output_format | string | Facultatif | "jpg" or "png" (default: jpg) |
| num_images | number | Facultatif | Must be 1 |
Exemple de Requête (Texte vers Image)
{
"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
}Exemple de Requête (Image vers Image)
{
"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"
}Exemple de réponse
{
"success": true,
"data": {
"task_id": "task_nb2_abc123",
"credits_used": 11,
"remaining_credits": 489,
"model": "nano-banana-2"
}
}Exemples de Code (Texte vers Image)
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"
}'Exemples de Code (Image vers Image)
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"
}'