cURL
请先获取 API Key 并设置为环境变量。
提交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-refiner",
"input": {
"top_garment_url": "https://dashscope-swap.oss-cn-beijing.aliyuncs.com/aa-test/sample-top.jpg",
"bottom_garment_url": "https://dashscope-swap.oss-cn-beijing.aliyuncs.com/aa-test/sample-bottom.jpg",
"person_image_url": "https://dashscope-swap.oss-cn-beijing.aliyuncs.com/aa-test/sample-person.png",
"coarse_image_url": "https://dashscope-swap.oss-cn-beijing.aliyuncs.com/aa-test/result.png"
},
"parameters": {
"gender": "woman"
}
}'{
"output": {
"task_status": "PENDING",
"task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
},
"request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}千问云 API Key。详见获取 API Key。
必须设置为 enable 以使用异步模式。
模型名称,固定为 aitryon-refiner。
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-refiner",
"input": {
"top_garment_url": "https://dashscope-swap.oss-cn-beijing.aliyuncs.com/aa-test/sample-top.jpg",
"bottom_garment_url": "https://dashscope-swap.oss-cn-beijing.aliyuncs.com/aa-test/sample-bottom.jpg",
"person_image_url": "https://dashscope-swap.oss-cn-beijing.aliyuncs.com/aa-test/sample-person.png",
"coarse_image_url": "https://dashscope-swap.oss-cn-beijing.aliyuncs.com/aa-test/result.png"
},
"parameters": {
"gender": "woman"
}
}'{
"output": {
"task_status": "PENDING",
"task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
},
"request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}