GuideImage GenerationQwan

Image Editing

Guide to Qwen-Image-Edit models: edit single images, fuse multiple images or control structure from reference images and prompts, with parameters and examples.

Model Studio Qwen-Image Series

Use the Qwen-Image-Edit models from the Tongyi Qianwen Model Studio series to generate or edit images based on reference images (such as depth maps or edge maps) and a prompt.


Model Overview

Qwen Models

ModelDescriptionOutput image specs
qwen-image-edit-plusQwen image editing Plus series. Supports multi-image output and custom resolution.Image resolution:
- Configurable: width and height both in the [512, 2048] pixel range.
- Default: total pixels close to 1024*1024, with an aspect ratio similar to the input image (the last image when multiple images are provided).
Image format: png
Number of images: 1-6
qwen-image-edit-plus-2025-12-15
qwen-image-editSupports single-image editing and multi-image fusion.Image resolution: not configurable. Follows the default rule above.
Image format: png
Number of images: fixed at 1

Basics

  • Endpoint: POST /v1/images/edits
  • Authentication: Bearer Token (Authorization: Bearer sk-xxxxxx)
  • Content type: application/json

Request Headers

Content-Type string (Required)

Request content type. This parameter must be set to application/json.

Authorization string (Required)

Request authentication. The endpoint authenticates with your API key. Example: Bearer sk-xxxx.

Request Parameters (Request Body)

Tongyi Qianwen format

ParameterTypeRequiredDescription
modelstringYesModel name, e.g. qwen-image-edit-plus.
inputobjectYesInput content object.
└─ messagesarrayYesList of messages.
└─ └─ rolestringYesRole, usually user.
└─ └─ contentarrayYesArray containing image (reference image URL) and text (editing instruction).
└─ └─ └─ imagestringYes- Image formats: JPG, JPEG, PNG, BMP, TIFF, WEBP, and GIF.
Output images are PNG; for animated GIFs only the first frame is processed.
- Image resolution: for best results, keep both width and height between 384 and 3072 pixels. Resolution that is too low may produce blurry results; too high increases processing time.
- Image size: no more than 10MB.
- When passing a file, the platform automatically converts it to base64; to pass a public URL, use the Tongyi Qianwen parameter format.
Supported input formats
1. Public URL:
- HTTP and HTTPS protocols are supported.
- Example: https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/fpakfo/image36.webp.
2. Temporary URL:
- OSS protocol is supported; you must obtain a temporary URL by uploading the file first.
- Example: oss://dashscope-instant/xxx/2024-07-18/xxx/cat.png.
3. Base64-encoded image string
- Example: data:image/jpeg;base64,GDU7MtCZz... (truncated, for illustration only)
└─ └─ └─ textstringYesPositive prompt describing the desired image content, style, and composition.
Supports Chinese and English, up to 800 characters. Each Chinese character, letter, digit, or symbol counts as one character; anything beyond the limit is truncated.
Example: The girl in image 1 wears the black dress from image 2 and sits in the pose from image 3, keeping her outfit, hairstyle, and expression unchanged, with natural, fluid movement.
Note: the content array must contain exactly one text object, otherwise an error is returned.
parametersobjectNoControl parameters object.
└─ nintegerNoNumber of images to generate. Default 1.
For the qwen-image-2.0 series, qwen-image-edit-max, and the qwen-image-edit-plus series, you can output 1-6 images.
For qwen-image-edit, only 1 image is supported.
└─ negative_promptstringNoNegative prompt describing content you do not want in the image, used to constrain the output.
Supports Chinese and English, up to 500 characters. Each Chinese character, letter, digit, or symbol counts as one character; anything beyond the limit is truncated.
Example: low resolution, errors, worst quality, low quality, incomplete, extra fingers, bad proportions, etc.
└─ watermarkbooleanNoWhether to add a watermark.
└─ seedintegerNoRandom seed, in the range [0,2147483647].
Using the same seed keeps generated content relatively stable. If not provided, a random seed is used automatically.
Note: generation is probabilistic; even with the same seed, results are not guaranteed to be identical every time.

📤 Response

Status code: 200 OK

FieldTypeDescription
createdintegerUnix timestamp.
dataarrayResult list.
└─ urlstringURL of the edited image.
└─ b64_jsonstringBase64 data of the image.
└─ revised_promptstringThe actual prompt executed after AI optimization.

📝 Request Example

{
  "model": "qwen-image-edit-plus",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "image": "https://example.com/reference_depth_map.webp"
          },
          {
            "text": "Generate an image that matches the depth map, following this description: a battered red bicycle parked on a muddy path, with a dense primeval forest in the background"
          }
        ]
      }
    ]
  },
  "parameters": {
    "n": 1,
    "prompt_extend": true,
    "watermark": false
  }
}

💡 Developer Tips

  1. Reference image mode: Unlike OpenAI's transparent-mask editing, Qwen's editing endpoint is often used for "structural control" — for example, provide a depth map or line-art image and let the model generate an image that matches the description on top of it.
  2. Multimodal input: The content array must contain both an image object and a text object, so the model has both a visual reference and a text instruction.

On this page