Buat video HappyHorse
Buat tugas video HappyHorse dari teks ke video atau gambar referensi melalui CometAPI dengan POST /v1/videos, lalu polling tugas dan unduh file MP4 yang telah selesai.
curl https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F model=happyhorse-1.1 \
-F 'prompt=A close-up cinematic shot of a ceramic coffee cup on a wooden table. Steam rises slowly while morning light moves across the background.' \
-F seconds=3 \
-F size=1920x1080{
"id": "task_example",
"task_id": "task_example",
"object": "video",
"model": "happyhorse-1.1",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}id yang dikembalikan untuk melakukan polling tugas dan mengunduh video yang telah selesai.
POST /v1/videos menggunakan multipart/form-data. Kirim kontrol sebagai kolom formulir dan gambar referensi sebagai kolom input_reference, dengan satu URL HTTPS atau file gambar yang diunggah per kolom.
Pilih mode input
| Tujuan | Model | Kolom wajib | Kolom opsional |
|---|---|---|---|
| Teks-ke-video | happyhorse-1.0, happyhorse-1.1 | model, prompt | seconds, size |
| Referensi-ke-video | happyhorse-1.0, happyhorse-1.1 | model, prompt, 1–9 input_reference URL atau file | seconds, size |
| Gambar frame pertama-ke-video | happyhorse-1.0, happyhorse-1.1 | model, prompt, satu URL atau file first_frame | seconds, size |
input_reference satu kali untuk setiap gambar sesuai urutan gambar.
Gunakan hanya URL atau hanya file dalam kolom ini. Kirim setiap URL secara terpisah, bukan dengan menggabungkan URL menggunakan koma.
Untuk input_reference, setiap gambar referensi harus berukuran 10 MB atau kurang dengan happyhorse-1.0.
Dengan happyhorse-1.1, setiap gambar referensi harus berukuran 20 MB atau kurang.
Batas model ini berlaku untuk URL gambar dan file yang diunggah.
Gunakan gambar JPEG, JPG, PNG, atau WEBP dengan sisi terpendek minimal 400 px.
Batas unggahan input_reference adalah 20 MiB (20 × 1024 × 1024 byte) per file. Gambar yang diunggah juga harus memenuhi batas khusus model di atas.
Contoh permintaan di bagian atas halaman ini menampilkan beberapa URL gambar untuk HappyHorse 1.1 dan beberapa unggahan file untuk kedua model.
Untuk menetapkan frame pembuka, kirim first_frame sekali dengan satu URL gambar HTTPS yang dapat diakses publik atau satu file gambar. Gunakan kolom ini dalam permintaan terpisah dari input_reference.
Tetapkan durasi dan ukuran
| ID model | seconds | Default |
|---|---|---|
happyhorse-1.0 | integer 3-15 | 5 detik, 1920x1080 |
happyhorse-1.1 | integer 3-15 | 5 detik, 1920x1080 |
WxH yang tepat untuk size dari tabel di bawah.
Untuk permintaan frame pertama, gambar menentukan pembingkaian dan rasio aspek, sedangkan size memilih tingkat resolusi output.
| Model | Bentuk frame | size nilai |
|---|---|---|
happyhorse-1.0 | Lanskap | 1280x720, 1920x1080 |
| Potret | 720x1280, 1080x1920 | |
| Persegi | 1440x1440 | |
happyhorse-1.1 | Lanskap | 1280x720, 1920x1080 |
| Potret | 720x1280, 1080x1920 | |
| Persegi | 1440x1440 | |
| Lanskap klasik | 1440x1080 | |
| Potret klasik | 720x960, 1080x1440 | |
| Lanskap lebar | 2520x1080 | |
| Potret lebar | 1080x2520 | |
| Lanskap hampir persegi | 900x720, 1350x1080 | |
| Potret hampir persegi | 720x900, 1080x1350 |
Alur tugas
Buat tugas
id yang dikembalikan.Polling tugas
status bernilai completed, failed, atau error.Unduh hasil
completed, panggil Ambil konten video HappyHorse untuk mengunduh file MP4.Body
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://Respons
Task created. Store the returned id and poll GET /v1/videos/{task_id}.
curl https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F model=happyhorse-1.1 \
-F 'prompt=A close-up cinematic shot of a ceramic coffee cup on a wooden table. Steam rises slowly while morning light moves across the background.' \
-F seconds=3 \
-F size=1920x1080{
"id": "task_example",
"task_id": "task_example",
"object": "video",
"model": "happyhorse-1.1",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}