Nano Banana 2 Image Generation
Generate high-quality images using the next-generation Nano Banana 2 model with support for up to 4K resolution
Tool Overview
The Nano Banana 2 Image Generation tool is the next-generation version of Nano Banana, offering improved image quality and support for up to 4K ultra-high resolution output. It supports text-to-image generation and image editing with reference pictures.
Tool Identifier
nano-banana-image-2-api
Parameters
Required Parameters
prompt
- Type:
string(required) - Description: Text description of the image content to guide AI image generation or editing
- Validation: Must be a non-empty string
- Example:
"A hyper-realistic portrait of a cyberpunk character with neon lighting"
Optional Parameters
image_list
- Type:
string[](optional) - Default:
[](empty array, no reference images) - Format: Array of complete HTTP/HTTPS URLs (e.g.,
["https://cdn.sjinn.ai/uploads/image.jpg"]) - Validation: If provided, must be an array with non-empty string elements
aspect_ratio
- Type:
string(optional) - Default:
"auto" - Supported Values:
"auto"- Automatically select the optimal aspect ratio"1:1"- Square format"16:9"- Widescreen landscape"9:16"- Portrait mobile"4:3"- Standard landscape"3:4"- Standard portrait"9:21"- Ultra-wide portrait"21:9"- Cinematic landscape"2:3"- Classic portrait"3:2"- Classic landscape
- Validation: If an unsupported value is provided, defaults to
"auto"
resolution
- Type:
string(optional) - Default:
"1K" - Supported Values:
"1K"- Standard resolution"2K"- High resolution"4K"- Ultra-high resolution
- Validation: If an unsupported value is provided, defaults to
"1K"
Pricing
- 1K / 2K Resolution: 75 credits per task
- 4K Resolution: 150 credits per task
Request Examples
Text-to-Image
curl -X POST https://sjinn.ai/api/un-api/create_tool_task \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tool_type": "nano-banana-image-2-api",
"input": {
"prompt": "A breathtaking landscape of northern lights over snowy mountains",
"aspect_ratio": "16:9"
}
}'
Image Editing with Reference
curl -X POST https://sjinn.ai/api/un-api/create_tool_task \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tool_type": "nano-banana-image-2-api",
"input": {
"prompt": "Enhance to professional photography quality with dramatic lighting",
"image_list": ["https://cdn.sjinn.ai/uploads/photo.jpg"],
"aspect_ratio": "16:9",
"resolution": "2K"
}
}'
4K Ultra-High Resolution
curl -X POST https://sjinn.ai/api/un-api/create_tool_task \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tool_type": "nano-banana-image-2-api",
"input": {
"prompt": "A futuristic sci-fi cityscape with flying vehicles, cinematic lighting",
"aspect_ratio": "21:9",
"resolution": "4K"
}
}'
Using JavaScript
const response = await fetch('https://sjinn.ai/api/un-api/create_tool_task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
tool_type: 'nano-banana-image-2-api',
input: {
prompt: 'A breathtaking landscape of northern lights over snowy mountains',
aspect_ratio: '16:9',
resolution: '2K',
},
}),
});
const result = await response.json();
console.log('Task ID:', result.data.task_id);
Using Python
import requests
url = 'https://sjinn.ai/api/un-api/create_tool_task'
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
data = {
'tool_type': 'nano-banana-image-2-api',
'input': {
'prompt': 'A breathtaking landscape of northern lights over snowy mountains',
'image_list': ['https://cdn.sjinn.ai/uploads/reference.jpg'],
'aspect_ratio': '16:9',
'resolution': '4K'
}
}
response = requests.post(url, json=data, headers=headers)
result = response.json()
print('Task ID:', result['data']['task_id'])
Response Examples
Success Response
{
"success": true,
"errorMsg": "",
"error_code": 0,
"data": {
"task_id": "550e8400-e29b-41d4-a716-446655440000"
}
}
Error Response (Invalid Parameters)
{
"success": false,
"errorMsg": "prompt is required",
"error_code": 400
}
Resolution Guide
1K Resolution (75 credits)
- Generation Time: 10-30 seconds
- Use Cases: Web, social media, quick prototyping
2K Resolution (75 credits)
- Generation Time: 30-60 seconds
- Use Cases: HD display, presentations, professional work
4K Resolution (150 credits)
- Generation Time: 60-120 seconds
- Use Cases: Large-format printing, ultra-HD display, commercial production
Best Practices
-
Prompt Optimization:
- Use detailed, specific descriptions for best results
- Include style, material, and lighting descriptions
- Professional photography terms work well (e.g., "bokeh", "golden hour", "HDR")
-
Resolution Selection:
- Use 1K during testing to save credits and time
- Use 2K for general professional work
- Reserve 4K for final deliverables requiring maximum detail
-
Reference Image Usage:
- Use high-quality reference images for best editing results
- For multi-image fusion, recommend no more than 3 images
-
Image URL Format:
- All image URLs in
image_listmust be complete HTTP/HTTPS addresses - Ensure images are publicly accessible
- All image URLs in
