SJinn
Nano Banana Image Generation

Nano Banana Image Generation

Generate and edit high-quality images using the Nano Banana standard model

Tool Overview

The Nano Banana Image Generation tool is a powerful AI image generation and editing tool that supports generating images from text descriptions and editing images based on reference pictures. The standard version provides fast, high-quality image generation capabilities.

Tool Identifier

nano-banana-image-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 beautiful sunset over mountains, vibrant colors, photorealistic"

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"

Pricing

  • Credits Consumed: 50 credits per task
  • Membership Requirement: None

Request Examples

Text-to-Image (No 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-api",
    "input": {
      "prompt": "A serene Japanese garden with cherry blossoms and a koi pond",
      "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-api",
    "input": {
      "prompt": "Transform into a watercolor painting style",
      "image_list": ["https://cdn.sjinn.ai/uploads/photo.jpg"],
      "aspect_ratio": "1:1"
    }
  }'

Multi-Image 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-api",
    "input": {
      "prompt": "A futuristic cityscape at night with neon lights",
      "image_list": ["https://cdn.sjinn.ai/uploads/style1.jpg", "https://cdn.sjinn.ai/uploads/style2.jpg"],
      "aspect_ratio": "16:9"
    }
  }'

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-api',
    input: {
      prompt: 'A serene Japanese garden with cherry blossoms and a koi pond',
      aspect_ratio: '16:9',
    },
  }),
});

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-api',
    'input': {
        'prompt': 'A serene Japanese garden with cherry blossoms and a koi pond',
        'image_list': ['https://cdn.sjinn.ai/uploads/reference.jpg'],
        'aspect_ratio': '16:9'
    }
}

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": "image_list must be an array",
  "error_code": 400
}

Best Practices

  1. Prompt Optimization:

    • Use detailed, specific descriptions
    • Include style, color, and lighting details
    • Can specify art styles (e.g., "photorealistic", "anime style", "oil painting")
  2. Reference Image Usage:

    • Image editing: Provide the original image to edit
    • Style reference: Provide style example images
    • Multi-image fusion: Can provide multiple reference images (recommend no more than 3)
  3. Aspect Ratio Selection:

    • auto suitable for letting AI automatically choose the best ratio
    • Social media: Instagram uses 1:1, Story uses 9:16
    • Web banners: Use 16:9 or 21:9
  4. Image URL Format:

    • All image URLs in image_list must be complete HTTP/HTTPS addresses
    • Ensure images are publicly accessible
  5. Generation Time: Typically 10-30 seconds to complete

Related Links