本文档提供万相 图生视频模型 微调的完整 API 参考。
适用范围
上传数据集
API描述:将本地的数据集(.zip 格式)上传到阿里云百炼平台,获取唯一的文件ID(id)。
通过 API 上传时,zip 压缩包大小 ≤ 1GB。
请求接口
POST https://dashscope-intl.aliyuncs.com/compatible-mode/v1/files
Content-type: multipart/form-data入参描述
字段 | 传参方式 | 类型 | 必选 | 描述 | 示例值 |
file | Body (form-data) | file | 是 | 本地数据集文件(.zip格式)。 传参时需使用格式 | @"./wan-i2v-training-dataset.zip" |
purpose | Body (form-data) | string | 是 | 微调任务固定为 fine-tune。 | fine-tune |
出参描述
字段 | 类型 | 描述 | 示例值 |
id | string | 文件ID。文件在平台内的唯一标识符,用于创建微调任务。 | file-ft-b2416bacc4d742xxxx |
object | string | 上传类型。 | file |
bytes | integer | 上传文件的字节数。 | 73310369 |
filename | string | 文件名。 | wan-i2v-training-dataset.zip |
purpose | string | 任务目标。微调任务固定为 fine-tune。 | fine-tune |
status | string | 上传文件的状态。 processed表示已成功上传。 | processed |
created_at | integer | 创建时间。格式为Unix 时间戳。 | 1766127125 |
请求示例
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"'响应示例
请复制并保存 id,这是上传数据集的唯一标识。
{
"id": "file-ft-b2416bacc4d742xxxx",
"object": "file",
"bytes": 73310369,
"filename": "wan-i2v-training-dataset.zip",
"purpose": "fine-tune",
"status": "processed",
"created_at": 1766127125
}创建微调任务
API描述:基于指定的基准模型和上传的数据集,启动模型微调训练任务。
请求接口
POST https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes
Content-type: application/json入参描述
字段 | 传参方式 | 类型 | 必选 | 描述 | 示例值 |
model | Body | string | 是 | 指定微调所用的基准模型。
| wan2.5-i2v-preview |
training_file_ids | Body | array[string] | 是 | 训练集文件ID数组,可传入多个ID。 | ["file-ft-b2416bacc4d742xxxx"] |
validation_file_ids | Body | array[string] | 否 | 验证集文件ID数组,可传入多个ID。 若不提供,系统会从训练集中自动划分。 | - |
training_type | Body | string | 是 | 微调类型,当前仅支持 | efficient_sft |
hyper_parameters | Body | object | 否 | 超参数配置。 | 见下表 |
超参数(hyper_parameters)
初次训练时,推荐使用默认的超参数。若模型效果不佳或训练不收敛,可以尝试调整 n_epochs或learning_rate等参数。
字段 | 类型 | 必选 | 描述 | 默认值 |
batch_size | int | 是 | 批次大小。 一次性送入模型进行训练的数据条数。
| wan2.6: 2 wan2.5: 2 wan2.2: 4 |
n_epochs | int | 是 | 训练循环次数。 训练总步数(steps)由训练轮数(n_epochs)、数据集大小和批大小(batch_size)共同决定,计算公式为:steps = n_epochs × 向上取整(数据集大小 / batch_size)。 为确保模型充分训练,建议总训练步数不少于 800 步。推荐的最小训练轮数可按此公式估算: 例如:数据集有5条数据,batch_size为2,则每轮训练步数=向上取整(5/2)= 3,所需最小训练轮数n_epochs = 800 / 3 ≈ 267。此值为推荐最小值,可适当调高。 | 400 |
learning_rate | float | 是 | 学习率。控制模型权重更新的幅度。 过高可能导致模型变差,过低则变化不明显。推荐使用默认值。 | 2e-5 |
eval_epochs | int | 是 | 验证间隔。取值需≥ 训练期间每隔多少个epoch进行一次验证评估,用于阶段性评估模型训练效果。 | 50 |
max_pixels | int | 是 | 训练视频的最大分辨率。 设置训练集中输入视频分辨率的像素总数(宽×高)限制。系统仅对超过该值的视频进行缩放处理,未超限的视频将保持原样。
| wan2.6:36864 wan2.5:36864 wan2.2:262144 |
split | float | 否 | 训练集划分比例。取值范围为 (0, 1)。 仅在未指定 此参数用于从训练集中自动按比例拆分出验证集。例如,0.9表示90%训练集,10%验证集。最终验证集的数量还会受到 | 0.9 |
max_split_val_dataset_sample | int | 否 | 从训练集中自动划分验证集的最大样本数。取值需≥1。 仅在未指定 该参数为验证集数量设置了一个上限,具体为:
例如:数据集共100条,split为0.9 (即取10%作验证集),max_split_val_dataset_sample为5。计算出的验证集为10条(100×0.1),但由于上限为5,最终只会使用5条数据作为验证集。 | 5 |
save_total_limit | int | 否 | Checkpoint 保存数量上限。 限制最多保存的模型数量。系统将始终只保存训练生成的最后 N 个 Checkpoint(N 为该参数值)。 | 20 |
lora_rank | int | 否 | LoRA 低秩矩阵的维数。推荐使用默认值。 该值决定了微调参数量的大小。数值越大,模型拟合能力越强,但训练速度会变慢。 取值必须为2n(如 16、32、64)。 | 32 |
lora_alpha | int | 否 | LoRA 权重的缩放系数。推荐使用默认值。 用于调节微调后的参数对原模型权重的影响程度(通常与 lora_rank 配合使用)。 取值必须为2n(如 16、32、64)。 | 32 |
出参描述
字段 | 类型 | 描述 | 示例值 |
request_id | string | 请求的唯一标识符。 | 0eb05b0c-02ba-414a-9d0c-xxxxxxxxx |
output | object | 任务详情。 | - |
output.job_id | string | 模型微调任务唯一标识,用于后续查询任务状态。 | ft-202511111122-xxxx |
output.job_name | string | 模型微调任务名称。 | ft-202511111122-xxxx |
output.status | string | 微调训练任务的状态:
| PENDING |
output.finetuned_output | string | 微调后产出的新模型名称。部署和调用时需要用到。 | wan2.5-i2v-preview-ft-202511111122-xxxx |
output.model | string | 使用的基准模型。 | wan2.5-i2v-preview |
output.base_model | string | 使用的基准模型。 | wan2.5-i2v-preview |
output.training_file_ids | array | 使用的训练集文件ID列表。 | ["file-ft-b2416bacc4d742xxxx"] |
output.validation_file_ids | array | 使用的验证集文件ID列表。若未上传验证集,为空列表。 | [] |
output.hyper_parameters | object | 实际使用的超参数。 | {...} |
output.training_type | string | 模型微调的训练方式。固定为efficient_sft。 | efficient_sft |
output.create_time | string | 任务创建时间。 | 2025-11-11 11:22:22 |
output.workspace_id | string | 阿里云百炼API Key所属的业务空间ID。 请参见获取Workspace ID。 | llm-xxxxxxxxx |
output.user_identity | string | 用户标识,阿里云账号ID。 | 12xxxxxxx |
output.modifier | string | 修改人的阿里云账号ID。 | 12xxxxxxx |
output.creator | string | 创建人的阿里云账号ID。 | 12xxxxxxx |
output.group | string | 模型微调任务分组。 | llm |
output.max_output_cnt | integer | 训练期间最多保存的 checkpoint 数量。 等同于超参数save_total_limit参数的值。 | 8 |
请求示例
请将<替换为训练数据集的文件id>完整替换为上传数据集获取的文件ID。
图生视频-基于首帧
Wan2.6模型
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.6-i2v",
"training_file_ids":[
"<替换为训练数据集的文件id>"
],
"training_type":"efficient_sft",
"hyper_parameters":{
"n_epochs":400,
"batch_size":2,
"learning_rate":2e-5,
"split":0.9,
"eval_epochs": 50,
"max_pixels": 36864
}
}'Wan2.5模型
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.5-i2v-preview",
"training_file_ids":[
"<替换为训练数据集的文件id>"
],
"training_type":"efficient_sft",
"hyper_parameters":{
"n_epochs":400,
"batch_size":2,
"learning_rate":2e-5,
"split":0.9,
"eval_epochs": 50,
"max_pixels": 36864
}
}'Wan2.2模型
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-i2v-flash",
"training_file_ids":[
"<替换为训练数据集的文件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
}
}'图生视频-基于首尾帧
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":[
"<替换为训练数据集的文件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
}
}'上传多个训练集和验证集
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.5-i2v-preview",
"training_file_ids":[
"<替换为训练集的文件id_1>",
"<替换为训练集的文件id_2>"
],
"validation_file_ids":[
"<替换为验证集的文件id_1>",
"<替换为验证集的文件id_2>"
],
"training_type":"efficient_sft",
"hyper_parameters":{
"n_epochs":400,
"batch_size":2,
"learning_rate":2e-5,
"split":0.9,
"eval_epochs": 50,
"max_pixels": 36864
}
}'响应示例
重点关注这两个参数:output.job_id(任务ID)、output.finetuned_output(微调后产出的新模型名称)。
{
"request_id": "0eb05b0c-02ba-414a-9d0c-xxxxxxxxx",
"output": {
"job_id": "ft-202511111122-xxxx",
"job_name": "ft-202511111122-xxxx",
"status": "PENDING",
"finetuned_output": "wan2.5-i2v-preview-ft-202511111122-xxxx",
"model": "wan2.5-i2v-preview",
"base_model": "wan2.5-i2v-preview",
"training_file_ids": [
"xxxxxxxxxxxx"
],
"validation_file_ids": [],
"hyper_parameters": {
"n_epochs": 400,
"batch_size": 2,
"learning_rate": 2.0E-5,
"split": 0.9,
"eval_epochs": 50
},
"training_type": "efficient_sft",
"create_time": "2025-11-11 11:22:22",
"workspace_id": "llm-xxxxxxxxx",
"user_identity": "12xxxxxxx",
"modifier": "12xxxxxxx",
"creator": "12xxxxxxx",
"group": "llm",
"max_output_cnt": 20
}
}查询微调任务状态
API描述:通过 job_id 查询微调任务进度。轮询此接口,当任务状态status 变为 SUCCEEDED,表示模型训练成功完成。
本文示例的微调任务训练需要数小时,具体耗时根据基础模型而定,请耐心等待。
请求接口
GET https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/{job_id}入参描述
字段 | 传参方式 | 类型 | 必选 | 描述 | 示例值 |
job_id | Path parameter | string | 是 | 微调任务ID。 | ft-202511111122-xxxx |
出参描述
字段 | 类型 | 描述 | 示例值 |
request_id | string | 请求的唯一标识符。 | 0eb05b0c-02ba-414a-9d0c-xxxxxxxxx |
output | object | 任务详情。 | - |
output.job_id | string | 模型微调任务唯一标识,用于后续查询任务状态。 | ft-202511111122-xxxx |
output.job_name | string | 模型微调任务名称。 | ft-202511111122-xxxx |
output.status | string | 微调训练任务的状态。
| PENDING |
output.finetuned_output | string | 微调后产出的新模型名称。 | wan2.5-i2v-preview-ft-202511111122-xxxx |
output.model | string | 使用的基准模型。 | wan2.5-i2v-preview |
output.base_model | string | 使用的基准模型。 | wan2.5-i2v-preview |
output.training_file_ids | array | 使用的训练集文件ID列表。 | ["file-ft-b2416bacc4d742xxxx"] |
output.validation_file_ids | array | 使用的验证集文件ID列表。若未上传验证集,为空列表。 | [] |
output.hyper_parameters | object | 实际使用的超参数。 | {...} |
output.training_type | string | 模型微调的训练方式。固定为efficient_sft。 | efficient_sft |
output.create_time | string | 微调任务创建时间。 | 2025-11-11 11:22:22 |
output.end_time | string | 微调任务完成时间。 | 2025-11-11 16:49:01 |
output.workspace_id | string | 阿里云百炼API Key所属的业务空间ID。 请参见获取Workspace ID。 | llm-xxxxxxxxx |
output.user_identity | string | 用户标识,阿里云账号ID。 | 12xxxxxxx |
output.modifier | string | 修改人的阿里云账号ID。 | 12xxxxxxx |
output.creator | string | 创建人的阿里云账号ID。 | 12xxxxxxx |
output.group | string | 模型微调任务分组。 | llm |
output.max_output_cnt | integer | 最多保存的 checkpoint 数量。 等同于超参数 | 8 |
output.output_cnt | integer | 实际保存的 checkpoint 数量。 该值小于或等于 | 8 |
output.usage | integer | 训练消耗的总Token数量,用于模型训练计费。 | 432000 |
请求示例
请将 URL 中的 <替换为微调任务job_id> 完整替换为创建微调任务输出参数job_id的值。
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/<替换为微调任务job_id>' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json'响应示例
关注两个参数:output.status(状态为SUCCEEDED,表示训练完成)、output.usage(训练消耗的总Token数量)。
{
"request_id": "9bbb953c-bef2-4b59-9fc5-xxxxxxxxx",
"output": {
"job_id": "ft-202511111122-xxxx",
"job_name": "ft-202511111122-xxxx",
"status": "SUCCEEDED",
"finetuned_output": "wan2.5-i2v-preview-ft-202511111122-xxxx",
"model": "wan2.5-i2v-preview",
"base_model": "wan2.5-i2v-preview",
"training_file_ids": [
"xxxxxxxxxxxx"
],
"validation_file_ids": [],
"hyper_parameters": {
"n_epochs": 400,
"batch_size": 2,
"learning_rate": 2.0E-5,
"split": 0.9,
"eval_epochs": 50
},
"training_type": "efficient_sft",
"create_time": "2025-11-11 11:22:22",
"workspace_id": "llm-xxxxxxxxx",
"user_identity": "xxxxxxxxx",
"modifier": "xxxxxxxxx",
"creator": "xxxxxxxxx",
"end_time": "2025-11-11 16:49:01",
"group": "llm",
"usage": 432000,
"max_output_cnt": 8,
"output_cnt": 8
}
}部署模型
API描述:将训练好的模型发布为在线 API 服务。请先查询微调任务状态,确保模型训练任务的状态status 为 SUCCEEDED。
请求接口
POST https://dashscope-intl.aliyuncs.com/api/v1/deployments
Content-Type: application/json入参描述
字段 | 传参方式 | 类型 | 必选 | 描述 | 示例值 |
model_name | Body | string | 是 | 待部署的模型名称。 | wan2.5-i2v-preview-ft-202511111122-xxxx |
capacity | Body | integer | 是 | 部署的模型实例数量。推荐设置为1。 | 1 |
plan | Body | string | 是 | 部署方式。LoRA高效微调固定为 | lora |
aigc_config | Body | object | 是 | 提示词配置。 | - |
aigc_config.use_input_prompt | Body | boolean | 是 | 用于控制 API 调用时的提示词生成逻辑。
| false |
aigc_config.prompt | Body | string | 是 | 预设的Prompt模板。 仅在 在模型调用时,系统会分析输入图像,将画面内容填入该模板,自动生成带特效指令的完整描述。 注意:此参数会自动覆盖模型调用接口中传入的 prompt 参数。 | 根据图像内容提供视频描述... 请参见请求示例 |
aigc_config.lora_prompt_default | Body | string | 是 | 备用Prompt模板。 仅在 当使用 | 然后开始展示s86b5p金钱雨特效... 请参见请求示例 |
出参描述
字段 | 类型 | 描述 | 示例值 |
request_id | string | 请求的唯一标识符。 | 0eb05b0c-02ba-414a-9d0c-xxxxxxxxx |
output | object | 任务详情。 | - |
output.deployed_model | string | 部署模型的唯一标识。 用于查询模型部署状态和调用模型。 | wan2.5-i2v-preview-ft-202511111122-xxxx |
output.model_name | string | 模型标识名。 | wan2.5-i2v-preview-ft-202511111122-xxxx |
output.status | string | 部署状态:
| PENDING |
output.base_model | string | 使用的基准模型。 | wan2.5-i2v-preview |
output.gmt_create | string | 部署任务创建时间。 | 2025-11-11T17:46:53.294 |
output.gmt_modified | string | 部署任务更新时间。 | 2025-11-11T17:46:53.294 |
output.workspace_id | string | 阿里云百炼API Key所属的业务空间ID。 请参见获取Workspace ID。 | llm-xxxxxxxxx |
output.charge_type | string | 付费模式。post_paid表示后付费。 | post_paid |
output.creator | string | 创建人的阿里云账号ID。 | 12xxxxxxx |
output.modifier | string | 修改人的阿里云账号ID。 | 12xxxxxxx |
output.plan | string | 部署方式。 | lora |
请求示例
请将 <替换为模型名称model_name> 完整替换为创建微调任务输出参数finetuned_output的值。
图生视频-基于首帧
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"
}'图生视频-基于首尾帧
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"
}'响应示例
关注两个参数:output.deployed_model(部署模型的唯一标识)、output.status(状态为PENDING,表示部署中)。
{
"request_id": "96020b2e-9072-4c8a-9981-xxxxxxxxx",
"output": {
"deployed_model": "wan2.5-i2v-preview-ft-202511111122-xxxx",
"gmt_create": "2025-11-11T17:46:53.294",
"gmt_modified": "2025-11-11T17:46:53.294",
"status": "PENDING",
"model_name": "wan2.5-i2v-preview-ft-202511111122-xxxx",
"base_model": "wan2.5-i2v-preview",
"workspace_id": "llm-xxxxxxxxx",
"charge_type": "post_paid",
"creator": "12xxxxxxx",
"modifier": "12xxxxxxx",
"plan": "lora"
}
}查询模型部署状态
API描述:轮询此接口,当任务状态status 变为 RUNNING,表示模型已部署成功。
本文示例的微调模型,部署过程预计需要 5~10分钟。
请求接口
GET https://dashscope-intl.aliyuncs.com/api/v1/deployments/{deployed_model}入参描述
字段 | 传参方式 | 类型 | 必选 | 描述 | 示例值 |
deployed_model | Path parameter | string | 是 | 部署模型的唯一标识。 填写部署模型输出参数 | wan2.5-i2v-preview-ft-202511111122-xxxx |
出参描述
字段 | 类型 | 描述 | 示例值 |
request_id | string | 请求的唯一标识符。 | 0eb05b0c-02ba-414a-9d0c-xxxxxxxxx |
output | object | 任务详情。 | - |
output.deployed_model | string | 部署模型的唯一标识。用于后续调用模型。 | wan2.5-i2v-preview-ft-202511111122-xxxx |
output.model_name | string | 模型标识名。 | wan2.5-i2v-preview-ft-202511111122-xxxx |
output.status | string | 部署状态:
| RUNNING |
output.base_model | string | 使用的基准模型。 | wan2.5-i2v-preview |
output.gmt_create | string | 部署任务创建时间。 | 2025-11-11T17:46:53.294 |
output.gmt_modified | string | 部署任务更新时间。 | 2025-11-11T18:02:2 |
output.workspace_id | string | 阿里云百炼API Key所属的业务空间ID。 请参见获取Workspace ID。 | llm-xxxxxxxxx |
output.charge_type | string | 付费模式。post_paid表示后付费。 | post_paid |
output.creator | string | 创建人的阿里云账号ID。 | 12xxxxxxx |
output.modifier | string | 修改人的阿里云账号ID。 | 12xxxxxxx |
output.plan | string | 部署方式。 | lora |
请求示例
请将 <替换为deployed_model> 完整替换为部署模型输出参数 output.deployed_model 的值。
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/deployments/<替换为deployed_model>' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' 响应示例
关注status字段。当状态变为 RUNNING 时,表示模型已部署成功,可以开始调用。
{
"request_id": "66d15f35-0772-409f-bc70-xxxxxxxxx",
"output": {
"deployed_model": "wan2.5-i2v-preview-ft-202511111122-xxxx",
"gmt_create": "2025-11-11T17:46:53",
"gmt_modified": "2025-11-11T18:02:24",
"status": "RUNNING",
"model_name": "wan2.5-i2v-preview-ft-202511111122-xxxx",
"base_model": "wan2.5-i2v-preview",
"workspace_id": "llm-xxxxxxxxx",
"charge_type": "post_paid",
"creator": "12xxxxxxx",
"modifier": "12xxxxxxxx",
"plan": "lora"
}
}调用模型生成视频
调用微调后的LoRA模型,请参见调用模型生成视频。
Checkpoint 管理
1. 查询Checkpoint列表
API描述:获取通过验证集成功生成预览视频的 Checkpoint列表,验证失败的不会列出。
使用限制:该接口需在模型微调训练完成后调用,否则将返回空列表。
请求接口
GET https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/{job_id}/validation-results入参描述
字段 | 传参方式 | 类型 | 必选 | 描述 | 示例值 |
job_id | Path parameter | string | 是 | 微调任务ID。 | ft-202511111122-xxxx |
出参描述
字段 | 类型 | 描述 | 示例值 |
request_id | string | 请求的唯一标识符。 | 0eb05b0c-02ba-414a-9d0c-xxxxxxxxx |
output | array[string] | Checkpoint列表。 | - |
output[].checkpoint | string | Checkpoint名称。 | checkpoint-160 |
请求示例
请将 URL 中的 <替换为微调任务job_id> 完整替换为创建微调任务输出参数job_id的值。
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/<替换为微调任务job_id>/validation-results' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' 响应示例
{
"request_id": "da1310f5-5a21-4e29-99d4-xxxxxx",
"output": [
{
"checkpoint": "checkpoint-160"
},
{
"checkpoint": "checkpoint-20"
},
{
"checkpoint": "checkpoint-40"
},
{
"checkpoint": "checkpoint-60"
}
]
}2. 查询Checkpoint验证结果
API描述: 根据checkpoint(例如“checkpoint-160”),查看其生成的视频效果。
请求接口
GET https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/{job_id}/validation-details/{checkpoint}?page_no=1&page_size=10入参描述
字段 | 传参方式 | 类型 | 必选 | 描述 | 示例值 |
job_id | Path parameter | string | 是 | 微调任务ID。 | ft-202511111122-xxxx |
checkpoint | Path parameter | string | 是 | Checkpoint名称。 | checkpoint-160 |
page_no | Query parameter | integer | 否 | 页码。默认为1。 | 1 |
page_size | Query parameter | integer | 否 | 每页数量。默认为10。 | 10 |
出参描述
字段 | 类型 | 描述 | 示例值 |
request_id | string | 请求的唯一标识符。 | 375b3ad0-d3fa-451f-b629-xxxxxxx |
output | object | 输出结果。 | - |
output.page_no | integer | 页码。 | 1 |
output.page_size | integer | 每页数量。 | 10 |
output.total | integer | 验证集列表总数量。 | 1 |
output.list | array[object] | 验证集列表。 | - |
output.list[].video_path | string | 通过Checkpoint生成的视频。 video_path有效期为24小时,请及时下载视频。 | https://finetune-swap-wulanchabu.oss-cn-wulanchabu.aliyuncs.com/xxx.mp4?Expires=xxxx |
output.list[].prompt | string | 验证数据的prompt。从数据集的标注文件data.jsonl获得。 | 视频开头展示了一位年轻男性坐在咖啡馆的场景... |
output.list[].first_frame_path | string | 验证的图像地址。系统会读取数据集中的图像,并生成一个公网URL地址。 | https://finetune-swap-wulanchabu.oss-cn-wulanchabu.aliyuncs.com/xxx.jpeg |
请求示例
<替换为微调任务job_id>: 完整替换为创建微调任务输出参数job_id的值。<替换为选择的checkpoint>:完整替换为选定的Checkpoint名称,例如“checkpoint-160”。
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/<替换为微调任务job_id>/validation-details/<替换为选择的checkpoint>?page_no=1&page_size=10' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"响应示例
video_path有效期为24小时,请及时下载视频。
{
"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": "视频开头展示了一位年轻男性坐在咖啡馆的场景。他穿着一件米色的Polo衫,神情专注且略显沉思,手指轻轻托着下巴。他的面前摆放着一杯热气腾腾的咖啡,背景是木质条纹的墙壁和一个装饰牌。然后开始展示s86b5p金钱雨特效,无数巨大尺寸的美元钞票(米黄底/深绿图案)如暴雨般倾泻而下,密集地砸向并环绕他。钞票持续落下,他双臂舒展上扬,脖颈微仰,表情惊喜,完全沉浸在这场狂野的金钱雨中。",
"first_frame_path": "https://finetune-swap-wulanchabu.oss-cn-wulanchabu.aliyuncs.com/xxx.jpeg"
}
]
}
}3. 导出Checkpoint
API描述:将Checkpoint导出为可部署模型。
请求接口
GET https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/{job_id}/export/{checkpoint}?model_name={model_name}入参描述
字段 | 传参方式 | 类型 | 必选 | 描述 | 示例值 |
job_id | Path parameter | string | 是 | 微调任务ID。 | ft-202511111122-xxxx |
checkpoint | Path parameter | string | 是 | Checkpoint名称。 | checkpoint-160 |
model_name | Query parameter | string | 是 | 用于在控制台中展示的导出模型名称。 该名称需全局唯一,建议使用中英文、数字、下划线(_)和短横线(-)字符。 请注意:此参数仅用于控制台显示,实际导出的模型名称以查询导出的模型详情输出参数 | wan2.5-i2v-preview-ft-202511111122-xxxx |
出参描述
字段 | 类型 | 描述 | 示例值 |
request_id | string | 请求的唯一标识符。 | 0eb05b0c-02ba-414a-9d0c-xxxxxxxxx |
output | boolean | 导出请求是否提交成功。
| true |
请求示例
<替换为微调任务job_id>:完整替换为创建微调任务输出参数job_id的值。<替换为待导出的checkpoint>:完整替换为checkpoint的值,例如“checkpoint-160”。<替换为控制台展示的导出模型名称>:完整替换为自定义的模型名称,仅用于控制台展示。
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/<替换为微调任务job_id>/export/<替换为待导出的checkpoint>?model_name=<替换为控制台展示的导出模型名称>' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"响应示例
{
"request_id": "0817d1ed-b6b6-4383-9650-xxxxx",
"output": true
}4. 查询导出模型详情
API描述:查询所有Checkpoint的状态,确认导出已完成,并获取它专属的、用于部署的新模型名称(model_name)。
请求接口
GET https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/{job_id}/checkpoints入参描述
字段 | 传参方式 | 类型 | 必选 | 描述 | 示例值 |
job_id | Path parameter | string | 是 | 微调任务ID。 | ft-202511111122-xxxx |
出参描述
字段 | 类型 | 描述 | 示例值 |
request_id | string | 请求的唯一标识符。 | 0eb05b0c-02ba-414a-9d0c-xxxxxxxxx |
output | array[object] | Checkpoint列表详情。 | - |
output[].create_time | string | 创建时间。 | 2025-11-11T13:27:29 |
output[].job_id | string | 微调任务ID。 | ft-202511111122-xxxx |
output[].checkpoint | string | Checkpoint名称。 | checkpoint-160 |
output[].full_name | string | Checkpoint完整名称标识。 | ft-202511111122-496e-checkpoint-160 |
output[].model_name | string | 导出后的模型名称。用于模型部署和调用。 当 | wan2.5-i2v-preview-ft-202511111122-xxxx-c160 |
output[].model_display_name | string | 模型展示名称。 | wan2.5-i2v-preview-ft-202511111122-xxxx |
output[].status | string | 模型导出状态:
| SUCCEEDED |
请求示例
请将 <替换为微调任务job_id> 完整替换为创建微调任务输出参数job_id的值。
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/<替换为微调任务job_id>/checkpoints' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"响应示例
请在返回列表中定位目标 Checkpoint(如 checkpoint-160)。当其状态变为 SUCCEEDED 时,表示导出成功,请务必获取并保存 model_name,它是后续模型部署与调用的唯一标识。
{
"request_id": "b0e33c6e-404b-4524-87ac-xxxxxx",
"output": [
......,
{
"create_time": "2025-11-11T13:42:31",
"full_name": "ft-202511111122-496e-checkpoint-180",
"job_id": "ft-202511111122-496e",
"checkpoint": "checkpoint-180",
"status": "PENDING" // 未导出的checkpoint,没有model_name字段
},
{
"create_time": "2025-11-11T13:27:29",
"full_name": "ft-202511111122-496e-checkpoint-160",
"job_id": "ft-202511111122-496e",
"checkpoint": "checkpoint-160",
"model_name": "wan2.5-i2v-preview-ft-202511111122-xxxx-c160", // 重要字段,用于模型部署和调用
"model_display_name": "wan2.5-i2v-preview-ft-202511111122-xxxx",
"status": "SUCCEEDED" // 成功导出的checkpoint
},
......
]
}5. 部署和调用模型
在成功导出 Checkpoint 并获取 model_name 后,请按照以下步骤执行后续操作: