Skip to main content
qwen-image-2.1-pro balances speed, quality, and cost. It accepts up to 10 reference images for image-to-image generation and uses the prompt to decide whether to output a regular image or one with an alpha channel. qwen-image-2.1-turbo offers the best overall value in the Qwen-Image series. It accepts up to 10 reference images for image-to-image generation and uses the prompt to decide whether to output a regular image or one with an alpha channel.

Model parameters

The following Image API parameters are not supported:
  • strength
  • aspect_ratio
  • quality
  • style_preset
  • response_format
  • output_format
  • mask
  • background
See also: Official Qwen Image Generation and Editing 2.1 API documentation.
Set the output resolution with size as a widthxheight string, such as “1024x1024”. If omitted, the model recommends a resolution based on the prompt:
  • Text-to-image (T2I): Any dimensions with a total pixel count between 512x512 and 2048x2048 and an aspect ratio between 1:8 and 8:1.
  • Image-to-image (I2I): Any dimensions with a total pixel count between 512x512 and 2048x2048 and an aspect ratio between 1:8 and 8:1.
In GeekAI, use enhance_prompt instead of the official prompt_extend to expand and refine the original prompt for better image quality and detail. Set extra_body.prompt_extend_mode to select the prompt optimization mode:
  • direct: Direct prompt enhancement (DPE), the default. Suitable for most use cases and supported for both text-to-image and image-to-image generation.
  • agent: Agentic prompt enhancement (APE) provides more detailed rewrites. Text-to-image only; passing agent for image-to-image generation returns a 400 error.
Set n to specify the number of images, up to 6. The default is 1. For image-to-image generation, pass reference images in image as URLs or Base64-encoded data. Supply up to 10 images, using an array for multiple images. Requirements:
  • Supported formats: PNG, JPG, JPEG, WEBP, BMP, TIFF, and GIF.
  • Each image must be no larger than 10 MB, with a long-to-short side ratio no greater than 10:1.
  • For best results, use images with both dimensions between 384 and 2048 pixels.
Set extra_body.enable_thinking to enable thinking mode. It defaults to true and takes effect only when enhance_prompt=true. Enabling it improves image quality but takes longer.

Pricing

Like GPT-Image-2, Qwen-Image-2.1 supports any resolution from 512x512 to 2048x2048. Prices are as follows: Generated images are billed per image, regardless of size or quality.

Text-to-image generation

Give the model a clear, precise description to quickly generate a high-quality image:
To enable prompt enhancement, set enhance_prompt to true:
The response is a JSON object containing the generated image URL and Base64-encoded image data:
billed_units is the billable number of generated images.

Image-to-image generation

Single image Pass a single image in image to edit it or generate an image based on it:
Multiple images Pass multiple images in image to generate an image based on several references: