Skip to content

Guide to fine-tuning Wanxiang video generation models

Reference, synced 2026-06-13.

flowchart TD
  n0["Models"]
  n1["Overview"]
  n2["Products"]
  n3["Solutions"]
  n4["Pricing"]
  n5["Resources"]
  n6["Partners"]
  n7["Support"]
  n8["Language"]
  n0 --> n1
  n1 --> n2
  n2 --> n3
  n3 --> n4
  n4 --> n5
  n5 --> n6
  n6 --> n7
  n7 --> n8

Free access Accelerate Delivery with Fixed-Cost Agentic CodingWatch how it works

Models

Empowering AI innovation for both enterprises and developers with Alibaba Cloud’s best-in-class Qwen models, AI-native apps, and AI solutions.

Alibaba Cloud Model Studio \ Enterprise-grade large model service and application development platform.

Try Visual Model \ Supports image understanding, image generation, and video generation.

Models

HappyHorse-1.0-T2V \ Cinematic creative generation, ultimate dynamic details Qwen3-VL-Plus \ Native VL, spatial reasoning, 1M-context video analysis Wan2.7-VideoEdit \ Supports both localized and global editing with prompt

Qwen3.6-Plus \ Native multimodal, 1M context, agentic coding Wan2.7-Image-Pro \ Interactive editing, long-text rendering, precise prompt following Qwen-Plus \ Balanced intelligence, efficient inference, production-ready performance

Qwen-Image-2.0 \ Professional infographics, exquisite photorealism Z-Image-Turbo \ Ultra-fast image generation, high throughput, cost-optimized inference Qwen3-Coder-Next \ Multi-turn tool interactions, future-ready development support

Wan2.7-T2V \ High-fidelity T2V, 15s duration, advanced camera control Wan2.7-I2V \ Cinematic I2V with emotional depth and visceral impact Wan2.7-R2V \ Up to 5 mixed image/video inputs and audio timbre cloning

GenAI Application

Qoder \ Intelligent coding assistant, available for enterprise-dedicated deployment. Qoder CN \ AI-powered coding assistant that boosts developer productivity with intelligent code completion, AI chat, multi-file editing, and task automation.

AI Service

Model Experience \ Experience full-scale, multimodal model capabilities online. Platform for AI \ An AI-native algorithm engineering platform for end-to-end modeling, training, and inference service deployment. Fine-tune Video Generation Model \ Customize Wan’s text-to-video capabilities through model fine-tuning to meet your unique requirements.

AI Use Case

AI Savings Plan Hot \ Save up to 47% on AI costs. Limited-time offer tailored to your usage. AI Video Creation \ Elevate your professional video production with Wan 2.6.

AI Token Plan \ One plan. Multiple models. Big Savings with a Fixed Subscription. AI Image Creation \ All-in-one creative suite for copywriting, image generation, and poster design.

Overview

As a global full-stack AI leader, Alibaba Cloud aims to make computing accessible to everyone and help worldwide customers accelerate innovation.

Why Alibaba Cloud

About Alibaba Cloud \ AI Powered Cloud Technology Our Global Network \ Explore our global presence and deployment regions around the world Our Global Offices \ With offices in 4 continents, we're always close to where it matters.

Asia Accelerator \ Accelerate Success in Asia with Alibaba Cloud Go Global \ Benefits of our Global Alliance Trust Center \ Empowering enterprises with a secure, compliant, and globally trusted cloud infrastructure

Customers and Insights

Olympic Games \ Alibaba Cloud Powers Olympic Games with AI-powered cloud technology Case Studies \ Learn how customers are scaling their businesses on Alibaba Cloud Analyst Reports \ Learn what the top industry analyst firms are saying about Alibaba Cloud

What's New

Events and Webinars \ Quick access to upcoming and on-demand events Product Updates \ Stay informed of the latest innovations Press Room \ Latest news and media releases

Products

Featured ProductsAI & Machine Learning Computing Container Storage Networking & CDN Security Middleware Database Analytics ComputingMedia ServicesEnterprise Services & Cloud CommunicationDomain Names and WebsitesEnd User ComputingServerlessDeveloper ToolsMigration & O&M ManagementApsara Stack

Alibaba Cloud Model Studio \ Supercharge your AI journey effortlessly with industry-leading GenAI models ApsaraDB RDS \ Store and manage your business data, with automated monitoring and backups Certificate Management Service (Original SSL Certificate) \ Create a safe and secure connection between your website and users

Elastic Compute Service (ECS) \ Host websites anywhere and scale enterprise workloads Container Service for Kubernetes (ACK) \ Run and scale containerized applications on managed Kubernetes infrastructure Object Storage Service (OSS) \ Store large amounts of data in the cloud and access it anywhere, anytime

Simple Application Server (SAS) \ All-in-one services for fast deployment Elastic IP Address (EIP) \ Manage your public IPs independently to improve internet network quality Domain Names and Website \ Get the perfect domain name to suit your every need

Solutions

Solutions by Industry Technical Solutions AI WebsitesNetworking Security and ComplianceData and AnalyticsEnterprise Service and ApplicationCloud MigrationCloud NativeHybrid CloudSMB solutions

Financial Services \ Innovate faster with Alibaba Cloud Games \ Grow your game rapidly with high global availability

New Retail \ Alibaba Cloud enables digital retail transformation to fuel growth and realize an omnichannel customer experience throughout the consumer journey. Media and Entertainment \ Ready your content for today's media market with a digitalized media journey

Supply Chain \ Power your supply chain with intelligent, efficient, and reliable solutions Sports \ Digitizing the sports industry with intelligent tech

Sustainability \ Achieve a sustainable future with low-carbon and energy-efficient technologies

Pricing

Flexible options like pay-as-you-go and clear billing rules to meet diverse business needs.

Overview & Tools

Pricing Calculator \ Get an instant pricing estimate based on your usage and needs Free Trial \ Try our 80+ cloud products for free.

Pricing Options \ Get the most out of Alibaba Cloud with flexible pricing

Optimize your cost

Migrate & Save \ Superior Performance At Lower Pricing. Save up to 50%. Promotion Center \ Unlock the latest Alibaba Cloud offers & promos

Resources

Official documentation, extensive tools, training resources, and a community to grow and innovate in the cloud.

Technical Resources

Documentation \ Product guides and FAQs Architecture Center \ Design reliable, secure, and efficient cloud architecture. Intelligent Solution Explorer \ Find the right solution for you, powered by AI

Blog \ Latest cloud insights and developer trends Whitepapers \ Research that explores the how and why behind our technology

Training&Certification

Alibaba Cloud Academy \ Build cloud skills and earn certifications with expert-led training.

Developer Hub

Alibaba Cloud Project Hub \ Explore real-world projects built by developers using our platform. Our Developer MVPs \ Celebrating the developers who lead, build, and inspire our community

Partners

Partner-first strategy offering collaborative product, sales, and service models, plus high-quality partner solutions that complement Alibaba Cloud’s capabilities.

Marketplace

AI Alliance for ISVs \ Partner with us to build and grow AI solutions together ISV Benefits \ Unlock resources, market access, and go-to-market support as an ISV partner

Alibaba Cloud Marketplace \ Explore ready-to-deploy solutions from our partners and ISVs

Find a Partner

Partner Hub \ Find your ideal partner in no time

Become a Partner

Partner Network \ A partner portal for Alibaba Cloud Channel, Technology, MSP partner and other partner programs

Support

Full-lifecycle support and expert services, from cloud advisory and migration to operations.

Support & Professional Services

Professional Services \ Expert-led services to design, migrate, and optimize your cloud journey Support Plans \ Flexible support for every stage — from startup to enterprise

Partner Support Program \ Priority technical support for partners, with dedicated managers and faster issue resolution

Contact us

Connect With Us \

Talk to a sales expert and get a custom quote for your business

Language

  • English
  • 简体中文
  • 繁體中文
  • 日本語
  • Bahasa Indonesia

Locale

Visit aliyun.com

Documentation

Alibaba Cloud Model Studio

User Guide (Models) User Guide (Application) API Reference (Models) API Reference (Application)

Search for Help Content

Getting Started

The Beginner's Guide

Well-Architected Framework

AI & Machine Learning

Platform For AI

Alibaba Cloud Model Studio

DashVector

Artificial Intelligence Recommendation

OpenSearch

Image Search

Machine Translation

Intelligent Speech Interaction

Optimization Solver

Intelligent Computing LINGJUN

Computing

Elastic Compute Service

Elastic GPU Service

Elastic Container Instance

Dedicated Host

Compute Nest

Simple Application Server

Cloud Box

Auto Scaling

Elastic High Performance Computing

Batch Compute (Deprecated)

Function Compute

Serverless App Engine

ENS

Elastic Desktop Service

App Streaming

WUYING Terminal

Cloud Phone

Edge Network Acceleration

Alibaba Cloud Linux

AgentBay

Container

Container Service for Kubernetes

Container Compute Service

Container Registry

Storage

Object Storage Service

Cloud Parallel File Storage

File Storage NAS

Tablestore

Storage Capacity Unit

Simple Log Service

Cloud Backup

Intelligent Media Management

Drive and Photo Service

Data Transport

Cloud Storage Gateway

Data Online Migration

Hybrid Cloud Storage Array

Storage Services Overview

Backup and Disaster Recovery Center

Networking and CDN

Server Load Balancer

Elastic IP Address

Internet Shared Bandwidth

Data Transfer Plan

Virtual Private Cloud

NAT Gateway

PrivateLink

Alibaba Cloud DNS PrivateZone

Network Intelligence Service

Cloud Data Transfer

IPv6 Gateway

Anycast Elastic IP Address

Cloud Enterprise Network

Global Accelerator

VPN Gateway

Smart Access Gateway

Express Connect

CDN

Edge Security Acceleration

Cloud Network Well-architected Design Guidelines

Security

Anti-DDoS

Web Application Firewall

Cloud Firewall

Security Center

Bastionhost

Secure Access Service Edge

Certificate Management Service

Key Management Service

Data Security Center

Identity as a Service

Fraud Detection

AI Guardrails

Captcha

Blockchain as a Service

ID Verification

Managed Security Service

Middleware

Enterprise Distributed Application Service

Microservices Engine

Alibaba Cloud Service Mesh

SchedulerX

ApsaraMQ for RocketMQ

ApsaraMQ for Kafka

ApsaraMQ for RabbitMQ

ApsaraMQ for MQTT

Simple Message Queue (formerly MNS)

CloudFlow

EventBridge

Application Real-Time Monitoring Service

Managed Service for Prometheus

Managed Service for Grafana

Managed Service for OpenTelemetry

Performance Testing

STAROps

Databases

ApsaraDB Console

PolarDB

ApsaraDB RDS

ApsaraDB for OceanBase (Deprecated)

Tair (Redis® OSS-Compatible)

Lindorm

Time Series Database

ApsaraDB for MongoDB

ApsaraDB for HBase

ApsaraDB for Memcache

ApsaraDB for MyBase

AnalyticDB

ApsaraDB for ClickHouse

ApsaraDB for SelectDB

Data Transmission Service

Database Autonomy Service

Data Management

Database Gateway - Deprecated

ApsaraDB for Cassandra - Deprecated

Analytics Computing

MaxCompute

Hologres

Realtime Compute for Apache Flink

Elasticsearch

Vector Retrieval Service for Milvus

E-MapReduce

Data Lake Formation

DataV

Quick BI

Quick Audience

Quick Tracking

DataWorks

DataHub

Dataphin

Media Services

ApsaraVideo VOD

ApsaraVideo Live

Intelligent Media Services

ApsaraVideo Media Processing

Apsara Video SDK

Enterprise Services & Cloud Communication

Energy Expert

CloudQuotation

Salesforce on Alibaba Cloud

GoChina ICP Filing Assistant

Marketplace

Alibaba Mail

Direct Mail

Short Message Service

Voice Service

Phone Number Verification Service

Cell Phone Number Service

Chat App Message Service

Financial Intelligence Engine

Domain Names and Websites

Domain Names

ICP Filing

Alibaba Cloud DNS

End User Computing

Elastic Desktop Service

App Streaming

WUYING Terminal

Cloud Phone

AgentBay

Internet of Things

IoT Platform

Serverless

Serverless App Engine

CloudFlow

EventBridge

Simple Message Queue (formerly MNS)

Function Compute

Developer Tools

OpenAPI Explorer

Alibaba Cloud SDK

Cloud Shell

Resource Orchestration Service

Alibaba Cloud CLI

BSS OpenAPI

Terraform

Pulumi

Ticket System API

Mobile Platform as a Service

Alibaba Cloud DevOps

API Gateway

Cloud Control API

AI Coding Assistant Lingma

Cloud Skills Portal

Migration & O&M Management

CloudOps Orchestration Service

Cloud Monitor

Intelligent Advisor

Cloud Governance Center

ActionTrail

Cloud Config

Resource Access Management

Resource Management

Cloud Architect Design Tools

Migration Hub

Server Migration Center

Service Catalog

Logic Composer

Quota Center

CloudSSO

HTTPDNS

Solutions

SAP

SuperApp

OpenLake

Membership Service

Expenses and Costs

Account Center

More

Support

Legal

Tech Share Terms and Conditions

After Sales Support

China Gateway Program

Service Level Objectives

Management Console

Security Control

When using for image-to-video, if prompt optimization or calling the official video effects does not meet your custom requirements for specific actions, effects, or styles, use model fine-tuning.

Applicable scope

  • Supported deployment modes and regions: This document applies only to the Singapore region under the international deployment mode. You must use the API key for this region: API key.

  • Fine-tuning method supported: Efficient SFT-LoRA fine-tuning.

  • Models supported for fine-tuning:

    • Image-to-video (first-frame-based): wan2.7-i2v, wan2.6-i2v, wan2.5-i2v-preview, wan2.2-i2v-flash.

    • Image-to-video (first-and-last-frame-based): wan2.2-kf2v-flash.

How to fine-tune a model

Image-to-video (first-frame-based)

Image-to-video (first-and-last-frame-based)

Fine-tuning goal: Train a LoRA model for the money rain effect.

Expected result: Input a first-frame image. No prompt is needed. The model generates a video with the money rain effect.

Input first-frame imageOutput video (before fine-tuning) > You cannot generate a consistent money rain effect every time using prompts. Motion is not controllable.Output video (after fine-tuning) > The fine-tuned model reproduces the specific money rain effect from the training dataset without prompts.

Fine-tuning goal: Train a LoRA model for the fashion magazine effect.

Expected result: Input a first-frame image and a last-frame image. No prompt is needed. The model generates a video with the fashion magazine effect.

Input first-frame imageInput last-frame imageOutput video (before fine-tuning) > You cannot generate a consistent fashion magazine effect every time using prompts. Motion is not controllable.Output video (after fine-tuning) > The fine-tuned model reproduces the specific fashion magazine effect from the training dataset without prompts.

Before running the code below, retrieve your API key and API host, and configure your API key.

Step 1: Upload your dataset

Upload your local dataset (in .zip format) to Alibaba Cloud Model Studio. Retrieve the file ID (id).

Sample training dataset: See the training set for format details.

  • Image-to-video (first-frame-based): wan-i2v-training-dataset.zip.

  • Image-to-video (first-and-last-frame-based): wan-kf2v-training-dataset.zip.

Request example

This example uses the first-frame-based image-to-video model. Only upload the training set. The system automatically splits part of it as the validation set.Uploading a dataset takes several minutes. Exact time depends on file size.

bash
curl --location --request POST 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1/files' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--form 'file=@"./wan-i2v-training-dataset.zip"' \
--form 'purpose="fine-tune"'

Response example

Save the id. This is the unique identifier for your uploaded dataset.

json
{
    "id": "file-ft-b2416bacc4d742xxxx",
    "object": "file",
    "bytes": 73310369,
    "filename": "wan-i2v-training-dataset.zip",
    "purpose": "fine-tune",
    "status": "processed",
    "created_at": 1766127125
}

Step 2: Fine-tune the model

Step 2.1 Create a fine-tuning job

Start training using the file ID from Step 1.

Note

Hyperparameter values vary by model. For hyperparameter settings, see hyperparameters. For more request examples, see request examples.

Request example

Replace <replace with training dataset file ID> fully with the id from the previous step.

Image-to-video (first-frame-based)

Image-to-video (first-and-last-frame-based)

bash
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
    "model": "wan2.7-i2v",
    "training_file_ids": [\
        "<training-dataset-file-id>"\
    ],
    "training_type": "efficient_sft",
    "hyper_parameters": {
        "n_epochs": 400,
        "batch_size": 1,
        "learning_rate": 2e-5,
        "split": 0.9,
        "eval_epochs": 50,
        "max_pixels": 147456,
        "max_split_val_dataset_sample": 5,
        "save_total_limit": 10,
        "lora_rank": 32,
        "lora_alpha": 32
    }
}'
curl
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
    "model": "wan2.2-kf2v-flash",
    "training_file_ids": [\
        "<training-dataset-file-id>"\
    ],
    "training_type": "efficient_sft",
    "hyper_parameters": {
        "n_epochs": 400,
        "batch_size": 4,
        "learning_rate": 2e-5,
        "split": 0.9,
        "eval_epochs": 50,
        "max_pixels": 262144,
        "max_split_val_dataset_sample": 5,
        "save_total_limit": 10,
        "lora_rank": 32,
        "lora_alpha": 32
    }
}'

Response example

Check these three key parameters in output:

  • job_id: Job ID. Use it to check progress.

  • finetuned_output: Name of the new fine-tuned model. Use this name for deployment and calls.

  • status: Training status. After creating the job, the initial status is PENDING. Training has not started yet.

json
{
    ...
    "output": {
        "job_id": "ft-202511111122-xxxx",
        "status": "PENDING",
        "finetuned_output": "xxxx-ft-202511111122-xxxx",
        ...
    }
}
Step 2.2 Check the fine-tuning job status

Use the job_id from Step 2.1 to check progress. Poll this endpoint until status becomes SUCCEEDED.

Note

This fine-tuning job takes several hours. Exact time depends on the model. Wait patiently.

Request example

Replace <replace with fine-tuning job job_id> in the URL fully with the value of job_id.

bash
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/<fine-tuning-job-id>' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json'

Response example

Check these two parameters in the output field:

  • status: When this value becomes SUCCEEDED, training is complete. You can deploy the model.

  • usage: Total tokens used for training. Used for billing.

json
{
    ...
    "output": {
        "job_id": "ft-202511111122-xxxx",
        "status": "SUCCEEDED",
        "usage": 432000,
        ...
    }
}

Step 3: Deploy the fine-tuned model

Step 3.1 Deploy the model as an online service

After the fine-tuning job status is SUCCEEDED, deploy the model as an online service.

Request example

Replace <replace with model name model_name> fully with the value of finetuned_output from creating the fine-tuning job.

Image-to-video (first-frame-based)

Image-to-video (first-and-last-frame-based)

bash
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/deployments' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
    "model_name": "<model-name>",
    "aigc_config": {
        "use_input_prompt": false,
        "prompt": "Provide a video description based on the image content. The description must include the phrase \"Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding her. The bills continue to fall, she/he stretches her/his arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain.\"\nOutput Template:\nThe video begins with a shot of [subject description]. [Environment description]. Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding her. The bills continue to fall, she/he stretches her/his arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain.\nExample:\nThe video begins showing a young woman standing in front of a brick wall covered with ivy. She has long, smooth reddish-brown hair, wearing a white sleeveless dress, a shiny silver necklace, and a smile on her face. The brick wall in the background is covered with green vines, appearing rustic and natural. Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding her. The bills continue to fall, she stretches her arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain.",
        "lora_prompt_default": "Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding her. The bills continue to fall, she/he stretches her/his arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain."
    },
    "capacity": 1,
    "plan": "lora"
}'
bash
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/deployments' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
    "model_name": "<model-name>",
    "aigc_config": {
        "use_input_prompt": false,
        "prompt": "Provide a video description based on the image content. The description must include the phrase \"Then she/he begins the s86b5p transformation.\"\nOutput Template:\nThe video begins with a shot of [subject description]. [Environment description]. Then she/he begins the s86b5p transformation.\nExample:\nThe video begins with a young woman in an outdoor setting. She has short, curly dark brown hair and a friendly smile. She is wearing a black Polo shirt with colorful floral embroidery. The background features green vegetation and distant mountains. Then she begins the s86b5p transformation.",
        "lora_prompt_default": "Then she/he begins the s86b5p transformation."
    },
    "capacity": 1,
    "plan": "lora"
}'

Response example

Check these two parameters in output:

  • deployed_model: Name of the deployed model. Use it to check deployment status and call the model.

  • status: Deployment status. After deploying the fine-tuned model, the initial status is PENDING. Deployment has not started yet.

json
{
    ...
    "output": {
        "deployed_model": "xxxx-ft-202511111122-xxxx",
        "status": "PENDING",
        ...
    }
}
Step 3.2 Check deployment status

Poll this endpoint until status becomes RUNNING.

Note

Deploying this fine-tuned model takes about 5–10 minutes.

Request example

Replace <replace with deployed_model> fully with the value of deployed_model from Step 3.1.

Response example

Check these two parameters in the output field:

  • status: When the status becomes RUNNING, the model is deployed successfully. You can start calling it.

  • deployed_model: Name of the deployed model.

json
{
    ...
    "output": {
        "status": "RUNNING",
        "deployed_model": "xxxx-ft-202511111122-xxxx",
        ...
    }
}

Step 4: Call the model to generate videos

After successful deployment (when the deployment status status is RUNNING), make a call.

Step 4.1: Create a video generation task and get the task_id

Request example

Replace <replace with deployed model name deployed_model> fully with the value of deployed_model from the previous step.

Image-to-video (first-frame-based)

Image-to-video (first-and-last-frame-based)

Expected result: Input a first-frame image. No prompt is needed. The model generates a video with the money rain effect.

Wan2.7

curl
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--header 'X-DashScope-Async: enable' \
--data '{
    "model": "<replace with deployed model name deployed_model>",
    "input": {
        "media": [\
            {\
                "type": "first_frame",\
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20251219/xmvyqn/lora.webp"\
            }\
        ]
    },
    "parameters": {
        "resolution": "720P",
        "prompt_extend": false
    }
}'

Wan2.6/Wan2.5/Wan2.2

curl
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--header 'X-DashScope-Async: enable' \
--data '{
    "model": "<replace with deployed model name deployed_model>",
    "input": {
        "img_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20251219/xmvyqn/lora.webp"
    },
    "parameters": {
        "resolution": "720P",
        "prompt_extend": false
    }
}'

Response example

Copy and save the task_id. Use it to query results in the next step.

json
{
    "output": {
        "task_status": "PENDING",
        "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
    },
    "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}

Input parameter description

Note

When calling a fine-tuned LoRA model, input parameter usage is mostly the same as theWan2.7 - image-to-video or Wan - image-to-video - first frame (2.1-2.6)

The table below lists only LoRA-specific parameter usage or restrictions. For general parameters not listed here (such as duration), refer to the API reference.

FieldTypeRequiredDescriptionExample value
modelstringYesModel name. You must use a fine-tuned model that is successfully deployed and has a RUNNING status.xxxx-ft-202511111122-xxxx
input.promptstringNoText prompt. Whether this parameter takes effect depends on the aigc_config.use_input_prompt setting: - If use_input_prompt=true, this parameter takes effect. The system generates the video based on this prompt. - If use_input_prompt=false, this parameter is ignored. The system uses the preset template aigc_config.prompt to auto-generate the prompt.-
parameters.resolutionstringNoResolution of the generated video. wan2.2 and wan2.5 models: 480P, 720P. Default is 720P. wan2.6 models: 720P, 1080P. Default is 720P.. wan2.7 models: 720P, 1080P. Default is 1080P..720P
parameters.prompt_extendbooleanNoEnable prompt rewriting. When calling a fine-tuned LoRA model, disable this. Set it to false.false

Expected result: Input a first-frame image and a last-frame image. No prompt is needed. The model generates a video with the fashion magazine effect.

curl
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/image2video/video-synthesis' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--header 'X-DashScope-Async: enable' \
--data '{
    "model": "<replace with deployed model name deployed_model>",
    "input": {
        "first_frame_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260113/typemn/kf2v-first.webp",
        "last_frame_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260113/ekzmff/kf2v_last.webp"
    },
    "parameters": {
        "resolution": "720P",
        "prompt_extend": false
    }
}'

Response example

Copy and save the task_id. Use it to query results in the next step.

json
{
    "output": {
        "task_status": "PENDING",
        "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
    },
    "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}

Input parameter description

Note

When calling a fine-tuned LoRA model, input parameter usage is mostly the same as the first-and-last-frame-based image-to-video API.

The table below lists only LoRA-specific parameter usage or restrictions. For general parameters not listed here (such as duration), refer to the API reference.

FieldTypeRequiredDescriptionExample value
modelstringYesModel name. You must use a fine-tuned model that is successfully deployed and has a RUNNING status.xxxx-ft-202511111122-xxxx
input.promptstringNoText prompt. Whether this parameter takes effect depends on the aigc_config.use_input_prompt setting: - If use_input_prompt=true, this parameter takes effect. The system generates the video based on this prompt. - If use_input_prompt=false, this parameter is ignored. Do not pass it. The system uses the preset template aigc_config.prompt to auto-generate the prompt.-
input.first_frame_urlstringYesURL of the first-frame image. For how to pass this, see first_frame_url parameter.https://help-static-aliyun-doc.aliyuncs.com/xxx.jpg
input.last_frame_urlstringNoURL of the last-frame image. For how to pass this, see last_frame_url parameter.https://help-static-aliyun-doc.aliyuncs.com/xxx.jpg
parameters.resolutionstringNoResolution of the generated video. Fine-tuned models support 480P, 720P. Default is 720P.720P
parameters.prompt_extendbooleanNoEnable prompt rewriting. When calling a fine-tuned LoRA model, disable this. Set it to false.false

Step 4.2: Query results using the task_id

Poll the task status using the task_id until task_status becomes SUCCEEDED. Then get the video URL.

Request example

Replace 86ecf553-d340-4e21-xxxxxxxxx with the real task_id.

curl
curl -X GET https://dashscope-intl.aliyuncs.com/api/v1/tasks/86ecf553-d340-4e21-xxxxxxxxx \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"

Response example

The video URL is valid for 24 hours. Download the video promptly.

json
{
    "request_id": "c87415d2-f436-41c3-9fe8-xxxxxx",
    "output": {
        "task_id": "a017e64c-012b-431a-84fd-xxxxxx",
        "task_status": "SUCCEEDED",
        "submit_time": "2025-11-12 11:03:33.672",
        "scheduled_time": "2025-11-12 11:03:33.699",
        "end_time": "2025-11-12 11:04:07.088",
        "orig_prompt": "",
        "video_url": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/xxx.mp4?Expires=xxxx"
    },
    "usage": {
        "duration": 5,
        "video_count": 1,
        "SR": 480
    }
}

Build a custom dataset

In addition to using the sample datasets in this guide, you can build your own dataset for fine-tuning.

Your dataset must include a training set (required) and may include a validation set (optional, supports automatic splitting from the training set). Package all files into a .zip file. Use only English letters, numbers, underscores, or hyphens in filenames.

Dataset format

Training set: Required

Image-to-video (first-frame-based)

Image-to-video (first-and-last-frame-based)

The training set includes first-frame images, training videos, and an annotation file (data.jsonl).

  • Sample training set: wan-i2v-training-dataset.zip.

  • ZIP directory structure:

star
wan-i2v-training-dataset.zip
├── data.jsonl        # Must be named data.jsonl. Max size: 20 MB.
├── image_1.jpeg      # Max resolution: 4096×4096. Formats: BMP, JPEG, PNG, WEBP.
├── video_1.mp4       # Max resolution: 4096×4096. Formats: MP4, MOV.
├── image_2.jpeg
└── video_2.mp4
  • Annotation file (data.jsonl): Each line is one training sample. It must be a JSON object. Structure:
json
{
      "prompt": "The video begins showing a young woman standing in front of a brick wall covered with ivy. She has long, smooth reddish-brown hair, wearing a white sleeveless dress, a shiny silver necklace, and a smile on her face. The brick wall in the background is covered with green vines, appearing rustic and natural. Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding her. The bills continue to fall, she stretches her arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain.",
      "first_frame_path": "image_1.jpg",
      "video_path": "video_1.mp4"
}

The training set includes first-frame images, last-frame images, training videos, and an annotation file (data.jsonl).

  • Sample training set: wan-kf2v-training-dataset.zip.

  • ZIP directory structure:

star
wan-kf2v-training-dataset.zip
├── data.jsonl                # Must be named data.jsonl. Max size: 20 MB.
├── image/                    # First-frame and last-frame images.
│   ├── image_1_first.jpg     # Max resolution: 4096×4096. Formats: BMP, JPEG, PNG, WEBP.
│   └── image_1_last.png
└── video/                    # Training videos.
      ├── video_1.mp4           # Max resolution: 4096×4096. Formats: MP4, MOV.
      └── video_2.mov
  • Annotation file (data.jsonl): Each line is one training sample. It must be a JSON object. Structure:
json
{
      "prompt": "The video begins by showing a young woman in an outdoor setting. She has short, curly dark brown hair, a smile on her face, and looks very friendly. She is wearing a black polo shirt with colorful floral embroidery, with a background of green vegetation and distant mountains. Then she begins the s86b5p transformation.",
      "first_frame_path": "image/image_1_first.jpg",
      "last_frame_path": "image/image_1_last.jpg",
      "video_path": "video/video_1.mp4"
}

Validation set: Optional

Image-to-video (first-frame-based)

Image-to-video (first-and-last-frame-based)

The validation set includes first-frame images and an annotation file (data.jsonl). Videos are not required. At each evaluation point, the training job automatically calls the model service to generate preview videos using the validation images and prompts.

  • Sample validation set: wan-i2v-valid-dataset.zip.

  • ZIP directory structure:

star
wan-i2v-valid-dataset.zip
├── data.jsonl       # Must be named data.jsonl. Max size: 20 MB.
├── image_1.jpeg     # Max resolution: 4096×4096. Formats: BMP, JPEG, PNG, WEBP.
└── image_2.jpeg
  • Annotation file (data.jsonl): Each line is one validation sample. It must be a JSON object. Structure:
json
{
      "prompt": "The video begins showing a scene of a young man standing in front of a cityscape. He is wearing a black and white checkered jacket over a black hoodie, with a smile on his face and a confident expression. The background is a city skyline at sunset, with a famous domed building and layered roofs visible in the distance, the sky filled with clouds showing warm orange-yellow hues. Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding him. The bills continue to fall while the camera slowly zooms in, he stretches his arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain.",
      "first_frame_path": "image_1.jpg"
}

The validation set includes first-frame images, last-frame images, and an annotation file (data.jsonl). Videos are not required. At each evaluation point, the training job automatically calls the model service to generate preview videos using the validation images and prompts.

  • Sample validation set: wan-kf2v-valid-dataset.zip.

  • ZIP directory structure:

star
wan-kf2v-valid-dataset.zip
├── data.jsonl                 # Must be named data.jsonl. Max size: 20 MB.
└── image/                     # First-frame and last-frame images.
      ├── image_1_first.jpg      # Max resolution: 4096×4096. Formats: BMP, JPEG, PNG, WEBP.
      └── image_1_last.jpg
  • Annotation file (data.jsonl): Each line is one validation sample. It must be a JSON object. Structure:
json
{
      "prompt": "The video begins showing a scene of a young man standing in front of a cityscape. He is wearing a black and white checkered jacket over a black hoodie, with a smile on his face and a confident expression. The background is a city skyline at sunset, with a famous domed building and layered roofs visible in the distance, the sky filled with clouds showing warm orange-yellow hues. Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding him. The bills continue to fall while the camera slowly zooms in, he stretches his arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain.",
      "first_frame_path": "image/image_1_first.jpg",
      "last_frame_path": "image/image_1_last.jpg",
}

Data scale and limits

  • Data volume: Provide at least 10 samples. More training data yields better results. We recommend 20–100 samples for stable performance.

  • ZIP archive: When uploading via API, total size ≤ 1 GB.

  • Training image requirements:

    • Formats: BMP, JPEG, PNG, WEBP.

    • Resolution ≤ 4096×4096.

    • No hard limit on individual file size (system pre-processes automatically).

  • Training video requirements:

    • Formats: MP4, MOV.

    • Resolution ≤ 4096×4096.

    • No hard limit on individual file size (system pre-processes automatically).

    • Duration per video: wan2.2 models ≤ 5 seconds; wan2.5 models ≤ 10 seconds; wan2.6 and wan2.7 models ≤ 10 seconds.

Data collection and cleaning

1. Define the fine-tuning scenario

Wanxiang supports fine-tuning for image-to-video in these scenarios:

  • Fixed video effects: Teach the model a specific visual change, such as a carousel or magic costume change.

  • Fixed character actions: Improve the model’s ability to reproduce specific body movements, such as dance moves or martial arts techniques.

  • Fixed camera motion: Replicate complex cinematography, such as push, pull, pan, tilt, or orbit shots.

2. Collect raw assets
  • AI generation and filtering: Use the Wanxiang foundation model to batch-generate videos. Manually select high-quality samples that best match your target effect. This is the most common method.

  • Real-world filming: If you need high realism for interactive scenes (e.g., hugging, shaking hands), use real footage.

  • 3D software rendering: For effects or abstract animations requiring precise control, use 3D software (e.g., Blender, Cinema 4D).

3. Clean the data
DimensionPositive RequirementsNegative example
DimensionPositive RequirementsNegative example
ConsistencyCore features must be highly uniform. Example: For training “360-degree rotation”, all videos must rotate clockwise at roughly the same speed.Mixed directions. The dataset contains both clockwise and counterclockwise rotations. The model does not know which direction to learn.
DiversityMore variety in subjects and scenes is better. Cover different subjects (men, women, children, animals, buildings) and compositions (close-ups, wide shots, high angles, low angles). Also vary resolution and aspect ratio.Single scene or subject. All videos show “a person in red clothes rotating in front of a white wall”. The model may mistakenly treat “red clothes” and “white wall” as part of the effect. It fails when clothes change.
BalanceData types should be balanced. If multiple styles exist, their counts should be roughly equal.Severe imbalance. 90% are portrait videos, 10% are landscape videos. The model may perform poorly on landscape videos.
PurityClean and clear visuals. Use original assets without interference.Interfering elements. Videos contain subtitles, logos, watermarks, obvious black bars, or noise. The model may learn the watermark as part of the effect.
DurationAsset duration ≤ target duration. If you want 5-second videos, crop assets to 4–5 seconds.Too long assets. You want 5-second videos but feed the model 8-second assets. This leads to incomplete action learning and a choppy feel.

Video annotation: Write prompts for videos

In the dataset annotation file (data.jsonl), each video has a corresponding prompt. The prompt describes the video content. Prompt quality directly determines what the model learns.

Prompt example The video begins with a young woman standing in front of a brick wall covered with ivy. She has long, smooth reddish-brown hair, wearing a white sleeveless dress, a shiny silver necklace, and a smile on her face. The background is a brick wall covered with green vines, appearing rustic and natural. Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding her. The bills continue to fall, she stretches her arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain.

Prompt writing formula

Prompt = [Subject description] + [Background description] + [Trigger word] + [Motion description]

Prompt elementDescriptionGuidanceExample
Prompt elementDescriptionGuidanceExample
Subject descriptionDescribe people or objects present in the frameRequiredThe video begins with a young woman...
Background descriptionDescribe the environment where the subject is locatedRequiredThe background is a brick wall covered with green vines...
Trigger wordA rare, meaningless wordRecommendeds86b5p or m01aa
Motion descriptionDescribe the dynamic changes during the effect in detailRecommendedCountless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain...
About trigger words
  • What is a trigger word?

It acts as a "visual anchor". Many complex motions (e.g., a unique dance path or light effect) are hard to describe in text. A trigger word forces the model to generate that exact visual effect when it sees the word.

  • Why use it?

Fine-tuning builds a mapping between text and video features. The trigger word binds a hard-to-describe effect to a unique word so the model can lock onto the target.

  • If we have a trigger word, why describe motion in detail?

They serve different roles and work better together.

  • Motion description explains what happens in the scene. It tells the model basic physical actions and logic. Motion descriptions are usually consistent across samples.

  • Trigger word explains what the action specifically looks like. It represents unique changes and features that words cannot describe.

How to write good prompts

Follow consistency rules for effect descriptions

For all samples containing the same effect, keep the motion description part as consistent as possible. Apply this rule to both training and validation sets.

  • Purpose: When the model sees s86b5p followed by the same fixed description and always sees money rain, it learns that s86b5p = money rain visual effect.

  • Example: Whether the subject is a “young woman” or a “man in a suit”, the prompt ends the same way for the money rain effect: “...then the s86b5p money rain effect begins, countless US dollar bills pour down like a torrential rain...”

Sample typePrompt content (Note consistency in underlined parts)
Sample typePrompt content (Note consistency in underlined parts)
Training sample 1The video begins with a young woman standing in front of a brick wall... (environment description omitted)... Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding her. The bills continue to fall, she stretches her arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain.
Training sample 2The video begins with a man in a suit in a high-end restaurant... (environment description omitted)... Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding him. The bills continue to fall, he stretches his arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain.
Validation sample 1The video begins with a young child standing in front of a cityscape... (environment description omitted)... Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding him. The bills continue to fall while the camera slowly zooms in, he stretches his arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain.
Use AI to generate prompts

To get high-quality prompts, use multimodal large language models such as Qwen-VL to assist.

  1. Use AI to generate initial descriptions

  2. Free-form brainstorming (find inspiration): If you’re unsure how to describe the effect, let AI explore freely.

    • Send “Describe the video content in detail” and observe the model’s output.

    • Focus on terms the model uses for motion trajectory (e.g., “pour down like a torrential rain”, “camera slowly zooms in”). These terms can be used for later optimization.

  3. Fixed-format prompting (standardize output): Once you have a rough idea, design a fixed format to guide AI to generate prompts that match your template.

    Example code

    See visual understanding for API call details.

    python
    import os
    from openai import OpenAI
    
    client = OpenAI(
        # API keys differ between Beijing and Singapore regions. Get your API key: https://www.alibabacloud.com/help/zh/model-studio/get-api-key
        # If you haven’t set environment variables, replace the next line with: api_key="sk-xxx".
        api_key=os.getenv("DASHSCOPE_API_KEY"),
        # Base URL for Singapore region. For Beijing region, replace with: https://dashscope.aliyuncs.com/compatible-mode/v1
        base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
    )
    completion = client.chat.completions.create(
        model="qwen3-vl-plus",
        messages=[\
            {"role": "user","content": [{\
                # When passing a video file directly, set type to video_url.\
                # With OpenAI SDK, frames are sampled every 0.5 seconds by default and cannot be changed. For custom frame rates, use DashScope SDK.\
                "type": "video_url",\
                "video_url": {"url": "https://cloud.video.taobao.com/vod/Tm1s_RpnvdXfarR12RekQtR66lbYXj1uziPzMmJoPmI.mp4"}},\
                {"type": "text", "text": "Analyze the video carefully and generate a detailed video description using the following fixed format:"\
                                        "Format template: The video begins with [subject description]. The background is [background description]. Then the s86b5p melting effect begins, [detailed motion description]."\
                                        "Requirements:"\
                                        "1.[Subject description]: Describe people or objects in the frame in detail, including appearance, clothing, and expressions."\
                                        "2.[Background description]: Describe the environment, lighting, and weather in detail."\
                                        "3.[Motion description]: Describe dynamic changes during the effect (e.g., how objects move, how lighting changes, how the camera moves)."\
                                        "4.Integrate all content naturally into the format. Do not keep “[ ]” symbols or add unrelated text."}]\
             }]
    )
    print(completion.choices[0].message.content)
  4. Extract effect templates

  5. Run the process multiple times on samples with the same effect. Identify high-frequency, accurate phrases used to describe the effect. Extract a generic “effect description”.

  6. Copy and paste this standardized effect description into all samples for that effect.

  7. Keep unique “subject” and “background” descriptions for each sample. Replace only the “effect description” part with the unified template.

  8. Manual review

AI may hallucinate or make detection errors. As a final step, perform a manual check. For example, confirm that the descriptions of the entity and background match the actual scene.

Evaluate the model using a validation set

Specify a validation set

A fine-tuning job requires a training set. A validation set is optional. You can choose to let the system split automatically or upload manually. Specify as follows:

Method 1: No validation set uploaded (system splits automatically)

When you create a fine-tuning job, if you do not upload a separate validation set, meaning the validation_file_ids parameter is not passed, the system automatically splits a portion of the training set to use as the validation set based on the following two hyperparameters:

  • split: Proportion of training data to split. For example, 0.9 means 90% for training and 10% for validation.

  • max_split_val_dataset_sample: Maximum number of samples for the auto-split validation set.

Validation set split rule: The system selects the smaller value between dataset size × (1 - split) and max_split_val_dataset_sample.

  • Example: Suppose you upload only a training set with 100 samples, split=0.9 (10% for validation), and max_split_val_dataset_sample=5.

    • Theoretical split: 100 × 10% = 10 samples.

    • Actual split: min(10, 5)=5. So the system uses only 5 samples for the validation set.

Method 2: Upload a validation set manually (using validation_file_ids)

If you prefer to evaluate checkpoints using your own prepared data instead of relying on random system splits, upload a custom validation set.

Note: Once you choose manual upload, the system ignores the automatic split rules above and validates only with your uploaded data.

Steps: Upload a validation set manually

  1. Prepare the validation set: Package validation data into a standalone .zip file. See validation set format.

  2. Upload the validation set: Call the upload dataset API to upload this .zip file. Get a dedicated file ID.

  3. Specify the validation set when creating the job: When calling the create fine-tuning job API, put this file ID in the validation_file_ids parameter.

json
{
       "model":"wan2.5-i2v-preview",
       "training_file_ids":[ "<training set file ID>" ],
       "validation_file_ids": [ "<custom validation set file ID>" ],
       ...
}

Select the best checkpoint for deployment

During training, the system saves periodic “snapshots” (checkpoints). By default, the system outputs the final checkpoint as the fine-tuned model. But intermediate checkpoints may outperform the final version. You can pick the best one for deployment.

The system runs checkpoints on the validation set and generates preview videos at intervals defined by the hyperparametereval_epochs.

  • Evaluation: Judge by watching the preview videos directly.

  • Selection criteria: Pick the checkpoint with the best visual quality and no motion distortion.

Procedure

Step 1: View preview results for checkpoints
Step 1.1 List validated checkpoints

This API returns only checkpoints that passed validation and successfully generated preview videos. Failed checkpoints are not listed.

Request example

  • <replace_with_fine-tuning_job_id>: Replace fully with the job_id from the create fine-tuning job API.
curl
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/<replace_with_fine-tuning_job_id>/validation-results' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json'

Response example

This API returns a list of checkpoint names that passed validation.

json
{
    "request_id": "da1310f5-5a21-4e29-99d4-xxxxxx",
    "output": [\
        {\
            "checkpoint": "checkpoint-160"\
        },\
        ...\
    ]
}
Step 1.2 View validation results for a checkpoint

Select one checkpoint from the list above (e.g., “checkpoint-160”) and view its video result.

Request example

  • <replace_with_fine-tuning_job_id>: Replace fully with the job_id from creating the fine-tuning job.

  • <replace_with_selected_checkpoint>: Replace fully with the checkpoint value, e.g., “checkpoint-160”.

curl
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/<replace_with_fine-tuning_job_id>/validation-details/<replace_with_selected_checkpoint>?page_no=1&page_size=10' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"

Response example

The preview video URL is video_path. It is valid for 24 hours. Download and review promptly. Repeat this step to compare multiple checkpoints and find the best one.

json
{
    "request_id": "375b3ad0-d3fa-451f-b629-xxxxxxx",
    "output": {
        "page_no": 1,
        "page_size": 10,
        "total": 1,
        "list": [\
            {\
                "video_path": "https://finetune-swap-wulanchabu.oss-cn-wulanchabu.aliyuncs.com/xxx.mp4?Expires=xxxx",\
                "prompt": "The video begins with a young man sitting in a cafe. He is wearing a beige Polo shirt, looking focused and slightly contemplative, with his fingers gently touching his chin. In front of him is a cup of hot coffee. The background is a wall with wooden stripes and a decorative sign. Then the s86b5p money rain effect begins, and countless enormous US dollar bills (beige with dark green patterns) pour down like a torrential rain, densely hitting and surrounding him. The bills continue to fall as he stretches his arms upward, neck slightly tilted back, with a surprised expression, completely immersed in this wild money rain.",\
                "first_frame_path": "https://finetune-swap-wulanchabu.oss-cn-wulanchabu.aliyuncs.com/xxx.jpeg"\
            }\
        ]
    }
}
Step 2: Export the checkpoint and get the model name for deployment
Step 2.1 Export the model

Assume “checkpoint-160” gives the best result. Now export it.

Request example

  • <replace_with_fine_tuning_job_id>: Replace fully with the job_id from creating the fine-tuning job.

  • <replace_with_checkpoint_to_export>: Replace fully with the checkpoint value, e.g., “checkpoint-160”.

  • <replace_with_exported_model_name_for_console_display>: Replace fully with a custom model name for console display, e.g., “wan2.5-checkpoint-160”. This name must be globally unique. Duplicate names are not allowed. For parameter guidance, see export checkpoint.

curl
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/<replace_with_fine-tuning_job_id>/export/<replace_with_checkpoint_to_export>?model_name=<replace_with_exported_model_name_for_console_display>' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"

Response example

The response parameter output=true means the export request was created successfully.

json
{
    "request_id": "0817d1ed-b6b6-4383-9650-xxxxx",
    "output": true
}
Step 2.2 Query the new model name after deployment

Query all checkpoint statuses to confirm export completion and get the unique model name (model_name) for deployment.

Request example

  • <replace_with_fine-tuning_job_id>: Replace fully with the job_id from creating the fine-tuning job.
curl
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/<replace_with_fine-tuning_job_id>/checkpoints' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"

Response example

In the returned list, locate the exported checkpoint (e.g., checkpoint-160). When its status becomes SUCCEEDED, export succeeded. The model_name field is the new model name for deployment and calls.

json
{
    "request_id": "b0e33c6e-404b-4524-87ac-xxxxxx",
    "output": [\
         ...,\
        {\
            "create_time": "2025-11-11T13:27:29",\
            "full_name": "ft-202511111122-496e-checkpoint-160",\
            "job_id": "ft-202511111122-496e",\
            "checkpoint": "checkpoint-160",\
            "model_name": "xxxx-ft-202511111122-xxxx-c160", // Important field. Use for model deployment and calls.\
            "model_display_name": "xxxx-ft-202511111122-xxxx",\
            "status": "SUCCEEDED" // Successfully exported checkpoint.\
        },\
        ...\
\
    ]
}
Step 3: Deploy and call the model

After successfully exporting the checkpoint and getting the model_name, follow these steps:

  • Model deployment: In the input parameter model_name, enter the specific value obtained after export.

  • Model call: Follow the API documentation to call the deployed model.

Go live

In production, if the initial trained model performs poorly (e.g., distorted visuals, weak effects, inaccurate motion), tune along these dimensions:

1. Check data and prompts

  • Data consistency: Consistency is critical. Check for “bad samples” with opposite directions or vastly different styles.

  • Sample count: Increase high-quality data to 20+ samples.

  • Prompt: Ensure trigger words are meaningless, rare terms (e.g., s86b5p). Avoid common words (e.g., running) that cause interference.

2. Adjust hyperparameters: See hyperparameters for details.

  • n_epochs (training epochs)

    • Default: 400. Use the default unless necessary. If adjusting, follow the rule: “Total training steps ≥ 800”.

    • Total steps formula: steps = n_epochs × ceiling (training set size / batch_size).

    • n_epochs minimum formula: n_epochs = 800 / ceiling (dataset size / batch_size).

    • Example: Assume a training set of 5 samples, using the Wan2.5 model (batch_size=2).

      • Steps per epoch: 5 / 2 = 2.5, rounded up to 3. Total epochs: n_epochs = 800 / 3 ≈ 267. This is the recommended minimum. You can increase it as needed.
  • You can use the default values for learning_rate (learning rate) and batch_size (batch size). These values typically do not require modification.

Billing

  • Model training: Charged.

    • Cost = Total training tokens × Unit price. See model training billing.

    • After training, check the total tokens consumed in the usage field of the query fine-tuning job status API.

  • Model deployment: Free.

  • Model calls: Charged.

    • Billed according to the standard call price of the fine-tuned foundation model. See model pricing.

API reference

Video generation model fine-tuning API reference

FAQ

Q: How are training and validation set data volumes calculated?

A: The training set is required, the validation set is optional. Calculation methods are as follows:

  • When no validation set is provided: The uploaded training set is the "total dataset size". The system automatically splits part of the data for validation.

    • Validation set size = min(total dataset size × (1 − split), max_split_val_dataset_sample). For an example, see specify a validation set.

    • Training set size = total dataset size − validation set size.

  • When a validation set is uploaded manually: The system no longer splits the validation set from the training data.

    • Training set size = Uploaded training set data volume.

    • Validation set size = Uploaded validation set data volume.

Q: How do I design a good trigger word?

A: Follow these rules:

  • Use meaningless letter combinations, such as sksstyle, a8z2_bbb.

  • Avoid common English words (e.g., beautiful, fire, dance). This prevents polluting the model's original understanding of these words.

Q: Can fine-tuning change video resolution or duration?

A: No. Fine-tuning learns "content" and "dynamics", not "specifications". Output video format (resolution, frame rate, maximum duration) is still determined by the foundation model.

Previous: Fine-tune with the APINext: Model Deployment

Is this page helpful?

Applicable scope

How to fine-tune a model

Step 1: Upload your dataset

Step 2: Fine-tune the model

Step 3: Deploy the fine-tuned model

Step 4: Call the model to generate videos

Build a custom dataset

Dataset format

Data scale and limits

Data collection and cleaning

Video annotation: Write prompts for videos

Evaluate the model using a validation set

Specify a validation set

Select the best checkpoint for deployment

Go live

Billing

API reference

FAQ

Contact Us

Sales Support

Live-chat with our sales team or get in touch with a business development professional in your region.

Contact Sales

Technical Support

Open a ticket and get quick help from our technical team.

Open a Ticket >

Connect & Report Abuse

We look forward to your suggestion.

Post a Suggestion > Report Abuse >

\ \ Hi, I'm Alibaba Cloud AI Assistant!\ \ I can help with questions and solutions.

Why Alibaba Cloud

About Alibaba Cloud

Asia Accelerator

Our Global Network

Global Offices

Trust Center

Case Studies

Analyst Reports

Products & Pricings

Pricing Calculator

ECS

SAS

Model Studio

Database

Security

SMS

Solutions

Financial Services

Retail Services

Media Services

Gaming Services

ISV Solutions

Engage

Developer Community

Partner Network

Startups

Marketplace

Join Alibaba Cloud

Resources & Support

Developer Learning Hub

Documentation Center

Training & Certification

Service Notices

Submit a Ticket

Security Report

Qwen Cloud

Careers About Us Privacy Policy Legal Integrity Compliance Reporting Channel Service Notices Links

© 2009-2026 Copyright by Alibaba Cloud All rights reserved

© 2009-2026 Copyright by Alibaba Cloud All rights reserved

Careers About Us Privacy Policy Legal Integrity Compliance Reporting Channel Service Notices Links