モデル概要
- エンドポイント
- /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/ をポーリングしてください。
