Skip to main content
POST
/
v1
/
images
/
generations
图像生成 / 编辑
curl --request POST \
  --url https://www.anyfast.com.cn/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "wan2.7-image-pro",
  "prompt": "一间有着精致窗户的花店,漂亮的木质门,摆放着花朵",
  "image": "https://example.com/input.jpg",
  "n": 1,
  "size": "2K",
  "enable_sequential": false,
  "thinking_mode": true,
  "watermark": false,
  "seed": 1073741823,
  "response_format": "url"
}
'
{
  "created": 1773803391,
  "data": [
    {
      "url": "https://example.com/generated.png",
      "b64_json": "<string>",
      "revised_prompt": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
enum<string>
required

模型 ID。wan2.7-image-pro 文生图支持 4K 输出;wan2.7-image 生成速度更快。

Available options:
wan2.7-image-pro,
wan2.7-image
Example:

"wan2.7-image-pro"

prompt
string
required

图片描述文字,支持中英文,最多 5000 个字符。

Example:

"一间有着精致窗户的花店,漂亮的木质门,摆放着花朵"

image
string

编辑用输入图片 — URL(HTTP/HTTPS)或 Base64 数据 URI(data:{MIME};base64,{data})。 支持格式:JPEG、JPG、PNG(不含透明通道)、BMP、WEBP。单张最大 20 MB,分辨率 240–8000 px,宽高比 1:8–8:1,最多 9 张。

Example:

"https://example.com/input.jpg"

n
integer
default:1

生成张数。

  • 关闭组图模式(enable_sequential: false):1–4,默认 1
  • 开启组图模式(enable_sequential: true):1–12,默认 12
Required range: 1 <= x <= 12
Example:

1

size
string

输出分辨率,两种格式(不可混用):

  • 预设:1K(1024×1024)、2K(2048×2048,默认)、4K(4096×4096,仅 wan2.7-image-pro 文生图)。
  • 自定义像素:{宽}x{高} — 文生图总像素 768×768–4096×4096,其他模式最大 2048×2048,宽高比 1:8–8:1。
Example:

"2K"

enable_sequential
boolean
default:false

启用组图输出模式。为 true 时,n 表示最大张数,实际数量由模型决定。

thinking_mode
boolean
default:true

开启思考模式以提升推理质量。仅在无图片输入且关闭组图模式时生效。

watermark
boolean
default:false

是否在生成图片上添加水印。

seed
integer

随机数种子,用于获得相近结果。相同种子不保证完全一致。

Required range: 0 <= x <= 2147483647
response_format
enum<string>
default:url

返回图片 URL 或 Base64 编码数据。

Available options:
url,
b64_json
Example:

"url"

Response

图片生成成功

created
integer

Unix 时间戳

Example:

1773803391

data
object[]