跳到內容
開放式卡斯塔利控制台

影片

wan3.0-video API

透過 Modelflare 非同步視訊路由使用準確的 wan3.0-video 模型 ID。

使用準確的型號 ID wan3.0-video。模型欄位必須與此頁面完全相符。

範例輸出wan3.0-videoPOST /v1/videos5.0s

參數: duration=5resolution=1080Pratio=16:9

提示詞: Macro slow-motion shot of steamed milk poured into a ceramic cup of espresso, forming a rosetta latte art pattern. Warm morning light from a window, wooden counter, soft steam rising, shallow depth of field, commercial food photography, no text.

產生此樣本的請求
{
"model": "wan3.0-video",
"prompt": "Macro slow-motion shot of steamed milk poured into a ceramic cup of espresso, forming a rosetta latte art pattern. Warm morning light from a window, wooden counter, soft steam rising, shallow depth of field, commercial food photography, no text.",
"seconds": "5",
"duration": 5,
"resolution": "1080P",
"ratio": "16:9",
"aspect_ratio": "16:9"
}

將 Modelflare API 金鑰與 https://modelflare.dev/v1 結合使用。網關入口點是POST /v1/videos。

HTTP
Authorization: Bearer YOUR_MODELFLARE_API_KEY
終端機視窗bash
curl https://modelflare.dev/v1/videos \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"input": {"prompt": "A white cat runs through a neon-lit street in the rain, cinematic tracking shot"},
"parameters": {"resolution": "1080P", "duration": 5, "audio": true}
}'

儲存任務ID。輪詢 GET /v1/videos/{task_id} 並使用 GET /v1/videos/{task_id}/content 下載。結果 URL 可能會過期,因此請立即傳輸檔案。

終端機視窗bash
curl https://modelflare.dev/v1/videos/TASK_ID \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY"

萬常用input和parameters;幀引導模式和參考媒體模式不得混合。

Wan3.0 使用 input.prompt 或 input.media,並在 parameters 中進行輸出控制。媒體可以表示框架、參考、音訊、文件或網頁。

場 必填 註釋
model 是 wan3.0-video
input.prompt 有條件 提供此或 input.media
input.media[] 有條件 first_frame、last_frame、reference_*、file 或 link
parameters.resolution 否 480P / 720P / 1080P(預設 1080P)
parameters.ratio 否 16:9 / 9:16 / 1:1 / 4:3 / 3:4 / adaptive
parameters.duration 否 2–30 秒,或 -1 自動持續時間
parameters.audio 否 是否產生同步音頻
parameters.prompt_extend 否 當此專用模型合約需要時設定為 false
parameters.seed 否 可選的隨機種子
parameters.watermark 否 是否添加浮水印

Wan3.0 支援文字、第一幀/最後一幀、最多 10 個參考影像、5 個參考影片、5 個參考音訊剪輯以及一個檔案或網頁輸入。輸出為 480P、720P 或 1080P,持續 2-30 秒或 -1 自動定時。第一格/最後一格、參考媒體、檔案和網頁是input.media[].type選擇的互斥工作流程。

Wan3.0 使用一個 input/parameters 信封來儲存文字、框架指南、參考媒體、文件和網頁;這些工作流程是互斥的。

第一幀與最後一幀

終端機視窗bash
curl https://modelflare.dev/v1/videos \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"input": {"prompt": "镜头从第一帧平滑推进到最后一帧", "media": [
{"type": "first_frame", "url": "https://example.com/first.png"},
{"type": "last_frame", "url": "https://example.com/last.png"}
]},
"parameters": {"resolution": "1080P", "duration": 8, "ratio": "adaptive", "audio": true}
}'

參考媒體

終端機視窗bash
curl https://modelflare.dev/v1/videos \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"input": {"prompt": "保持角色、动作和音色一致", "media": [
{"type": "reference_image", "url": "https://example.com/character.png"},
{"type": "reference_video", "url": "https://example.com/motion.mp4"},
{"type": "reference_audio", "url": "https://example.com/voice.mp3"}
]},
"parameters": {"resolution": "720P", "duration": -1, "ratio": "adaptive"}
}'

無效模型參數傳回帶有請求 ID 的 4xx。非同步任務建立成功後也可能進入失敗;使用輪詢回應中的 error_code 和 error_message 作為最終任務原因。不要使用不同的 JSON 形狀重試相同的請求。

此頁面涵蓋 Modelflare 模型產生和編輯呼叫。搜尋或地圖豐富、語音管理和元素庫管理是此公共模型呼叫表面之外的資源 API,並且不是必需的請求欄位。

此模型採用按秒視訊計費。請參閱 型號定價頁面 ,以了解當前客戶價格、參考標價和完整規格。

型號 ID 差異
wan3.0-video 本頁記錄的模型。
媒體合約 · v1

合約 ID: media.wan3-0-video.v1適配器: video.wan.v1@v1指紋: c248c1c28bbfbbcfd6d7ac3f2639f3183596b9126134fbeaed006d0e54e230f3

官方來源: Alibaba Cloud Model Studio

合約參數

意圖字段控制項選項
ratioselect16:9 / 9:16 / 1:1 / 4:3 / 3:4 / adaptive
resolutionselect480p / 720p / 1080p
durationselect-1 / 2 / 3 / 4 / 5 / 6 / 7 / 8 / 9 / 10 / 11 / 12 / 13 / 14 / 15 / 16 / 17 / 18 / 19 / 20 / 21 / 22 / 23 / 24 / 25 / 26 / 27 / 28 / 29 / 30
audioswitch—

支援的功能

  • allowed_values · ratio · 16:9, 9:16, 1:1, 4:3, 3:4, adaptive
  • allowed_values · resolution · 480p, 720p, 1080p
  • allowed_values · duration · -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
  • max_assets · reference_asset_ids · 21

結構化請求範例

text

意圖

{
  "audio": false,
  "duration": -1,
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "ratio": "16:9",
  "resolution": "480p"
}

提供者請求

{
  "audio": false,
  "duration": -1,
  "model": "wan3.0-video",
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "ratio": "16:9",
  "resolution": "480p",
  "seconds": "-1"
}

reference

意圖

{
  "audio": false,
  "duration": -1,
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "ratio": "16:9",
  "resolution": "480p"
}

提供者請求

{
  "input": {
    "media": [
      {
        "type": "reference_image",
        "url": "https://example.com/reference.png"
      }
    ],
    "prompt": "A red paper kite over a quiet harbour at dusk."
  },
  "model": "wan3.0-video",
  "parameters": {
    "duration": -1,
    "resolution": "480P"
  }
}