Skip to content
Docs menu

Image models

Qwen Image 2.0

On this page

Qwen Image 2.0 — fast, high-fidelity AI image generation & editing.

modelIdqwen2-image-edit, qwen2-text-to-image
Modalityimage
PricingSee this model on the Pricing page for the current per-call price (with your markup).

Operations

OperationmodelIdEndpointRequired input
Image Editqwen2-image-editPOST /api/v1/generateprompt, image_url
Text To Imageqwen2-text-to-imagePOST /api/v1/generateprompt
Poll taskGET /api/v1/task/{id}?model=qwen2-image-edit

Image Edit — qwen2-image-edit

FieldTypeRequiredValues / example
promptstringYesThe 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_urlstring[]YesThe reference image to guide the edit (image URL)
image_sizestringNoImage ratio (options: 1:1 | 2:3 | 3:2 | 3:4 | 4:3 | 9:16 | 16:9 | 21:9) (default: 16:9)
output_formatstringNoGenerate image format (options: png | jpeg) (default: png)
seednumberNoThe same seed and the same prompt given to the same version of the model will output the same image every time (default: 0)
nsfw_checkerbooleanNoA 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

FieldTypeRequiredValues / example
promptstringYesDescribe 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_sizestringNoImage ratio (options: 1:1 | 4:3 | 3:4 | 16:9 | 9:16) (default: 16:9)
output_formatstringNoGenerate image format (options: png | jpeg) (default: png)
seednumberNoThe same seed and the same prompt given to the same version of the model will output the same image every time (default: 0)
nsfw_checkerbooleanNoA 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}}'