跳转到主要内容
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 '{
  "callBackUrl": "https://example.com/callback",
  "image_size": "1:1",
  "image_urls": [
    "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png"
  ],
  "output_format": "png",
  "prompt": "turn this photo into a character figure. Behind it, place a box with the character'\''s image printed on it"
}'
{
  "task_id": "01234567-89ab-cdef-0123-456789abcdef"
}

Authorizations

Authorization
string
header
required

请使用您的 API Token 进行认证

Body

application/json

Task parameters

image_urls
string[]
required

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

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

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

Maximum length: 5000
Example:

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

callBackUrl
string

回调地址(可选)- 任务完成通知的回调 URL

Example:

"https://example.com/callback"

image_size
enum<string>
default: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
Example:

"1:1"

output_format
enum<string>

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

可用选项:
png,
jpeg
Example:

"png"

Response

OK

task_id
string
required

Task ID

Example:

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