Skip to content

Wan 2.7 Image ​

接口 ​

POST /images/generations

完整 URL: https://modelfold.ai/v1/images/generations

鉴权:所有请求都需要 Authorization: Bearer <API_KEY> 请求头。

模型参数直接放在 JSON 请求体中,不要套 input。请求等待生成完成后返回 data[].url;支持的媒体模型也可使用 异步创建、轮询及回调。示例素材地址须替换为自己的公开可访问文件。计费及错误说明见 API 网关。

生成任务的输入参数

请求参数 ​

请求体 (application/json) ​

参数类型必填说明
modelstring是用于生成任务的模型名称。当前端点固定使用 wan/2-7-image。 默认值:"wan/2-7-image"。 可选值:wan/2-7-image。 示例:wan/2-7-image。
promptstring是本站网关要求传入 prompt,最长 2000 字。图像生成或编辑提示词。该字段支持中英文,最大长度 5000 字符。 maxLength: 2000. 示例:Transform the food photo by replacing the marked ingredients with sliced red chili pieces while preserving the bowl, lighting, steam, camera angle, and overall realism.。
input_urlsarray&lt;string&gt;否(可选)输入图片 URL 数组。 maxItems: 9.
aspect_ratiostring否(可选)无图片输入时的输出宽高比。 可选值:1:1 / 16:9 / 4:3 / 21:9 / 3:4 / 9:16 / 8:1 / 1:8。 示例:1:1。
enable_sequentialboolean否是否开启组图模式。默认值为 false。 默认值:false。 示例:false。
resolutionstring否输出分辨率:1K 或 2K(默认 2K)。4K 请使用 wan/2-7-image-pro。 默认值:"2K"。 可选值:1K / 2K。 示例:2K。
thinking_modeboolean否是否开启思考模式。仅在 enable_sequential=false 且 input_urls 为空时可用;其他情况下不生效。 默认值:false。 示例:false。
color_palettearray&lt;object&gt;否(可选)自定义颜色主题。仅在 enable_sequential=false 时可用,需要 3-10 种颜色,推荐 8 种。 minItems: 3. maxItems: 10.
  color_palette[].hexstring是HEX 颜色值。 pattern: ^#[0-9A-Fa-f]{6}$. 示例:#C2D1E6。
  color_palette[].ratiostring是颜色占比,格式必须为 xx.xx%。 pattern: ^\d{1,3}\.\d{2}%$. 示例:23.51%。
bbox_listarray&lt;array&lt;array&lt;integer&gt;&gt;&gt;否(可选)交互式编辑框选区域。外层列表长度应与 input_urls 一致;每张图片最多 2 个框;单个框格式为 [x1, y1, x2, y2]。
watermarkboolean否是否添加水印。 默认值:false。 示例:false。
seedinteger否可选,不传则随机。 minimum: 0. maximum: 2147483647. 示例:0。
nsfw_checkerboolean否默认 false。为 false 时不额外进行内容过滤,结果由模型直接返回。

请求示例 ​

bash
curl -X POST "https://modelfold.ai/v1/images/generations" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "wan/2-7-image",
  "prompt": "Transform the food photo by replacing the marked ingredients with sliced red chili pieces while preserving the bowl, lighting, steam, camera angle, and overall realism.",
  "enable_sequential": false,
  "resolution": "2K",
  "thinking_mode": false,
  "watermark": false
}'
json
{
  "model": "wan/2-7-image",
  "prompt": "Transform the food photo by replacing the marked ingredients with sliced red chili pieces while preserving the bowl, lighting, steam, camera angle, and overall realism.",
  "enable_sequential": false,
  "resolution": "2K",
  "thinking_mode": false,
  "watermark": false
}

响应 ​

200 — 生成完成。usage 返回实际计费明细;结果地址仅作结构示例。 ​

json
{
  "ok": true,
  "created": 1792134000,
  "data": [
    {
      "url": "https://modelfold.ai/uploads/outputs/result.png"
    }
  ],
  "usage": {}
}

ModelFold — 一个 API,接入所有主流 AI 模型。