影片
wan2.7-r2v API
透過 Modelflare 非同步視訊路由使用準確的 wan2.7-r2v 模型 ID。
使用準確的型號 ID wan2.7-r2v。模型欄位必須與此頁面完全相符。
參數: duration=5resolution=1080Pratio=16:9參考圖片
提示詞: One continuous take, no cuts. Keep the glass flowers from the reference exactly as they are and carry them into a new place: a wide city crossing at night in the rain. The whole bed of glass blooms now grows straight out of the wet asphalt across the junction, ringing as the rain strikes them, headlights firing caustics along the road. The camera starts at kerb height among the stems, moves forward through them and rises to look down the length of the crossing. One hard pink key from a shopfront on the left, cold blue signals behind. Real weight and inertia, glass and water, no text.
{ "model": "wan2.7-r2v", "input": { "prompt": "One continuous take, no cuts. Keep the glass flowers from the reference exactly as they are and carry them into a new place: a wide city crossing at night in the rain. The whole bed of glass blooms now grows straight out of the wet asphalt across the junction, ringing as the rain strikes them, headlights firing caustics along the road. The camera starts at kerb height among the stems, moves forward through them and rises to look down the length of the crossing. One hard pink key from a shopfront on the left, cold blue signals behind. Real weight and inertia, glass and water, no text.", "media": [ { "type": "reference_image", "url": "https://example.com/input-image.png" } ] }, "parameters": { "duration": 5, "resolution": "1080P", "ratio": "16:9" }}身份驗證與端點
Section titled “身份驗證與端點”將 Modelflare API 金鑰與 https://modelflare.dev/v1 結合使用。網關入口點是POST /v1/videos。
Authorization: Bearer YOUR_MODELFLARE_API_KEYcurl https://modelflare.dev/v1/videos \ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "wan2.7-r2v", "input": {"prompt": "The subject in Image 1 walks through the street from Video 1.", "media": [{"type": "reference_image", "url": "https://example.com/reference.png"}, {"type": "reference_video", "url": "https://example.com/reference.mp4"}]}, "parameters": {"resolution": "1080P", "ratio": "16:9", "duration": 5, "prompt_extend": false, "watermark": false} }'儲存任務ID。輪詢 GET /v1/videos/{task_id} 並使用 GET /v1/videos/{task_id}/content 下載。結果 URL 可能會過期,因此請立即傳輸檔案。
curl https://modelflare.dev/v1/videos/TASK_ID \ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY"萬常用input和parameters;幀引導模式和參考媒體模式不得混合。
Wan2.7 R2V 使用 reference_image / reference_video 介質,並且可以附加 reference_voice。請勿將此工作流程與 first_frame / last_frame 角色混合。
| 場 | 必填 | 註釋 |
|---|---|---|
model |
是 | wan2.7-r2v |
input.prompt |
是 | 使用記錄的語法描述場景和參考媒體 |
input.media[] |
是 | 至少一個 reference_image 或 reference_video |
input.media[].reference_voice |
否 | 語音特徵的公共 WAV/MP3 URL |
parameters.resolution |
否 | 720P / 1080P(預設 1080P) |
parameters.ratio |
否 | 16:9 / 9:16 / 1:1 / 4:3 / 3:4(first_frame存在時忽略) |
parameters.duration |
否 | 當存在參考影片時使用較短的持續時間限制 |
parameters.prompt_extend |
否 | 當此專用模型合約需要時設定為 false |
parameters.watermark |
否 | 是否添加浮水印 |
parameters.seed |
否 | 可選的隨機種子 |
輸入與輸出限制
Section titled “輸入與輸出限制”R2V 需要至少一張 reference_image 或 reference_video,最多組合 5 個參考影像/影片。 可以附加一個first_frame和一個reference_voice; 當有參考影片時,持續時間限制會更短。
記錄的工作流程範例
Section titled “記錄的工作流程範例”curl https://modelflare.dev/v1/videos \ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "wan2.7-r2v", "input": {"prompt": "让图像主体沿视频动作自然移动", "media": [ {"type": "reference_image", "url": "https://example.com/subject.png"}, {"type": "reference_video", "url": "https://example.com/motion.mp4"} ]}, "parameters": {"resolution": "1080P", "duration": 8, "prompt_extend": false} }'錯誤與失敗的任務
Section titled “錯誤與失敗的任務”無效模型參數傳回帶有請求 ID 的 4xx。非同步任務建立成功後也可能進入失敗;使用輪詢回應中的 error_code 和 error_message 作為最終任務原因。不要使用不同的 JSON 形狀重試相同的請求。
此頁面涵蓋 Modelflare 模型產生和編輯呼叫。搜尋或地圖豐富、語音管理和元素庫管理是此公共模型呼叫表面之外的資源 API,並且不是必需的請求欄位。
此模型採用按秒視訊計費。請參閱 型號定價頁面 ,以了解當前客戶價格、參考標價和完整規格。
| 型號 ID | 差異 |
|---|---|
wan2.7-r2v |
本頁記錄的模型。 |
媒體合約 · v1
官方來源: Alibaba Cloud Model Studio
合約參數
| 意圖字段 | 控制項 | 選項 |
|---|---|---|
ratio | select | 16:9 / 9:16 / 1:1 / 4:3 / 3:4 |
resolution | select | 720p / 1080p |
duration | select | 2 / 3 / 4 / 5 / 6 / 7 / 8 / 9 / 10 / 11 / 12 / 13 / 14 / 15 |
支援的功能
allowed_values·ratio· 16:9, 9:16, 1:1, 4:3, 3:4allowed_values·resolution· 720p, 1080pallowed_values·duration· 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15required_assets·reference_asset_idsmax_assets·reference_asset_ids· 6
結構化請求範例
reference
意圖
{
"duration": 2,
"prompt": "A red paper kite over a quiet harbour at dusk.",
"ratio": "16:9",
"reference_asset_ids": [
"asset_example"
],
"resolution": "720p"
}提供者請求
{
"input": {
"media": [
{
"type": "reference_image",
"url": "https://example.com/reference.png"
}
],
"prompt": "A red paper kite over a quiet harbour at dusk."
},
"model": "wan2.7-r2v",
"parameters": {
"duration": 2,
"resolution": "720P"
}
}