简体中文
cURL
curl --request POST \ --url https://api.ppinfra.com/v3/async/qwen-image-txt2img \ --header 'Authorization: <authorization>' \ --header 'Content-Type: <content-type>' \ --data '{ "prompt": "<string>", "size": "<string>" }'
{ "task_id": "<string>" }
application/json
1024*1024
请求:
curl --location 'https://api.ppinfra.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
curl --location --request GET 'https://api.ppinfra.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": [] }
图片文件: