curl --request POST \
--url https://api.ppio.com/v3/async/qwen-image-txt2img \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "<string>",
"size": "<string>",
"watermark": true
}
'{
"task_id": "<string>"
}curl --request POST \
--url https://api.ppio.com/v3/async/qwen-image-txt2img \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "<string>",
"size": "<string>",
"watermark": true
}
'{
"task_id": "<string>"
}application/json1024*1024。长和宽的像素范围:256 ~ 1536。false:不添加水印。true:在图像添加文字的水印,标识由人工智能生成合成。请求:
curl --location 'https://api.ppio.com/v3/async/qwen-image-txt2img' \
--header 'Authorization: Bearer {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "一只安静的橘色短毛猫蜷坐在黎明时分薄雾缭绕的湖边。它卷着尾巴,静静地望着水面。柔和的晨光透过树影洒下,冷色调,宁静氛围,轻雾环绕,50mm摄影风格。",
"size": "1024*1024"
}'
响应:
{
"task_id": "{返回的任务 ID}"
}
task_id 获取输出图片。images 中获取图片 URL。
请求:
curl --location --request GET 'https://api.ppio.com/v3/async/task-result?task_id={返回的任务 ID}' \
--header 'Authorization: Bearer {{API Key}}'
响应:
{
"extra": {
"has_nsfw_contents": []
},
"task": {
"task_id": "679c6531-a8d1-400c-8071-d58ccf074ae5",
"task_type": "QWEN_IMAGE_TEXT_TO_IMAGE",
"status": "TASK_STATUS_SUCCEED",
"reason": "",
"eta": 0,
"progress_percent": 0
},
"images": [
{
"image_url": "https://d2p7pge43lyniu.cloudfront.net/output/86d76970-441d-4b53-af90-4ce0ae092040-u1_2943371d-2819-4f96-8941-cbd46a8056eb.jpeg",
"image_url_ttl": "0",
"image_type": "jpeg",
"nsfw_detection_result": null
}
],
"videos": [],
"audios": []
}
图片文件:
