建立 HappyHorse 影片
透過 CometAPI 使用 POST /v1/videos 建立 HappyHorse 文字轉影片或參考圖片影片任務,然後輪詢任務並下載完成的 MP4 檔案。
{
"id": "task_example",
"task_id": "task_example",
"object": "video",
"model": "happyhorse-1.1",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}id,以輪詢任務並下載完成的影片。
POST /v1/videos 使用 multipart/form-data。將控制項作為表單欄位傳送,並將參考圖片作為 input_reference 欄位傳送,每個欄位包含一個 HTTPS URL 或上傳的圖片檔案。
選擇輸入模式
| 目標 | 模型 | 必填欄位 | 選填欄位 |
|---|---|---|---|
| 文字轉影片 | happyhorse-1.0, happyhorse-1.1 | model, prompt | seconds, size |
| 參考圖轉影片 | happyhorse-1.0, happyhorse-1.1 | model, prompt, 1–9 input_reference URL 或檔案 | seconds, size |
| 首幀圖像轉影片 | happyhorse-1.0, happyhorse-1.1 | model, prompt,一個 first_frame URL 或檔案 | seconds, size |
input_reference。
在此欄位中僅使用 URL 或僅使用檔案。請分別傳送每個 URL,不要以逗號串接 URL。
對於 input_reference,每張參考圖片必須為 10 MB 以下,並符合 happyhorse-1.0。
使用 happyhorse-1.1 時,每張參考圖片必須為 20 MB 以下。
這些模型限制同時適用於圖片 URL 與上傳的檔案。
請使用最短邊至少為 400 px 的 JPEG、JPG、PNG 或 WEBP 圖片。
每個檔案的 input_reference 上傳限制為 20 MiB(20 × 1024 × 1024 位元組)。上傳的圖片也必須符合上述模型專屬限制。
本頁頂端的請求範例顯示 HappyHorse 1.1 的多個圖片 URL,以及兩個模型的多個檔案上傳。
若要設定起始影格,請傳送一次 first_frame,並提供一個可公開存取的 HTTPS 圖片 URL 或一個圖片檔案。請在與 input_reference 不同的請求中使用此欄位。
設定時長與尺寸
| 模型 ID | seconds | 預設值 |
|---|---|---|
happyhorse-1.0 | 整數 3-15 | 5 秒, 1920x1080 |
happyhorse-1.1 | 整數 3-15 | 5 秒, 1920x1080 |
WxH 值,以供 size 使用。
對於首幀請求,圖片會決定畫面構圖與長寬比,而 size 則選擇輸出解析度等級。
| 模型 | 畫面形狀 | size 值 |
|---|---|---|
happyhorse-1.0 | 橫向 | 1280x720, 1920x1080 |
| 直向 | 720x1280, 1080x1920 | |
| 正方形 | 1440x1440 | |
happyhorse-1.1 | 橫向 | 1280x720, 1920x1080 |
| 直向 | 720x1280, 1080x1920 | |
| 正方形 | 1440x1440 | |
| 標準橫向 | 1440x1080 | |
| 標準直向 | 720x960, 1080x1440 | |
| 寬幅橫向 | 2520x1080 | |
| 寬幅直向 | 1080x2520 | |
| 接近正方形的橫向 | 900x720, 1350x1080 | |
| 接近正方形的直向 | 720x900, 1080x1350 |
任務流程
建立任務
id。輪詢任務
status 為 completed、failed 或 error。下載結果
completed 時,呼叫 取得 HappyHorse 影片內容 以下載 MP4 檔案。主體
Reference images for reference-to-video. Send 1–9 publicly accessible HTTPS image URLs or 1–9 uploaded image files by repeating input_reference once per image. Use only URLs or only files within this field; do not join URLs with commas. Reference images guide subjects and visual details. CometAPI preserves image order. Use JPEG, JPG, PNG, or WEBP images with a shortest side of at least 400 px. Each reference image must be at or below 10 MB for happyhorse-1.0 or 20 MB for happyhorse-1.1. These model limits apply to both image URLs and uploaded files. The input_reference file upload limit is 20 MiB (20 x 1024 x 1024 bytes) per file. Keep uploads within the model limit as well. Keep this field separate from first_frame.
^https://回應
Task created. Store the returned id and poll GET /v1/videos/{task_id}.
{
"id": "task_example",
"task_id": "task_example",
"object": "video",
"model": "happyhorse-1.1",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}