在 OpenClaw 中使用 Wan。
Wan 是 Alibaba 的開源影片與圖片生成模型,採用 Apache 2.0 授權,在 Artificial Analysis 文生影片排行榜上排名第一。涵蓋 20+ 種變體,從 Wan 2.2 到 2.7 — 文生影片、圖生影片、帶唇形同步的語音生影片、透過 R2V 進行影片編輯,以及最高 4K 的圖片生成。OpenClaw agent 透過與聊天相同的 RunAPI key 呼叫任何 Wan 端點。
Use RunAPI to generate a video with Alibaba Wan 2.7.
Requirements:
- Call the RunAPI text_to_video endpoint at https://runapi.ai/api/v1/task/text_to_video.
- Set model to "wan-2.7-text-to-video".
- Read the API key from the RUNAPI_API_KEY environment variable.
- Set output_resolution to "1080p" for full HD output.
- Include a detailed prompt describing the scene, camera motion, and lighting.
- The response is async. Poll the returned task_id until status is "completed".
- When done, read the video URL from the response output.
curl -X POST https://runapi.ai/api/v1/task/text_to_video \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan-2.7-text-to-video",
"prompt": "A drone shot rising over terraced rice paddies at golden hour, mist rolling through the valleys, slow upward camera tilt",
"output_resolution": "1080p"
}'
{
"task_id": "tsk_abc123",
"status": "pending",
"model": "wan-2.7-text-to-video"
}
三步驟在 OpenClaw 中使用 Wan
設定 RunAPI
在環境中設定 RUNAPI_API_KEY。如果你已在 OpenClaw 中為聊天或圖片生成設定了 RunAPI,同一把 key 適用於所有 Wan 端點 — 無需額外 provider 設定。
export RUNAPI_API_KEY=runapi_xxx
呼叫 Wan 端點
向 text_to_video 發送 POST 請求,將 model 設為 wan-2.7-text-to-video、output_resolution 設為 720p 或 1080p。若要圖生影片,使用 wan-2.7-image-to-video 並傳入 first_frame_image_url。若要語音驅動影片,使用 wan-2.2-a14b-speech-to-video-turbo 並傳入 source_audio_url 與 source_image_url。
POST /api/v1/task/text_to_video
輪詢結果
端點會立即回傳 task_id。輪詢任務狀態端點,直到狀態為 completed,再從回應中讀取輸出的影片或圖片 URL。RunAPI SDK 與 CLI 會自動處理輪詢。
GET /api/v1/task/text_to_video/tsk_abc123
Wan text_to_video API 參數
| 參數 | 類型 | 說明 |
|---|---|---|
model |
string |
必填。wan-2.7-text-to-video、wan-2.6-text-to-video、wan-2.5-text-to-video、wan-2.2-a14b-text-to-video-turbo 或 wan-2.7-r2v。 |
prompt |
string |
必填。期望影片場景的文字描述,包含鏡頭運動、燈光與主體細節。 |
output_resolution |
string |
選填。Wan 2.5+ 可選 720p 或 1080p。Wan 2.2 另外接受 480p 與 580p。預設為 720p。 |
aspect_ratio |
string |
選填。僅適用於 wan-2.7-r2v。可選值:16:9、9:16、1:1、4:3、3:4。 |
duration_seconds |
integer |
選填。僅適用於 wan-2.7-r2v。影片長度(秒),2 至 10。 |
seed |
integer |
選填。用於確定性輸出的可重現種子值。 |
callback_url |
string |
選填。任務完成時接收 POST 通知的 Webhook URL。 |
OpenClaw 上的 Wan 是什麼?
Wan 是阿里巴巴推出的開源(Apache 2.0)影片模型,在 Artificial Analysis 文生影片排行榜上位列榜首。它提供首幀和末幀控制用於端點錨定生成、帶角色一致性的多鏡頭影片,以及包含口型同步語音轉影片在內的原生音頻支持。OpenClaw agent 通過 RunAPI 用單一 API key 訪問全部 20+ 個 Wan 變體。
Wan 使用場景
分鏡轉影片工作流
使用首幀和末幀錨定,將分鏡板畫面轉化為影片序列。每個片段在你的關鍵幀上開始和結束,在多鏡頭項目中保持視覺連續性。
虛擬主播與品牌吉祥物
通過 Wan 的語音轉影片端點,根據人臉圖像和音頻文件生成説話頭像影片。模型處理口型同步和頭部運動,用於一致的品牌代言人內容。
帶角色一致性的多鏡頭序列
構建相同角色跨多個片段出現的對話密集或敍事內容。Wan 的時序一致性在鏡頭間保持面部和服裝的穩定性。
Wan + OpenClaw 常見問題
全部都可以。text_to_video、image_to_video、speech_to_video、text_to_image(Wan 2.7 Image)、edit_video 與 animate。每個端點使用不同的 model slug — 例如 wan-2.7-text-to-video 用於影片生成,wan-2.7-image 用於最高 4K 的圖片生成。
Wan 2.5 引入了 1080p 輸出。Wan 2.6 新增了影片編輯(R2V)與 flash 變體以加速生成。Wan 2.7 新增圖片生成(wan-2.7-image、wan-2.7-image-pro 最高 4K)、影片編輯(wan-2.7-edit-video),以及在 Artificial Analysis 排行榜上領先的改進文生影片品質。
使用 wan-2.2-a14b-speech-to-video-turbo 並傳入 source_audio_url(音訊檔案)與 source_image_url(要驅動的人臉)。Wan 會生成唇形同步影片,讓人臉說出音訊內容。輸出解析度支援 480p、580p 或 720p。
可以。Wan 2.7 新增了 text_to_image 端點。使用 wan-2.7-image 進行標準生成,或使用 wan-2.7-image-pro 取得更高品質。兩者都支援 1:1 至 21:9 的寬高比,以及 1k、2k 或 4k 的輸出解析度。
是的。Wan 由 Alibaba 以 Apache 2.0 授權發布,模型權重公開可用。透過 RunAPI,你可以跳過 GPU 設定 — 一次 API 呼叫即可生成影片或圖片。如果你因隱私需求需要自建管線,相同的權重可以在你自己的基礎設施上運行。
立即在 OpenClaw 中試用 Wan。
取得免費 RunAPI key,將 prompt 貼入 OpenClaw,即可使用排名第一的開源模型生成影片 — 文生影片、圖生影片或語音生影片。