建立 HappyHorse 影片
透過 CometAPI 使用 POST /v1/videos 建立 HappyHorse 文字轉影片或參考圖片影片任務,接著輪詢任務並下載完成的 MP4 檔案。
id,並輪詢任務直到其進入終止狀態。
POST /v1/videos 使用 multipart/form-data;將純量控制項作為表單欄位傳遞,並將參考圖片作為 input_reference 檔案欄位傳遞。
選擇輸入模式
input_reference multipart 欄位來上傳 1-9 張參考圖片。CometAPI 會將每個上傳的檔案作為一張 HappyHorse 參考圖片傳送。請使用 JPEG、JPG、PNG 或 WEBP 圖片,每張圖片大小上限為 20 MB;為了獲得較佳效果,請使用最短邊至少為 400 px 的圖片。
設定時長與尺寸
size 設為精確的 WxH 值。
任務流程
建立任務
id。輪詢任務
status 為 completed、failed 或 error。下載結果
completed 時,呼叫 擷取 HappyHorse 影片內容 以下載 MP4 檔案。授權
Bearer authentication. Use your CometAPI API key.
主體
HappyHorse model ID for this endpoint.
happyhorse-1.0, happyhorse-1.1 "happyhorse-1.1"
Text prompt that describes the video to generate. For reference-image requests, combine the prompt with the uploaded reference image.
"Use the uploaded reference image as the visual guide. Create a short cinematic shot with gentle natural motion."
Requested clip duration in seconds. Use an integer from 3 through 15. Default is 5.
"3"
Output size as an exact WxH value. Use one of the documented size values for the selected HappyHorse model.
"1920x1080"
Reference image file for reference-to-video. Required when using reference-to-video; repeat this multipart field to send additional reference images. CometAPI preserves upload order. Use JPEG, JPG, PNG, or WEBP images up to 20 MB each.
回應
Task created. Store the returned id and poll GET /v1/videos/{task_id}.
Task ID. Use this value with retrieve and content endpoints.
"task_example"
Object type. Video tasks return video.
"video"
Model ID used for the task.
"happyhorse-1.1"
Task lifecycle status. Poll until the value is completed, failed, or error.
queued, in_progress, completed, failed, error "queued"
Task progress as a coarse percentage.
0 <= x <= 1000
Task creation time as a Unix timestamp in seconds.
1779938152
Compatibility alias for id when present.
"task_example"
Task completion time as a Unix timestamp in seconds. This field appears on completed tasks.
1779938219
Temporary video delivery URL. This field appears on completed tasks.
"<temporary-video-url>"
Failure details. This field appears when the task fails.