Tạo video HappyHorse
Tạo tác vụ video HappyHorse từ văn bản hoặc hình ảnh tham chiếu qua CometAPI bằng POST /v1/videos, sau đó thăm dò tác vụ và tải xuống tệp MP4 đã hoàn tất.
id được trả về để thăm dò tác vụ và tải xuống video đã hoàn tất.
POST /v1/videos sử dụng multipart/form-data. Gửi các tùy chọn điều khiển dưới dạng trường biểu mẫu và hình ảnh tham chiếu dưới dạng trường input_reference, với một URL HTTPS hoặc tệp hình ảnh đã tải lên cho mỗi trường.
Chọn chế độ đầu vào
input_reference một lần cho mỗi hình ảnh theo thứ tự hình ảnh.
Chỉ sử dụng URL hoặc chỉ sử dụng tệp trong trường này. Gửi riêng từng URL thay vì nối các URL bằng dấu phẩy.
Với input_reference, mỗi hình ảnh tham chiếu phải có dung lượng từ 10 MB trở xuống với happyhorse-1.0.
Với happyhorse-1.1, mỗi hình ảnh tham chiếu phải có dung lượng từ 20 MB trở xuống.
Các giới hạn mô hình này áp dụng cho cả URL hình ảnh và tệp đã tải lên.
Sử dụng hình ảnh JPEG, JPG, PNG hoặc WEBP có cạnh ngắn nhất tối thiểu 400 px.
Giới hạn tải lên input_reference là 20 MiB (20 × 1024 × 1024 byte) cho mỗi tệp. Hình ảnh đã tải lên cũng phải đáp ứng giới hạn dành riêng cho mô hình ở trên.
Các mẫu yêu cầu ở đầu trang này hiển thị nhiều URL hình ảnh cho HappyHorse 1.1 và nhiều tệp tải lên cho cả hai mô hình.
Để đặt khung hình mở đầu, hãy gửi first_frame một lần cùng một URL hình ảnh HTTPS có thể truy cập công khai hoặc một tệp hình ảnh. Sử dụng trường này trong một yêu cầu riêng biệt với input_reference.
Đặt thời lượng và kích thước
WxH chính xác cho size từ bảng bên dưới.
Đối với các yêu cầu khung hình đầu tiên, hình ảnh quyết định bố cục khung hình và tỷ lệ khung hình, còn size chọn cấp độ phân giải đầu ra.
Quy trình tác vụ
Tạo tác vụ
id được trả về.Thăm dò tác vụ
status là completed, failed hoặc error.Tải xuống kết quả
completed, hãy gọi Truy xuất nội dung video HappyHorse để tải xuống tệp MP4.Ủy quyền
Bearer authentication. Use your CometAPI API key.
Nội dung
HappyHorse model ID for this endpoint.
happyhorse-1.0, happyhorse-1.1 "happyhorse-1.1"
Text prompt that describes the video to generate. For image inputs, describe the motion and visual details to preserve.
"Use the uploaded reference image as the visual guide. Create a short cinematic shot with gentle natural motion."
Requested clip duration in whole seconds. Send an integer from 3 through 15 as a form field. The default is 5.
3 <= x <= 153
Output size as an exact WxH value. Use one of the documented size values for the selected HappyHorse model. For first-frame requests, size selects the resolution tier; the image determines the framing and aspect ratio.
"1920x1080"
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://Opening-frame image as one publicly accessible HTTPS URL or one image file. Send this field once, using either a URL or a file. Use JPEG, JPG, PNG, or WEBP images up to 20 MB. Do not combine first_frame with input_reference.
^https://Phản hồi
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.