Wanxiang - Image-to-Video - Video Effects
A video effect template is a preset for video generation effects. Provide a first-frame image and a template value to generate a video with a specific dynamic effect -- such as "Magic Levitation" or "Squeeze". This feature is suitable for social media, marketing promotions, and interactive entertainment.
The video effects list is supported only in Image-to-Video based on the first frame and Image-to-Video based on the first and last frames.
Usage
Video effects work differently from image-to-video. Follow these rules:
- Only one first-frame image required: Whether you use a model based on the first frame or based on the first and last frames, you only need to provide one first-frame image.
- No prompt required: In effect mode, the model ignores the prompt field. It is recommended that you do not pass this parameter and focus on selecting a visual effect.
- Select one template: Choose a dynamic effect from the effects list by using the
templateparameter. The model will generate the specified dynamic effect based on the template.
NoteDifferent models support different effect templates. Make sure to refer to Effects list - first frame to video and Effects list - first and last frame to video to ensure that the template value you use matches the model.
| Input first frame | Input prompt | Input template | Output video |
|---|---|---|---|
![]() | Not required | flying
|
| Input first frame | Input last frame | Input prompt | Input template | Output video |
|---|---|---|---|---|
![]() | Not required | Not required | hanfu-1
|
Image-to-Video based on the first frame
First-frame effect: Generate an effect video from a first-frame image.
# 以下为华北2(北京)地域的URL,调用时请将 {WorkspaceId} 替换为真实的业务空间ID,各地域的URL不同。
curl --location 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
-H 'X-DashScope-Async: enable' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "wanx2.1-i2v-turbo",
"input": {
"img_url": "https://cdn.translate.alibaba.com/r/wanx-demo-1.png",
"template": "flying"
},
"parameters": {
"resolution": "720P"
}
}'
For the complete code, see Image-to-Video based on the first frame.
Python SDK
import dashscope
import os
from dashscope import DashScopeError
# 若没有配置环境变量,请用百炼API Key将下行替换为:api_key="sk-xxx"
# 获取API Key:https://help.aliyun.com/zh/model-studio/get-api-key
client = dashscope.Client(api_key=os.getenv("DASHSCOPE_API_KEY"))
def sample_async_call():
# 异步提交视频生成任务
# template(视频特效模板)为 input 段字段,不在具名签名内,经 extra_input 透传
try:
job = client.videos.jobs.create(model='wanx2.1-i2v-turbo',
image_url='https://cdn.translate.alibaba.com/r/wanx-demo-1.png',
extra_input={'template': 'flying'},
resolution='720P')
print(job)
print("task_id: %s" % job.task_id)
except DashScopeError as e:
print(f"HTTP返回码:{e.status_code}")
print(f"错误码:{e.code}")
print(f"错误信息:{e.message}")
print("请参考文档:https://help.aliyun.com/zh/model-studio/developer-reference/error-code")
return
# 查询任务状态
try:
snapshot = client.videos.jobs.fetch(job.task_id)
print(snapshot.status)
except DashScopeError as e:
print(f"HTTP返回码:{e.status_code}")
print(f"错误码:{e.code}")
print(f"错误信息:{e.message}")
print("请参考文档:https://help.aliyun.com/zh/model-studio/developer-reference/error-code")
# 等待任务完成(指数退避轮询,默认总预算24小时)
try:
done = client.videos.jobs.wait(job)
print(done)
print(done.video_url)
except DashScopeError as e:
print(f"HTTP返回码:{e.status_code}")
print(f"错误码:{e.code}")
print(f"错误信息:{e.message}")
print("请参考文档:https://help.aliyun.com/zh/model-studio/developer-reference/error-code")
if __name__ == '__main__':
sample_async_call()
Image-to-Video based on the first and last frames
First and last frame effect: You only need to provide one first-frame image; no last-frame image is required to generate a video effect.
- If you provide first_frame_url, last_frame_url, and template at the same time, last_frame_url will be ignored.
- If you provide only last_frame_url and template, the request will fail.
# 以下为华北2(北京)地域的URL,调用时请将 {WorkspaceId} 替换为真实的业务空间ID,各地域的URL不同。
curl --location 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/image2video/video-synthesis' \
-H 'X-DashScope-Async: enable' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "wanx2.1-kf2v-plus",
"input": {
"first_frame_url": "https://ty-yuanfang.oss-cn-hangzhou.aliyuncs.com/lizhengjia.lzj/tmp/11.png",
"template": "hanfu-1"
},
"parameters": {
"resolution": "720P",
"prompt_extend": true
}
}'
For the complete code, see Image-to-Video based on the first and last frames.
Effects list - first frame to video
For how to use video effects, see Usage.
Video effects depend on the template and the input image. For best results, preview the template examples first, refer to their "Input image suggestions", and then try your own images.
General effects
| Effect name | template parameter value | Example effect | Supported models | Input image suggestions |
|---|---|---|---|---|
Squeeze | squish | wanx2.1-i2v-plus wanx2.1-i2v-turbo |
| |
Spin | rotation | wanx2.1-i2v-plus wanx2.1-i2v-turbo |
| |
Poke | poke | wanx2.1-i2v-plus wanx2.1-i2v-turbo |
| |
Balloon Inflation | inflate | wanx2.1-i2v-plus wanx2.1-i2v-turbo |
| |
Molecular Diffusion | dissolve | wanx2.1-i2v-plus wanx2.1-i2v-turbo |
| |
Heat Wave Melt | melt | wanx2.1-i2v-plus |
| |
Ice Cream Planet | icecream | wanx2.1-i2v-plus |
|
Single-person effects
| Effect name | template parameter value | Example effect | Supported models | Input image suggestions |
|---|---|---|---|---|
Carousel | carousel | wanx2.1-i2v-plus wanx2.1-i2v-turbo |
| |
Love You | singleheart | wanx2.1-i2v-plus wanx2.1-i2v-turbo |
| |
Swing Time | dance1 | wanx2.1-i2v-plus |
| |
Swing Dance | dance2 | wanx2.1-i2v-plus |
| |
Star Swing | dance3 | wanx2.1-i2v-plus |
| |
Finger Rhythm | dance4 | wanx2.1-i2v-plus |
| |
Dance Switch | dance5 | wanx2.1-i2v-plus |
| |
Mermaid Awakening | mermaid | wanx2.1-i2v-plus |
| |
Academic Coronation | graduation | wanx2.1-i2v-plus |
| |
Beast Pursuit | dragon | wanx2.1-i2v-plus |
| |
Money from Heaven | money | wanx2.1-i2v-plus |
| |
Jellyfish Rendezvous | jellyfish | wanx2.1-i2v-plus |
| |
Pupil Journey | pupil | wanx2.1-i2v-plus |
|
Single-person or animal effects
| Effect name | template parameter value | Example effect | Supported models | Input image suggestions |
|---|---|---|---|---|
Magic Levitation | flying | wanx2.1-i2v-plus wanx2.1-i2v-turbo |
| |
Rose for You | rose | wanx2.1-i2v-plus wanx2.1-i2v-turbo |
| |
Shining Rose | crystalrose | wanx2.1-i2v-plus wanx2.1-i2v-turbo |
|
Two-person effects
| Effect name | template parameter value | Example effect | Supported models | Input image suggestions |
|---|---|---|---|---|
Loving Hug | hug | wanx2.1-i2v-plus wanx2.1-i2v-turbo |
| |
Interdependent | frenchkiss | wanx2.1-i2v-plus wanx2.1-i2v-turbo |
| |
Double Heartbeat | coupleheart | wanx2.1-i2v-plus wanx2.1-i2v-turbo |
|
Effects list - first and last frame to video
Video effects depend on the template and the input image. For best results, preview the template examples first, refer to their "Input image suggestions", and then try your own images.
NoteThe effects for first-and-last-frame video generation are trained on the first-and-last-frame model, but in actual use you only need to provide the first-frame image; no last frame is required, and the result is the same as generating a video from the first frame. For details, see Usage.
Single-person effects
| Effect name | template parameter value | Example effect | Supported models | Input image suggestions |
|---|---|---|---|---|
Tang Elegance | hanfu-1 | wanx2.1-kf2v-plus |
| |
Mecha Transformation | solaron | wanx2.1-kf2v-plus |
| |
Shining Cover | magazine | wanx2.1-kf2v-plus |
| |
Mechanical Awakening | mech1 | wanx2.1-kf2v-plus |
| |
Cyber Entrance | mech2 | wanx2.1-kf2v-plus |
|
API Reference
- For API parameter descriptions and complete code examples, see I2V based on first frame, I2V based on first and last frames.
、

