模型概览
- 端点
- /api/v1/images/generations
- 积分成本
- 10 credits / image
- 典型耗时
- 20-60 sec
- 输入与输出
- Text or image → PNG or JPEG
能力
- Text-to-image
- Image editing
- Long prompts
- Common aspect ratios
请求参数
| 参数 | 类型 | 要求 | 说明 |
|---|---|---|---|
| model | string | 必填 | Model identifier. 默认值: qwen2-image |
| prompt | string | 必填 | Generation or edit instruction, up to 5000 characters. |
| image_urls | string[] | 可选 | Source image URLs. Supplying an image activates edit mode. |
| aspect_ratio | string | 可选 | Output aspect ratio. 默认值: 16:9 |
| output_format | png | jpeg | 可选 | Generated file format. 默认值: png |
请求示例
curl https://qwenapi.org/api/v1/images/generations \
-H "Authorization: Bearer $QWEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen2-image",
"prompt": "A clean architectural model photographed in a daylight studio",
"aspect_ratio": "4:3",
"output_format": "png"
}'生成端点为异步任务。请使用同一个 Bearer 密钥轮询 GET /api/v1/tasks/。
