请先获取 API Key 并设置为环境变量。
鉴权
string
header
必填
千问云 API Key。详见获取 API Key。
Header 参数
string
默认值"application/json"
必填
请求类型,固定值为 application/json。
string
必填
千问云 API Key。详见获取 API Key。
enum<string>
默认值"enable"
必填
固定值为 enable,表示使用异步调用方式。
enable
提交AI试衣任务
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis/' \
--header 'X-DashScope-Async: enable' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "aitryon",
"input": {
"person_image_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/ubznva/model_person.png",
"top_garment_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/epousa/short_sleeve.jpeg"
},
"parameters": {
"resolution": -1,
"restore_face": true
}
}'{
"output": {
"task_status": "PENDING",
"task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
},
"request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}千问云 API Key。详见获取 API Key。
请求类型,固定值为 application/json。
千问云 API Key。详见获取 API Key。
固定值为 enable,表示使用异步调用方式。
指明需要调用的模型。aitryon(基础版)生成更快;aitryon-plus(Plus版)在清晰度和纹理还原方面更出色,但耗时更长。
输入参数。
显示子属性
模特人物图片的公网URL。5KB≤图像文件≤5M,150≤图像边长≤4096,格式支持jpg/png/jpeg/bmp/heic。需保持图片中有且仅有一个完整的人。仅支持HTTP/HTTPS链接,不支持本地路径。
上装/连衣裙服饰图的公网URL。需上传服饰平拍图,保持服饰是单一主体且完整,背景干净,四周不宜留白过多。对于连衣裙/连体衣,请将图片URL填入此字段,并将 bottom_garment_url 留空。5KB≤图像文件≤5M,150≤图像边长≤4096,格式支持jpg/png/jpeg/bmp/heic。仅支持HTTP/HTTPS链接,不支持本地路径。
下装服饰图的公网URL。5KB≤图像文件≤5M,150≤图像边长≤4096,格式支持jpg/png/jpeg/bmp/heic。需上传服饰平拍图,保持服饰是单一主体且完整,背景干净,四周不宜留白过多。仅支持HTTP/HTTPS链接,不支持本地路径。
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis/' \
--header 'X-DashScope-Async: enable' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "aitryon",
"input": {
"person_image_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/ubznva/model_person.png",
"top_garment_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/epousa/short_sleeve.jpeg"
},
"parameters": {
"resolution": -1,
"restore_face": true
}
}'{
"output": {
"task_status": "PENDING",
"task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
},
"request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}