跳转到主要内容
万相2.5

Wan 2.5 — 创建任务

异步 Wan 2.5 图像编辑

POST
/services/aigc/image2image/image-synthesis
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis' \
  -H 'X-DashScope-Async: enable' \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "wan2.5-i2i-preview",
  "input": {
    "prompt": "Change the floral dress to a vintage-style lace long dress with exquisite embroidery details on the collar and cuffs.",
    "images": [
      "https://img.alicdn.com/imgextra/i2/O1CN01vHOj4h28jOxUJPwY8_!!6000000007968-49-tps-1344-896.webp"
    ]
  },
  "parameters": {
    "prompt_extend": true,
    "n": 1
  }
}'
{
  "output": {
    "task_status": "PENDING",
    "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
  },
  "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}
请先获取 API Key设置为环境变量。如需使用 SDK,请先安装 SDK
通过文本提示词编辑图像,同时保持主体一致性。支持多图融合,最多可使用三张参考图像。

鉴权

string
header
必填

千问云 API Key。详见获取 API Key

Header 参数

enum<string>
默认值"enable"
必填

开启异步处理模式,必须设置为 enable。HTTP 请求仅支持异步处理。省略此请求头将返回 "current user api does not support synchronous calls" 错误。

enable

请求体

application/json
enum<string>
必填

模型名称。

wan2.5-i2i-preview
wan2.5-i2i-preview
object
必填

图像编辑的输入数据。

object

控制输出分辨率、提示词改写、水印及其他处理选项。

响应

200-application/json
object
string

请求的唯一标识符,可用于问题追踪与排查。