Skip to main content
Wan2.1

Wan 2.1 — Create task

Asynchronous Wan 2.1 general image editing

POST
/services/aigc/image2image/image-synthesis
# China North 2 (Beijing). This model is available only in this region.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
curl --location 'https://cn-beijing.maas.qwencloudapi.com/api/v1/services/aigc/image2image/image-synthesis' \
  -H 'X-DashScope-Async: enable' \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "wanx2.1-imageedit",
  "input": {
    "function": "stylization_all",
    "prompt": "Convert to a French picture-book style.",
    "base_image_url": "http://wanx.alicdn.com/material/20250318/stylization_all_1.jpeg"
  },
  "parameters": {
    "n": 1
  }
}'
{
  "output": {
    "task_status": "PENDING",
    "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
  },
  "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}
The model supports 10 image editing functions:
Functionfunction valueDescription
Whole-image stylizationstylization_allApply a style to the whole image
Local stylizationstylization_localApply a style to part of the image
Instruction editingdescription_editEdit the image from a text description
Mask editingdescription_edit_with_maskPrecise editing within a mask
Watermark removalremove_watermarkRemove a watermark from the image
OutpaintingexpandExtend the canvas in four directions
Super resolutionsuper_resolutionIncrease image resolution
ColorizationcolorizationAdd color to a black-and-white image
Doodle-to-imagedoodleGenerate an image from a doodle
Cartoon feature controlcontrol_cartoon_featureCartoonize while preserving the subject's features

Authorizations

string
header
required

QwenCloud API key. See Get an API key.

Header Parameters

enum<string>
default"enable"
required

Enable asynchronous processing. Must be set to enable. HTTP requests support only asynchronous calls; omitting this header returns an error.

enable

Body

application/json
enum<string>
required

Model name.

wanx2.1-imageedit
wanx2.1-imageedit
object
required

Input data for image editing.

object

Processing options such as output count, random seed, and watermark. Different editing functions support different parameters.

Response

200-application/json
object
string

Unique request identifier for troubleshooting.