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

影片

happyhorse-1.1-i2v API

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

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

範例輸出happyhorse-1.1-i2vPOST /v1/videos5.2s

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

提示詞: One continuous take, no cuts. The braided steam keeps thickening until the ribbons lock into one coral and ultraviolet serpent that uncoils along the ceiling, drops down past the stools and pours out through the open door into the rain, the cook in the orange jacket stepping back to let it pass. The camera holds at counter height, then tracks with the serpent to the doorway and tilts to watch it leave. One hard tungsten bulb overhead stays the only warm source. Real weight and inertia, visible density in the steam, no text.

產生此範例的請求,並取代了輸入媒體 URL
{
"model": "happyhorse-1.1-i2v",
"prompt": "One continuous take, no cuts. The braided steam keeps thickening until the ribbons lock into one coral and ultraviolet serpent that uncoils along the ceiling, drops down past the stools and pours out through the open door into the rain, the cook in the orange jacket stepping back to let it pass. The camera holds at counter height, then tracks with the serpent to the doorway and tilts to watch it leave. One hard tungsten bulb overhead stays the only warm source. Real weight and inertia, visible density in the steam, 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": "happyhorse-1.1-i2v",
"input": {"prompt": "The cat runs across the grass as the camera follows smoothly.", "media": [{"type": "first_frame", "url": "https://example.com/cat.png"}]},
"parameters": {"resolution": "1080P", "duration": 5, "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"

HappyHorse 使用 input.prompt;選擇與 t2v、i2v 或 r2v 模型 ID 相符的 input.media 形狀。

HappyHorse I2V 將一張 first_frame 影像放置在 input.media 中。

場 必填 註釋
model 是 happyhorse-1.1-i2v
input.prompt 否 選配動作和攝影機描述,最多 5,000 個非中文字元或 2,500 個中文字符
input.media[] 是 剛好一 first_frame;公用 URL 或 Base64 資料 URL,小於 20 MB,邊長最小為 300 像素,寬高比為 1:2.5–2.5:1
parameters.resolution 否 720P / 1080P,預設 1080P
parameters.ratio 否 不支援;輸出遵循第一幀影像比例
parameters.duration 否 3–15 秒,預設 5
parameters.watermark 否 是否添加HappyHorse浮水印
parameters.seed 否 可選種子從 0 到 2,147,483,647

I2V 使用一張 first_frame 圖片;接受小於 20 MB 的公共 URL 或 Base64 資料 URL,最小邊長為 300 像素,長寬比為 1:2.5–2.5:1,並大致保留輸入比例。

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

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

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

媒體合約 · v1

合約 ID: media.happyhorse-1-1-i2v.v1適配器: video.happyhorse.v1@v1指紋: 01f7b831efe834006a6606efc8aa63b9cf704640b40556d3c3e1f70d0a91a3db

官方來源: Alibaba Cloud Model Studio

合約參數

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

支援的功能

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

結構化請求範例

reference

意圖

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

提供者請求

{
  "duration": 3,
  "image": "https://example.com/reference.png",
  "model": "happyhorse-1.1-i2v",
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "resolution": "720p",
  "seconds": "3"
}