本文檔提供萬相 圖生視頻模型 微調的完整 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 後,請按照以下步驟執行後續操作: