Modify images via text
Getting started
This example shows how to use qwen-image-3.0-pro to generate two edited images from three input images and a prompt.
Input prompt: The girl in Image 1 wears the black dress from Image 2 and sits in the pose from Image 3.
| Input image 1 | Input image 2 | Input image 3 | Output images (multiple images) | |
|---|---|---|---|---|
![]() | ![]() | ![]() | ![]() | ![]() |
qwen-image-2.1-pro and qwen-image-2.1-turbo support one to ten. The qwen-image-2.0/qwen-image-3.0/qwen-image-2.1 series can generate one to six images. The URLs for the generated images are valid for 24 hours. Download the images to your local device promptly.
qwen-image-2.1-turbo is the most cost-efficient model in the Qwen-Image series. It supports up to 10 reference images for image-to-image tasks and can automatically output images with transparent channels based on the prompt. It does not support negative_prompt.
- Python
- Java
- curl
Response example
Response example
Download images to your local device
Download images to your local device
- Python
- Java
Input instructions
Input images (messages)
The messages parameter is an array that must contain a single object. This object must include the role and content properties. The role property must be set to user. The content property must include both image (one to three images, or one to ten for the qwen-image-2.1 series) and text (one editing instruction).
The input images must meet the following requirements:
-
The supported image formats are JPG, JPEG, PNG, BMP, TIFF, WEBP, and GIF.
The output image is in PNG format. For animated GIFs, only the first frame is processed.
- Width and height must be between 1 and 8000 pixels; values outside this range return a 400 error. For best results, use 384 to 2048 pixels: a low resolution may result in a blurry output, while a high resolution increases processing time.
- The aspect ratio (longer side to shorter side) must not exceed 10:1.
- The size of a single image file cannot exceed 10 MB.
Image input order
| Input image 1 | Input image 2 | Output image | |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |
Image input methods
Public URL
- You can provide a publicly accessible image URL that supports the HTTP or HTTPS protocol.
- Example value:
https://xxxx/img.png.
data:<mime_type>;base64,<base64_data>.
<mime_type>: The media type of the image, which must correspond to the file format.<base64_data>: The Base64-encoded string of the file.- Example value:
data:image/jpeg;base64,GDU7MtCZz...(The example is truncated for demonstration purposes.)
More parameters
Adjust the generation results using the following optional parameters:
-
n: The number of images to generate. The default value is 1. The qwen-image-2.0/3.0/2.1 series models support generating one to six images.
ndirectly affects the fee. -
negative_prompt: Describes content to exclude from the image, such as "blur" or "extra fingers". This parameter helps optimize the quality of the generated image. The
qwen-image-2.1series does not support this parameter. -
watermark: Specifies whether to add a "Qwen-Image" watermark to the bottom-right corner of the image. The default value is
false. -
seed: The random number seed. The value must be an integer from
[0, 2147483647]. If this parameter is not specified, the algorithm generates a random number to use as the seed. Using the same seed value helps ensure consistent generation results.
- size: The resolution of the output image. The format is
width*height, such as"1024*2048". For the qwen-image-2.0/3.0/2.1 series models, you can set the width and height freely. The total pixels of the output image must be between 512 x 512 and 2048 x 2048. For the qwen-image-2.0 series, the resolution defaults to the same as the input image (the last image if multiple are provided); for the qwen-image-3.0 and qwen-image-2.1 series, the model auto-recommends a resolution from the prompt when size is omitted. For the qwen-image-3.0 and qwen-image-2.1 series, the supported aspect ratio is from 1:8 to 8:1. - prompt_extend: Enables or disables the prompt rewriting feature. The default value is
true. If enabled, the model optimizes the prompt. This feature can significantly improve the results for simple or less descriptive prompts. - prompt_extend_mode: The prompt rewriting mode. Supported by the qwen-image-3.0 and qwen-image-2.1 series only. Image editing supports only the default value
direct(direct prompt enhancement, DPE); passingagentreturns a 400 error. - enable_thinking: Enables thinking mode. Supported by the qwen-image-3.0 and qwen-image-2.1 series only, for direct image editing (not supported for agent-mode image editing). Requires
prompt_extend=true. Enhances model reasoning to improve image quality but increases generation time. The default value istrue.
Overview
Multi-image fusion
| Input image 1 | Input image 2 | Input image 3 | Output image |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |
Subject consistency
| Input image | Output image 1 | Output image 2 |
|---|---|---|
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
Sketch creation
| Input image | Output image | |
|---|---|---|
![]() | ![]() | ![]() |
Creative product generation
| Input image | Output image | ||
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
Generate image from depth map
| Input image | Output image | |
|---|---|---|
![]() | ![]() | ![]() |
Generate image from keypoints
| Input image | Output image | |
|---|---|---|
![]() | ![]() | ![]() |
Text editing
| Input image | Output image | Input image | Output image |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |
| Input image | Output image | ||
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |
![]() | ![]() | ![]() | |
![]() | ![]() | ![]() |
Add, delete, replace, and modify
| Input image | Output image | Input image | Output image |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |
Viewpoint transformation
| Input image | Output image | Input image | Output image |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |
![]() | ![]() | ![]() | ![]() |
Old photo processing
| Input image | Output image |
|---|---|
![]() | ![]() |
![]() | ![]() |
OpenAI-compatible mode
Image editing also supports OpenAI-compatible mode and shares the /images/generations endpoint with text-to-image: passing image makes it an image-to-image (I2I) request. It does not use the multipart file upload format of the official OpenAI /images/edits endpoint, and mask is not supported.
- HTTP endpoint:
POST https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1/images/generations - SDK
base_url:https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1 imagetakes a public URL or Base64 data (data:{MIME_type};base64,{base64_data}). Pass a string for a single image, or an array of strings for multiple images in the order given. Theqwen-image-2.1series supports 1-10 images; theqwen-image-3.0series supports 1-3. Passingnullor an empty array returns a 400 error.
Billing and rate limits
For free quota and pricing, see pricing.
For rate limits, see Rate limits.
Billing details:
- Billing is based on the number of successfully generated images. Failed model calls or processing errors do not incur fees or consume the free quota.
- You can enable the 'Free quota only' feature to avoid extra charges after your free quota is used up. For more information, see Free quota for new users.
































































