nano-banana-image

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

NanoBanana Image Generation

NanoBanana 图像生成

Generate and edit AI images through AceDataCloud's NanoBanana (Gemini-based) API.
Setup: See authentication for token setup.
通过AceDataCloud的基于Gemini的NanoBanana API生成和编辑AI图像。
设置: 请查看身份验证了解令牌设置方法。

Quick Start

快速开始

bash
curl -X POST https://api.acedata.cloud/nano-banana/images \
  -H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action": "generate", "prompt": "a watercolor painting of a French countryside village", "model": "nano-banana"}'
Async: See async task polling. Poll via
POST /nano-banana/tasks
with
{"id": "..."}
.
bash
curl -X POST https://api.acedata.cloud/nano-banana/images \
  -H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action": "generate", "prompt": "a watercolor painting of a French countryside village", "model": "nano-banana"}'
异步操作: 请查看异步任务轮询。通过
POST /nano-banana/tasks
接口并传入
{"id": "..."}
进行轮询。

Models

模型

ModelBest For
nano-banana
Standard image generation (default)
nano-banana-2
Improved quality, second generation
nano-banana-pro
Highest quality, most detailed output
nano-banana:official
Official channel variant of
nano-banana
nano-banana-2:official
Official channel variant of
nano-banana-2
nano-banana-pro:official
Official channel variant of
nano-banana-pro
模型适用场景
nano-banana
标准图像生成(默认)
nano-banana-2
第二代模型,画质提升
nano-banana-pro
最高画质,细节最丰富
nano-banana:official
nano-banana
的官方渠道变体
nano-banana-2:official
nano-banana-2
的官方渠道变体
nano-banana-pro:official
nano-banana-pro
的官方渠道变体

Workflows

工作流程

1. Text-to-Image

1. 文本转图像

json
POST /nano-banana/images
{
  "action": "generate",
  "prompt": "a photorealistic macro shot of morning dew on a spider web",
  "model": "nano-banana-pro",
  "aspect_ratio": "16:9",
  "resolution": "2K"
}
json
POST /nano-banana/images
{
  "action": "generate",
  "prompt": "a photorealistic macro shot of morning dew on a spider web",
  "model": "nano-banana-pro",
  "aspect_ratio": "16:9",
  "resolution": "2K"
}

2. Image Editing

2. 图像编辑

Edit existing images using natural language instructions — no mask needed. Pass source images via
image_urls
.
json
POST /nano-banana/images
{
  "action": "edit",
  "prompt": "change the background to a starry night sky",
  "image_urls": ["https://example.com/photo.jpg"],
  "model": "nano-banana"
}
使用自然语言指令编辑现有图像——无需蒙版。通过
image_urls
传入源图像。
json
POST /nano-banana/images
{
  "action": "edit",
  "prompt": "change the background to a starry night sky",
  "image_urls": ["https://example.com/photo.jpg"],
  "model": "nano-banana"
}

Parameters

参数说明

ParameterValuesDescription
action
"generate"
,
"edit"
Operation mode
model
"nano-banana"
,
"nano-banana-2"
,
"nano-banana-pro"
,
"nano-banana:official"
,
"nano-banana-2:official"
,
"nano-banana-pro:official"
Model to use
prompt
stringImage description or editing instruction
image_urls
array of stringsSource image URLs (required for edit action)
aspect_ratio
"1:1"
,
"3:2"
,
"2:3"
,
"16:9"
,
"9:16"
,
"4:3"
,
"3:4"
Output aspect ratio
resolution
"1K"
,
"2K"
,
"4K"
Output resolution (1K=1024px, 2K=2048px, 4K=4096px)
callback_url
stringAsync callback URL; returns a task ID immediately
参数可选值说明
action
"generate"
,
"edit"
操作模式
model
"nano-banana"
,
"nano-banana-2"
,
"nano-banana-pro"
,
"nano-banana:official"
,
"nano-banana-2:official"
,
"nano-banana-pro:official"
使用的模型
prompt
字符串图像描述或编辑指令
image_urls
字符串数组源图像URL(编辑操作必填)
aspect_ratio
"1:1"
,
"3:2"
,
"2:3"
,
"16:9"
,
"9:16"
,
"4:3"
,
"3:4"
输出图像宽高比
resolution
"1K"
,
"2K"
,
"4K"
输出分辨率(1K=1024px,2K=2048px,4K=4096px)
callback_url
字符串异步回调URL;会立即返回任务ID

Gotchas

注意事项

  • Editing does NOT require a mask — just describe the change in natural language
  • Editing uses the same
    /nano-banana/images
    endpoint with
    action: "edit"
    and
    image_urls
    array (not a separate
    /edit
    path)
  • nano-banana-2
    is the second-generation model;
    nano-banana-pro
    offers the highest quality
  • :official
    variants (e.g.,
    nano-banana:official
    ) route through the official channel
  • Task polling uses
    id
    (not
    task_id
    ) in the
    /nano-banana/tasks
    request body
  • Aspect ratio uses colon notation (e.g.,
    "16:9"
    ) not pixel dimensions
  • The Gemini-based model excels at understanding complex, conversational editing instructions
MCP:
pip install mcp-nano-banana
| Hosted:
https://nano-banana.mcp.acedata.cloud/mcp
| See all MCP servers
  • 编辑操作无需蒙版,只需用自然语言描述修改内容即可
  • 编辑操作使用同一个
    /nano-banana/images
    接口,只需设置
    action: "edit"
    并传入
    image_urls
    数组(无需单独的
    /edit
    路径)
  • nano-banana-2
    是第二代模型;
    nano-banana-pro
    提供最高画质
  • :official
    变体(如
    nano-banana:official
    )通过官方渠道处理请求
  • 任务轮询时,需在
    /nano-banana/tasks
    请求体中使用
    id
    (而非
    task_id
  • 宽高比使用冒号格式(如
    "16:9"
    ),而非像素尺寸
  • 基于Gemini的模型擅长理解复杂的对话式编辑指令
MCP:
pip install mcp-nano-banana
| 托管地址:
https://nano-banana.mcp.acedata.cloud/mcp
| 查看所有MCP服务器