Transform input videos into artistic styles while preserving smooth motion and content coherence. Supports eight styles: Japanese manga, American comic, fresh comic, 3D cartoon, Chinese cartoon, paper art, simple illustration, and Chinese ink wash painting.
Effect showcase
| Input video | Output video (Japanese manga) |
|---|---|
Prerequisites
Before calling the API, you need to get an API key, and then set the API key as the environment variable DASHSCOPE_API_KEY.
HTTP invocation
Video processing is time-consuming. To avoid synchronous request timeouts, video style transform uses asynchronous invocation, which consists of the following two steps:
- Submit an asynchronous task: Send a
POSTrequest with the original video URL and the desired style parameters to obtain a uniquetask_id. - Query the task result: Use the
task_idto poll the task status withGETrequests until the task is completed and the URL of the result video is obtained.
Step 1: Submit a video style transform task
RequestRequest headersContent-Typestring (required)The content type of the request. This parameter must be set to application/json.Authorizationstring (required)The authentication of the request. The API uses an Alibaba Cloud Model Studio API key for authentication. Example value: Bearer sk-xxxx.X-DashScope-Asyncstring (required)The asynchronous processing configuration parameter. HTTP requests only support asynchronous processing, and it must be set to enable.Request bodymodelstring (required)The model name. Set it to video-style-transform.inputobject (required)The input content.
Attributes video_url string (required)The public URL of the input video. Example: https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250704/viwndw/%E5%8E%9F%E8%A7%86%E9%A2%91.mp4.Input video requirements:
object (optional)The video processing parameters.
Attributes style int (optional)The style type. Preset types are as follows:
int (optional)The frame rate of the generated video. The default is 15, and the valid range is [15, 25].animate_emotionbool (optional)Whether to optimize facial expressions. The default is true.When enabled, it usually improves the accuracy of lip sync and expression synchronization. When the face area accounts for a small proportion of the frame, disabling this option may produce better results.min_lenint (optional)The short-side pixel count of the output video, used to control the resolution. Valid values are 720 or 540, and the default is 720.This parameter value affects billing. A 720P video costs more than a 540P video. For details, see Billing and rate limiting. bool (optional)Whether to apply super-resolution (SR) processing to the style-transformed video. The default is false. Setting it to true improves the video quality at no extra cost.If min_len is set to 540, enabling this option upgrades the output video to 1080P quality, but billing is still based on the 540P standard. This increases the processing time. We recommend enabling it when high-quality output is required. |
bash |
ResponseoutputobjectThe task output information.
Attributes task_id stringThe task ID, the unique identifier of the task, used for subsequent queries.task_statusstringThe task status.
stringThe unique identifier of the request. It can be used for request tracing and troubleshooting.codestringThe error code returned when the request fails. This parameter is not returned when the request succeeds. For details, see Error codes.messagestringThe detailed error information returned when the request fails. This parameter is not returned when the request succeeds. For details, see Error codes. |
Step 2: Query the task status and result
RequestRequest headersAuthorizationstring (required)The authentication of the request. The API uses an Alibaba Cloud Model Studio API key for authentication. Example value: Bearer sk-xxxx.URL path parameterstask_idstring (required)The task ID. |
You need to replace {task_id} with the actual task_id.bash |
Responserequest_idstringThe unique identifier of the request. It can be used for request tracing and troubleshooting.outputobjectThe task output information.
Attributes output_video_url stringThe URL of the result video. Example: http://xxx/result.mp4.task_id stringThe task ID. Valid for queries within 24 hours.task_statusstringThe task status.
stringThe time when the task was submitted. Format: YYYY-MM-DD HH:mm:ss.SSS.scheduled_time stringThe time when the task was executed. Format: YYYY-MM-DD HH:mm:ss.SSS.end_time stringThe time when the task was completed. Format: YYYY-MM-DD HH:mm:ss.SSS.codestringThe error code returned when the request fails. This parameter is not returned when the request succeeds. For details, see Error codes.messagestringThe detailed error information returned when the request fails. This parameter is not returned when the request succeeds. For details, see Error codes.objectUsage statistics of the output.
Attributes duration floatThe duration of the generated video (in seconds).SRintThe short-side pixel value of the video used for billing (this value is the same as the min_len value you set in the request). |
|
Billing and rate limiting
Only tasks that execute successfully are billed. The fee is calculated based on the actual duration (in seconds) of the output video and the selected resolution.
Billing formula: Total fee = Output video duration (seconds) x Unit price for the corresponding resolution (the final fee will be settled strictly based on the usage object's duration and SR fields returned after the task succeeds)
The free quota is deducted based on the output video duration, regardless of the video resolution.
Model name | Free quota (View) | Unit price | Rate limits (shared by the primary account and RAM sub-accounts) | ||
|---|---|---|---|---|---|
QPS limit of the task submission API | Number of tasks being processed simultaneously | ||||
video-style-transform | 600 seconds | 720P | CNY 0.5/second | 2 | 1 |
540P | CNY 0.2/second | ||||
10 seconds x CNY 0.5/second = CNY 5.
Error codes
If the model call fails and returns an error message, see Error codes for troubleshooting.
Appendix: More style effect demonstrations
| Style name | Original video | Style transform effect |
|---|---|---|
| Japanese manga (style=0) | ||
| American comic (style=1) | ||
| Fresh comic (style=2) | ||
| 3D cartoon (style=3) | ||
| Chinese cartoon (style=4) | ||
| Paper art style (style=5) | ||
| Simple illustration (style=6) | ||
| Chinese ink wash painting (style=7) |