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

影片

wan2.7-i2v API

透過 Modelflare 非同步視訊路由使用準確的 wan2.7-i2v 模型 ID。

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

範例輸出wan2.7-i2vPOST /v1/videos5.0s

參數: duration=5resolution=1080pratio=16:9輸入影像

提示詞: One continuous take, no cuts. The ribbon of film keeps unwinding and speeds up until every frame is lit, tightening into a neon helix that lifts off the deck and climbs past the parapet into the dusk sky, the woman in the cobalt coat turning to follow it up. The camera starts low behind her, is pushed back as the helix rises, then cranes up over the parapet and looks along the coil toward the city. One hard magenta key stays raking across the deck. Real weight and inertia, paper and emulsion catching the light, no text.

產生此範例的請求,並取代了輸入媒體 URL
{
"model": "wan2.7-i2v",
"prompt": "One continuous take, no cuts. The ribbon of film keeps unwinding and speeds up until every frame is lit, tightening into a neon helix that lifts off the deck and climbs past the parapet into the dusk sky, the woman in the cobalt coat turning to follow it up. The camera starts low behind her, is pushed back as the helix rises, then cranes up over the parapet and looks along the coil toward the city. One hard magenta key stays raking across the deck. Real weight and inertia, paper and emulsion catching the light, no text.",
"seconds": "5",
"duration": 5,
"resolution": "1080p",
"ratio": "16:9",
"aspect_ratio": "16:9",
"image": "https://example.com/input-image.png"
}

將 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": "wan2.7-i2v",
"input": {"prompt": "The camera moves closer as the lanterns begin to glow in time with the music.", "media": [{"type": "first_frame", "url": "https://example.com/first-frame.png"}]},
"parameters": {"resolution": "1080P", "duration": 5, "prompt_extend": false, "watermark": false}
}'

儲存任務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;幀引導模式和參考媒體模式不得混合。

Wan2.7 I2V 使用 input.prompt 和 input.media。遵循記錄的第一幀/最後一幀、驅動音訊和初始剪輯的組合。

場 必填 註釋
model 是 wan2.7-i2v
input.prompt 是 動作與場景描述
input.media[] 是 first_frame、last_frame、driving_audio 或 first_clip
parameters.resolution 否 720P / 1080P(預設 1080P)
parameters.duration 否 總持續時間;包括用於繼續的輸入剪輯
parameters.prompt_extend 否 當此專用模型合約需要時設定為 false
parameters.watermark 否 是否添加浮水印

I2V 媒體必須遵循受支援的組合,例如 first_frame、first_frame + last_frame、first_frame + driving_audio 或 first_clip 以及記錄的可選結束幀。每種媒體類型最多出現一次;輸出為 720P 或 1080P。

終端機視窗bash
curl https://modelflare.dev/v1/videos \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.7-i2v",
"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, "prompt_extend": false}
}'

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

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

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

型號 ID 差異
wan2.7-i2v 本頁記錄的模型。
媒體合約 · v1

合約 ID: media.wan2-7-i2v.v1適配器: video.wan.i2v.v1@v1指紋: f88d7c8cb3fd7273312b35a66e10fc485ceaa6e2848487aa73b4819fff587413

官方來源: Alibaba Cloud Model Studio

合約參數

意圖字段控制項選項
resolutionselect720p / 1080p
durationselect2 / 3 / 4 / 5 / 6 / 7 / 8 / 9 / 10 / 11 / 12 / 13 / 14 / 15

支援的功能

  • allowed_values · resolution · 720p, 1080p
  • allowed_values · duration · 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
  • required_assets · reference_asset_ids
  • max_assets · reference_asset_ids · 3
  • prompt_optional_with_reference · prompt

結構化請求範例

reference

意圖

{
  "duration": 2,
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "reference_asset_ids": [
    "asset_example"
  ],
  "resolution": "720p"
}

提供者請求

{
  "input": {
    "media": [
      {
        "type": "first_frame",
        "url": "https://example.com/reference.png"
      }
    ],
    "prompt": "A red paper kite over a quiet harbour at dusk."
  },
  "model": "wan2.7-i2v",
  "parameters": {
    "duration": 2,
    "resolution": "720P"
  }
}