跳转到主要内容
POST
/
v1
/
images
/
generations
图像生成 / 编辑
curl --request POST \
  --url https://www.anyfast.ai/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>"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.anyfast.ai/llms.txt

Use this file to discover all available pages before exploring further.

授权

Authorization
string
header
必填

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

请求体

application/json
model
enum<string>
必填

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

可用选项:
wan2.7-image-pro,
wan2.7-image
示例:

"wan2.7-image-pro"

prompt
string
必填

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

示例:

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

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 张图片。

示例:

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

n
integer
默认值:1

生成图片张数。

  • 关闭组图模式(enable_sequential: false):1–4,默认 1
  • 开启组图模式(enable_sequential: true):1–12,默认 12,实际张数由模型决定。
必填范围: 1 <= x <= 12
示例:

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。
示例:

"2K"

enable_sequential
boolean
默认值:false

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

thinking_mode
boolean
默认值:true

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

watermark
boolean
默认值:false

是否在生成图片右下角添加水印。

seed
integer

随机数种子,范围 [0, 2147483647]。相同种子可获得相近结果,但不保证完全一致。

必填范围: 0 <= x <= 2147483647
response_format
enum<string>
默认值:url

返回图片 URL 或 Base64 编码。

可用选项:
url,
b64_json
示例:

"url"

响应

图像生成成功

created
integer

创建时间戳

示例:

1773803391

data
object[]