curl --request POST \
--url https://api.powertokens.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "qwen-image-2.0-pro",
"prompt": "一只可爱的橘猫坐在窗台上,阳光洒在身上,写实风格",
"n": 1,
"size": "1024*1024",
"response_format": "url"
}
'{
"created": 123,
"data": [
{
"url": "<string>",
"b64_json": "<string>",
"revised_prompt": "<string>"
}
],
"metadata": {}
}适用于当前阿里渠道最终白名单中的文生图模型:qwen-image-2.0-pro、wan2.7-image-pro。
公开字段:model、prompt、n、size、response_format、seed、watermark、prompt_extend、negative_prompt。
curl --request POST \
--url https://api.powertokens.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "qwen-image-2.0-pro",
"prompt": "一只可爱的橘猫坐在窗台上,阳光洒在身上,写实风格",
"n": 1,
"size": "1024*1024",
"response_format": "url"
}
'{
"created": 123,
"data": [
{
"url": "<string>",
"b64_json": "<string>",
"revised_prompt": "<string>"
}
],
"metadata": {}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
图像生成模型名称。
qwen-image-2.0-pro, wan2.7-image-pro 图像生成提示词,描述期望生成的图像内容、风格和构图。支持中英文,长度不超过 800 个字符。
生成图像的数量。qwen-image-2.0 系列支持 1-6 张,其他模型固定为 1。
1 <= x <= 6输出图像分辨率,格式为 宽*高。
qwen-image-2.0 系列:总像素需在 512512 至 20482048 之间。
qwen-image-max/plus 系列:支持 1664928(16:9)、14721104(4:3)、13281328(1:1)、11041472(3:4)、928*1664(9:16)
"1024*1024"
响应格式。url 返回图片下载链接,b64_json 返回 Base64 编码的图片数据。
url, b64_json 随机数种子,取值范围 [0, 2147483647]。使用相同种子可生成相似结果。
是否在图像右下角添加水印。
是否开启提示词智能改写。开启后会自动优化输入提示词。
反向提示词,描述不希望在图像中出现的内容。支持中英文,长度不超过 500 个字符。