圖片轉影片 API
提供圖片並描述動態效果,模型即可將其轉化為影片片段。許多模型也支援首尾畫格設定,或提供多張參考圖來引導影片生成。
模型
下方所有模型皆支援在 POST /v1/videos/generations 中使用帶有 image_url 的 "image_to_video" 模式。價格為預設路由下所列解析度的每秒影片費用;Seedance 價格為根據其 token 計費方式推算的預估值。
| 模型與 API 模型 ID | 選項 | official-cheap 價格(預設) |
|---|---|---|
Seedance 2.5bytedance/seedance-2.5 | 尺寸:480p, 720p, 1080p4–30 秒片段 | 720p 每秒 $0.213official:$0.231 |
Seedance 2.0bytedance/seedance-2.0 | 尺寸:480p, 720p, 1080p, 4K4–15 秒片段 | 720p 每秒 $0.139official:$0.151 |
Seedance 2.0 Fastbytedance/seedance-2.0-fast | 尺寸:480p, 720p4–15 秒片段 | 720p 每秒 $0.111official:$0.121 |
Seedance 2.0 Minibytedance/seedance-2.0-mini | 尺寸:480p, 720p4–15 秒片段 | 720p 每秒 $0.07official:$0.076 |
Wan 3.0alibaba/wan-3.0 | 尺寸:480p, 720p, 1080p2–15 秒片段 | 720p 每秒 $0.083official:$0.092 |
Wan 3.0 Primealibaba/wan-3.0-prime | 尺寸:480p, 720p, 1080p2–15 秒片段 | 720p 每秒 $0.125official:$0.138 |
HappyHorse 1.1alibaba/happyhorse-1.1 | 尺寸:480p, 720p, 1080p3–15 秒片段 | 720p 每秒 $0.125official:$0.138 |
HappyHorse 1.0alibaba/happyhorse-1.0 | 尺寸:720p, 1080p3–15 秒片段 | 720p 每秒 $0.125official:$0.138 |
Grok Imagine Video 1.5xai/grok-imagine-video-1.5 | 尺寸:480p, 720p, 1080p1–15 秒片段 | 720p 每秒 $0.126official:$0.14 |
Grok Imagine Video 1.5 Litexai/grok-imagine-video-1.5-lite | 尺寸:480p, 720p, 1080p1–15 秒片段 | 720p 每秒 $0.027official:$0.03 |
Kling 4.0kwaivgi/kling-4.0 | 尺寸:720p, 1080p3–30 秒片段 | 720p 每秒 $0.138official:$0.154 |
MiniMax H3minimax/h3 | 尺寸:480p, 768p, 2K5–15 秒片段 | 768p 每秒 $0.072official:$0.08 |
MiniMax H3 Maxminimax/h3-max | 尺寸:480p, 768p5–15 秒片段 | 768p 每秒 $0.072official:$0.08 |
MiniMax H3 Max Turbominimax/h3-max-turbo | 尺寸:480p, 768p5–15 秒片段 | 768p 每秒 $0.036official:$0.04 |
快速入門
- 建立 API 金鑰
在主控台中建立金鑰,並將其儲存為 MLMUX_API_KEY 環境變數。
建立 API 金鑰 - 發送請求
範例會將 Seedance 2.0 (bytedance/seedance-2.0) 發送至 https://api.mlmux.com/v1/videos/generations。您可以將模型 ID 變更為上方表格中的任一模型。
- 讀取結果
回應為一個任務。每隔幾秒輪詢其 poll_url,直到 status 為 succeeded,即可下載影片,或設定 webhook 接收通知。
影片 API 參考文件
curl https://api.mlmux.com/v1/videos/generations \
-H "Authorization: Bearer $MLMUX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "bytedance/seedance-2.0",
"route_mode": "official-cheap",
"prompt": "The camera slowly pushes in while steam rises from the cup",
"mode": "image_to_video",
"image_url": "https://your-cdn.example/start-frame.jpg",
"ratio": "16:9",
"resolution": "720p",
"duration": 5,
"generate_audio": true
}'
# The response is a task. Poll it until "status" is "succeeded", then read "video".
curl https://api.mlmux.com/v1/videos/generations/TASK_ID \
-H "Authorization: Bearer $MLMUX_API_KEY"常見問題
圖片轉影片該選擇哪款模型?
Seedance 2.0 是個不錯的預設選擇。Seedance 2.5 與 Wan 3.0 Prime 能提供最豐富的動態表現,Kling 4.0 可製作長達 30 秒的片段,而 Grok Imagine Video 1.5 Lite 是成本最低的選擇。
圖片轉影片 API 的費用是多少?
在預設路由下,每秒影片約從 $0.027 起(Grok Imagine Video 1.5 Lite)。Seedance 將起始圖片視為參考圖片而非參考影片,因此適用較低的費率;其他模型無論是否有起始圖片,每秒收費均相同。
如何傳送起始圖片?
在 image_url 中傳入公開的 URL,或透過 POST /v1/uploads 上傳檔案並使用回傳的 URL。此請求會回傳一個任務;您可以輪詢該任務,或在影片準備就緒時接收 webhook 通知。
失敗的請求會被計費嗎?是否有上限限制?
失敗的請求不會計費,預扣的點數將退回您的餘額。每個帳號最多可同時執行 60 個任務;如需提高上限,請寄信至 support@mlmux.com。