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.
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.
For more examples, see Appendix: More style effect demonstrations.
Before making an API call, complete these steps:
Video processing is time-consuming, so the API uses asynchronous invocation to prevent timeouts. The workflow:
Your input video must meet the following requirements:
curl
Python
curl
Python
Replace
Python
Submitted tasks are queued and then scheduled. Status changes to RUNNING when scheduled.
Charged only for successful tasks. Fee is calculated from output video duration (seconds) and selected resolution.
Billing formula:
Rate limits shared across accounts and RAM users.
Example: Submit a 10-second video with 720p resolution. If the task succeeds, the fee is:
If the model call fails and returns an error message, see Error codes for resolution.
Performance showcase
| Input video | Output video (Japanese manga) |
|---|---|
| %E5%8E%9F%E8%A7%86%E9%A2%91.mp4 | input_00002_%E6%BC%AB%E7%94%BBV4_00001.mp4 |
Prerequisites
Before making an API call, complete these steps:
- Get an API key from the China (Beijing) region.
- Set the API key as an environment variable.
How it works
Video processing is time-consuming, so the API uses asynchronous invocation to prevent timeouts. The workflow:
- Submit a task: Send a
POSTrequest with video URL and style parameters. The API returns a uniquetask_id. - Poll for results: Use
task_idto check status withGETrequests. When the task succeeds, the response includes the transformed video URL.
Input video requirements
Your input video must meet the following requirements:
| Constraint | Requirement |
|---|---|
| Resolution | Each side must be 256 to 4,096 pixels. Aspect ratio (longer:shorter) cannot exceed 1.8. |
| Format | MP4, AVI, MKV, MOV, FLV, TS, MPG, and MXF |
| Duration | 30 seconds maximum |
| File size | 100 MB maximum |
| URL encoding | URL-encode video URLs containing non-ASCII characters (e.g., Chinese characters). |
Supported styles
| Style code | Style name | Notes |
|---|---|---|
| 0 | Japanese manga | Default |
| 1 | American comic | |
| 2 | Fresh comic | |
| 3 | 3D cartoon | |
| 4 | Chinese cartoon | Best for inputs with ancient costumes |
| 5 | Paper art style | |
| 6 | Simple illustration | |
| 7 | Chinese ink wash painting |
Step 1: Submit a video style transform task
Request headers
| Header | Type | Required | Description |
|---|---|---|---|
Content-Type | string | Yes | The content type. Set to application/json. |
Authorization | string | Yes | API key for authentication. Format: Bearer sk-xxxx (Model Studio API key). |
X-DashScope-Async | string | Yes | Enables asynchronous processing. Must be set to enable. HTTP requests support only asynchronous processing. If missing, API returns error: "current user api does not support synchronous calls". |
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The model name. Set to video-style-transform. |
input | object | Yes | The input content. See input parameters. |
parameters | object | No | The video processing parameters. See parameters. |
input parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
video_url | string | Yes | 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. The video must meet the input video requirements. |
parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
style | int | No | 0 | The style type. Valid values: 0-7. See Supported styles for the full list. |
video_fps | int | No | 15 | The frame rate (frames per second, FPS) of the output video. Valid range: [15, 25]. |
animate_emotion | bool | No | true | Whether to optimize facial expressions. Enabling this usually improves lip sync and expression synchronization. For small facial areas, disabling may improve results. |
min_len | int | No | 720 | The pixel count of the shorter side of the output video, which controls the resolution. Valid values: 720 and 540. This parameter affects billing: a 720p video costs more than a 540p video. For details, see Billing and rate limiting. |
use_SR | bool | No | false | Whether to apply super-resolution (SR) processing after style transform. Improves video quality at no additional cost. Setting min_len to 540 with SR enabled upgrades the output to 1080p while billing at the 540p rate. This increases processing time and is recommended for high-quality output. |
Request examples
Generate a 720p video
curl
Generate a 540p video
curl
Response
Successful response
Error response
Response parameters
| Parameter | Type | Description |
|---|---|---|
output | object | The task output information. |
output.task_id | string | The unique ID for the asynchronous task. Use this ID to query the task status and results. |
output.task_status | string | The task status. Possible values: PENDING, RUNNING, SUSPENDED, SUCCEEDED, FAILED. |
request_id | string | The unique request ID. Use this ID to trace and troubleshoot issues. |
code | string | The error code. Returned only when the request fails. For details, see Error messages. |
message | string | The error details. Returned only when the request fails. For details, see Error messages. |
Step 2: Query the task status and result
Request headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | API key for authentication. Format: Bearer sk-xxxx (Model Studio API key). |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | Yes | The task ID returned from Step 1. |
Request examples
Replace {task_id} with the actual task_id from the task submission response.
curl
Response
Task succeeded
Task running
Submitted tasks are queued and then scheduled. Status changes to RUNNING when scheduled.
Task failed
Response parameters
| Parameter | Type | Description |
|---|---|---|
request_id | string | The unique request ID. Use this ID to trace and troubleshoot issues. |
output | object | The task output information. |
output.task_id | string | The task ID. Valid for 24 hours. |
output.task_status | string | The task status. Possible values: PENDING, RUNNING, SUSPENDED, SUCCEEDED, FAILED, UNKNOWN. |
output.submit_time | string | The time when the task was submitted. UTC+8 time zone. Format: YYYY-MM-DD HH:mm:ss.SSS. |
output.scheduled_time | string | The time when the task started running. UTC+8 time zone. Format: YYYY-MM-DD HH:mm:ss.SSS. |
output.end_time | string | The time when the task completed. UTC+8 time zone. Format: YYYY-MM-DD HH:mm:ss.SSS. |
output.output_video_url | string | The URL of the transformed video. Returned only when task_status is SUCCEEDED. Example: http://xxx/result.mp4. |
output.code | string | The error code. Returned only when task_status is FAILED. For details, see Error messages. |
output.message | string | The error details. Returned only when task_status is FAILED. For details, see Error messages. |
usage | object | Usage statistics for the task. Returned only when task_status is SUCCEEDED. |
usage.duration | float | The duration of the generated video in seconds. |
usage.SR | int | The pixel value of the shorter side of the video, used for billing. This value matches the min_len value you set in the request. |
Billing and rate limiting
Charged only for successful tasks. Fee is calculated from output video duration (seconds) and selected resolution.
Billing formula: Total fee = Output video duration (seconds) x Unit price for the corresponding resolution
Final fee is calculated fromdurationandSRfields in theusageobject.
Pricing
| Model | Resolution | Unit price |
|---|---|---|
| video-style-transform | 720p | $0.071677/second |
| video-style-transform | 540p | $0.028671/second |
Rate limits
Rate limits shared across accounts and RAM users.
| Limit type | Value |
|---|---|
| Queries per second (QPS) for task submission API | 2 |
| Concurrent tasks | 1 |
Billing example
Example: Submit a 10-second video with 720p resolution. If the task succeeds, the fee is: 10 seconds × $0.071677/second = $0.71677.
Error codes
If the model call fails and returns an error message, see Error codes for resolution.
Appendix: More style effect demonstrations
| Style name | Original video | Transformed video |
|---|---|---|
| Japanese manga (style=0) | %E5%8E%9F%E8%A7%86%E9%A2%91.mp4 | input_00002_%E6%BC%AB%E7%94%BBV4_00001.mp4 |
| American comic (style=1) | car_%E5%8E%9F%E5%9B%BE.mp4 | car_style_1.mp4 |
| Fresh comic (style=2) | %E6%8C%A5%E6%89%8B_%E5%8E%9F%E5%9B%BE.mp4 | %E6%8C%A5%E6%89%8B_style_2.mp4 |
| 3D cartoon (style=3) | %E9%87%8E%E9%A4%90_%E5%8E%9F%E5%9B%BE.mp4 | %E9%87%8E%E9%A4%90_style_3.mp4 |
| Chinese cartoon (style=4) | %E5%BC%B9%E7%90%B4_%E5%8E%9F%E5%9B%BE.mp4 | %E5%BC%B9%E7%90%B4_style_4.mp4 |
| Paper art style (style=5) | %E7%94%9F%E6%88%90_%E6%B1%BD%E8%BD%A6.mp4 | %E6%B1%BD%E8%BD%A6%E8%8D%89%E5%8E%9F_%E7%BA%B8%E8%89%BA%E9%A3%8E%E6%A0%BC.mp4 |
| Simple illustration (style=6) | %E6%A1%8C%E9%9D%A2_%E5%8E%9F%E5%9B%BE.mp4 | %E6%A1%8C%E9%9D%A2_style_6.mp4 |
| Chinese ink wash painting (style=7) | %E5%8F%A4%E9%95%87_%E5%8E%9F%E5%9B%BE.mp4 | %E5%8F%A4%E9%95%87_style_7.mp4 |