Wan-2.2 Text-to-Video A14B with LoRAs
整合
模型 id
wan/v2.2-a14b/text-to-video/lora
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://vit.doitong.com/api/v1/run/wan/v2.2-a14b/text-to-video/lora?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://vit.doitong.com/api/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://vit.doitong.com/api/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/wan/v2.2-a14b/text-to-video/lora?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://vit.doitong.com/api/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/wan/v2.2-a14b/text-to-video/lora", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
# 1. Connect once (Claude Code; Cursor, VS Code, Claude Desktop: https://doitong.com/zh-TW/developers/docs/mcp)
claude mcp add --transport http doitong-models https://vit.doitong.com/api/v1/mcp \
--header "Authorization: Bearer $DOITONG_API_KEY"
# 2. Your agent calls the "run" tool with:
{
"model_id": "wan/v2.2-a14b/text-to-video/lora",
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}
}
透過 Doitong API 呼叫 Wan-2.2 Text-to-Video A14B with LoRAs 模型(wan/v2.2-a14b/text-to-video/lora)。代理程式文件:https://doitong.com/zh-TW/developers/models/wan/v2.2-a14b/text-to-video/lora.md
POST https://vit.doitong.com/api/v1/run/wan/v2.2-a14b/text-to-video/lora?wait=20
Authorization: Bearer $DOITONG_API_KEY
Content-Type: application/json
{
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}
如果回應狀態為 "queued" 或 "running",請輪詢 GET https://vit.doitong.com/api/v1/requests/REQUEST_ID?wait=20,直到狀態變為 "succeeded";檔案位於 outputs[].url。使用相同主體傳送 POST https://vit.doitong.com/api/v1/quote/wan/v2.2-a14b/text-to-video/lora,可在執行前取得確切價格。
此請求: ≈$0.507 507 API 點數 在此頁面執行
您的新 API 金鑰。 僅會在此時顯示,且已填入下方的程式碼與 API 金鑰欄位。請妥善保密:切勿將其放入在瀏覽器中執行的程式碼。
建立請求
控制項是根據模型結構描述生成的。變更設定時,程式碼和價格會同步更新。
POST
/run/wan/v2.2-a14b/text-to-video/lora?wait=20
報價 → $0.507
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://vit.doitong.com/api/v1/run/wan/v2.2-a14b/text-to-video/lora?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://vit.doitong.com/api/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://vit.doitong.com/api/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/wan/v2.2-a14b/text-to-video/lora?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://vit.doitong.com/api/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/wan/v2.2-a14b/text-to-video/lora", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run",
"arguments": {
"model_id": "wan/v2.2-a14b/text-to-video/lora",
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
},
"wait_seconds": 20
}
}
}
關於 Wan-2.2 Text-to-Video A14B with LoRAs
從文字 `prompt` 建立影片,同時套用 `loras` 列出的 LoRA 權重。`reverse_video` 會反向播放片段。`num_frames` 為 17 至 161,`resolution` 為 480p、580p 或 720p,長寬比為 16:9、9:16 或 1:1。支援 film 或 rife 插值和兩個引導比例。
參數
名稱類型
預設值允許值
說明
prompt必填
類型string
引導影片生成的文字指示。
negative_prompt選填
類型string
預設值
生成影片時套用的負面提示詞。
num_frames選填
類型integer
預設值81
17 – 161
生成的影格數量,範圍為 17–161,包含邊界值。
frames_per_second選填
類型integer | null
預設值16
4 – 60
生成影片的影格速率,接受 4 到 60 的值;將 `adjust_fps_for_interpolation` 設為 false 可原樣保留此速率。使用插值且 `adjust_fps_for_interpolation` 為 true(其預設值)時,將此速率乘以插值影格數加一,即可取得最終 FPS。例如,16 FPS 搭配 1 個插值影格會變成 32 FPS。
seed選填
類型integer | null
使生成結果可重現的種子。設為 None 會隨機選擇種子。
resolution選填
類型enum
預設值720p
480p580p720p
輸出影片解析度:480p、580p 或 720p。
aspect_ratio選填
類型enum
預設值16:9
16:99:161:1
輸出影片的長寬比,可為 16:9 或 9:16。
num_inference_steps選填
類型integer
預設值27
2 – 40
取樣步數;步數越多,處理時間越長但品質越好。
enable_safety_checker選填
類型boolean
預設值false
處理前的輸入安全篩選,只有獲授權的帳戶可以關閉。未獲授權的請求一律會篩選;其他情況下,true 會啟用篩選。
enable_output_safety_checker選填
類型boolean
預設值false
控制生成影片的安全篩選;設為 true 會在生成後執行檢查。
enable_prompt_expansion選填
類型boolean
預設值false
允許大型語言模型以詳細資訊豐富提示詞。啟用此擴展不會改變提示詞的含義。
acceleration選填
類型enum
預設值regular
noneregular
加速設定,建議選擇 'regular'。提高加速程度會犧牲品質,以縮短生成時間。
guidance_scale選填
類型number
預設值3.5
1 – 10
無分類器引導強度;比例越高,越貼近提示詞,但可能造成品質損失。
guidance_scale_2選填
類型number
預設值4
1 – 10
控制模型在第二階段遵循提示詞程度的引導強度。
shift選填
類型number
預設值5
1 – 10
影片位移設定,允許範圍為 1.0–10.0。
interpolator_model選填
類型enum
預設值film
nonefilmrife
影格插值設定:選擇 None 略過插值,或指定執行插值的模型。
num_interpolated_frames選填
類型integer
預設值1
0 – 4
在每兩個生成影格之間的間隔插入 0–4 個插值影格。
adjust_fps_for_interpolation選填
類型boolean
預設值true
影格速率調整開關:false 會保留提供的 FPS,true 則將其乘以插值影格數加一。因此,啟用調整且插入 1 個影格時,16 FPS 會變成 32 FPS。
video_quality選填
類型enum
預設值high
lowmediumhighmaximum
輸出影片品質設定;設定值越高,會以較大的檔案換取更佳的視覺效果。
video_write_mode選填
類型enum
預設值balanced
fastbalancedsmall
影片寫入模式,balanced 在速度與品質之間取得平衡。選擇 small 可產生最小檔案並以最慢速度寫入;較快的寫入會更早回傳結果,但會建立較大的檔案。
loras選填
類型object[]
預設值[]
推論期間套用的 LoRA 權重。
loras[].path必填
類型string
LoRA 權重的位置,以 URL 或路徑指定。
loras[].weight_name選填
類型string | null
LoRA 權重名稱;僅當 Hugging Face 儲存庫包含超過 1 個 safetensors 檔案時為必填。此名稱僅在 `path` 指定這類儲存庫時使用。
loras[].scale選填
類型number
預設值1
0 – 4
合併至基礎模型前套用至 LoRA 權重的倍數。
loras[].transformer選填
類型enum
預設值high
highlowboth
LoRA 權重的 Transformer 目標。選擇 'high' 將權重套用至高雜訊 Transformer,選擇 'low' 套用至低雜訊 Transformer,或選擇 'both' 載入至兩個 Transformer。
reverse_video選填
類型boolean
預設值false
影片反轉開關;true 會反轉播放方向。
必填
輸出
GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
"id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
"object": "request",
"model": "wan/v2.2-a14b/text-to-video/lora",
"status": "succeeded",
"created_at": "2026-10-20T12:00:00Z",
"started_at": "2026-10-20T12:00:02Z",
"completed_at": "2026-10-20T12:00:09Z",
"queue_position": null,
"cost": {
"credits": 507,
"usd": "0.507",
"charged": 507,
"refunded": 0
},
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
},
"output": {
"video": {
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
"content_type": "video/mp4",
"file_name": "0-output.mp4",
"file_size": 1843200
},
"prompt": "A close-up of a young woman smiling gently in the rain, raindrops glistening on her face and eyelashes. The video captures the delicate details of her expression and the water droplets, with soft light reflecting off her skin in the rainy atmosphere.",
"seed": 42
},
"outputs": [
{
"type": "video",
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
"content_type": "video/mp4",
"file_size": 1843200,
"width": 1280,
"height": 720,
"duration": 5,
"stored": true
}
],
"error": null,
"metrics": {
"inference_seconds": 6.8
},
"urls": {
"self": "https://vit.doitong.com/api/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
"cancel": "https://vit.doitong.com/api/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
}
}
您的檔案,由您選擇每個 outputs[].url 都是儲存空間中的副本:可永久保留(按 GB-月計費),或免費保留 7 天;可透過帳戶設定或 ?storage= 設定。
所有模型使用相同結構圖片、影片和音訊皆包含 type、url、content_type、width、height 和 duration。output 是模型自己的結果物件。
輸出欄位
- video
- object {url, content_type, file_name, file_size}生成產生的影片檔案。
- prompt
- string用於生成影片的文字提示詞。
- seed
- integer生成期間套用的種子值。
其他 Wan v22 LoRA 變體
更多模型:文字轉影片
給 AI 代理程式:此頁面的 Markdown 位於 https://doitong.com/zh-TW/developers/models/wan/v2.2-a14b/text-to-video/lora.md. 所有模型與指南: https://doitong.com/developers/llms.txt