Image models
Qwen Image 2.0
Qwen Image 2.0 — fast, high-fidelity AI image generation & editing.
| modelId | qwen2-image-edit, qwen2-text-to-image |
| Modality | image |
| Pricing | See this model on the Pricing page for the current per-call price (with your markup). |
Operations
| Operation | modelId | Endpoint | Required input |
|---|---|---|---|
| Image Edit | qwen2-image-edit | POST /api/v1/generate | prompt, image_url |
| Text To Image | qwen2-text-to-image | POST /api/v1/generate | prompt |
| Poll task | — | GET /api/v1/task/{id}?model=qwen2-image-edit | — |
Image Edit — qwen2-image-edit
| Field | Type | Required | Values / example |
|---|---|---|---|
| prompt | string | Yes | The prompt to edit the image with Max 5000 characters. (default: Relight this fruit bowl with dramatic side lighting, deepening the shadows and adding a dewy sheen to each grape and plum for a moody Old Master still-life look.) |
| image_url | string[] | Yes | The reference image to guide the edit (image URL) |
| image_size | string | No | Image ratio (options: 1:1 | 2:3 | 3:2 | 3:4 | 4:3 | 9:16 | 16:9 | 21:9) (default: 16:9) |
| output_format | string | No | Generate image format (options: png | jpeg) (default: png) |
| seed | number | No | The same seed and the same prompt given to the same version of the model will output the same image every time (default: 0) |
| nsfw_checker | boolean | No | A configurable parameter. Defaults to true in the Playground. (true/false) (default: true) |
bash
curl -X POST https://you.bot/api/v1/generate \
-H "Authorization: Bearer $YOUBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"modelId":"qwen2-image-edit","input":{"prompt":"A photorealistic portrait of a red fox in a snowy forest, soft morning light, shallow depth of field, 85mm.","image_url":["https://example.com/input.jpg"],"image_size":"16:9","output_format":"png","seed":0,"nsfw_checker":true}}'Text To Image — qwen2-text-to-image
| Field | Type | Required | Values / example |
|---|---|---|---|
| prompt | string | Yes | Describe the content of the generated image Max 5000 characters. (default: A vast library where the bookshelves are living trees and glowing books grow like ripe fruit from the branches; a curious fox reads by lantern light, warm amber glow, soft painterly detail, whimsical storybook composition.) |
| image_size | string | No | Image ratio (options: 1:1 | 4:3 | 3:4 | 16:9 | 9:16) (default: 16:9) |
| output_format | string | No | Generate image format (options: png | jpeg) (default: png) |
| seed | number | No | The same seed and the same prompt given to the same version of the model will output the same image every time (default: 0) |
| nsfw_checker | boolean | No | A configurable parameter. Defaults to true in the Playground. (true/false) (default: true) |
bash
curl -X POST https://you.bot/api/v1/generate \
-H "Authorization: Bearer $YOUBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"modelId":"qwen2-text-to-image","input":{"prompt":"A photorealistic portrait of a red fox in a snowy forest, soft morning light, shallow depth of field, 85mm.","image_size":"16:9","output_format":"png","seed":0,"nsfw_checker":true}}'