跳转到主要内容
POST
/
generate
/
k
/
nano-banana-edit
Nano Banana Edit 图片编辑
curl --request POST \
  --url https://api.sinancode.com/v1/generate/k/nano-banana-edit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "image_urls": [
    "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png"
  ],
  "prompt": "turn this photo into a character figure. Behind it, place a box with the character's image printed on it",
  "image_size": "1:1",
  "output_format": "png"
}
EOF
{
  "task_id": "01234567-89ab-cdef-0123-456789abcdef"
}
使用 Google DeepMind 的 Nano Banana 模型进行图片编辑。 模型特点:
  • 自然语言编辑 - 通过文本指令描述修改需求
  • 局部修改 - 精准编辑图片特定区域
  • 风格调整 - 支持调整图片风格和效果
  • 快速处理 - 基于 Gemini 架构,编辑速度快

授权

Authorization
string
header
必填

请使用您的 API Token 进行认证

请求体

application/json

Task parameters

image_urls
string[]
必填

图片 URL 列表(必填)- 用于编辑的输入图片列表,最多10张

Required array length: 1 - 10 elements
示例:
[
"https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png"
]
prompt
string
必填

提示词(必填,最大5000字符)- 图片编辑的文本描述

Required string length: 1 - 5000
示例:

"turn this photo into a character figure. Behind it, place a box with the character's image printed on it"

image_size
enum<string>
默认值:1:1

图片尺寸(可选,默认 1:1)- 图片宽高比

可用选项:
1:1,
9:16,
16:9,
3:4,
4:3,
3:2,
2:3,
5:4,
4:5,
21:9,
auto
示例:

"1:1"

output_format
enum<string>

输出格式(可选)- 图片输出格式

可用选项:
png,
jpeg
示例:

"png"

响应

OK

task_id
string
必填

Task ID

示例:

"01234567-89ab-cdef-0123-456789abcdef"