Ein HappyHorse-Video erstellen
Erstellen Sie über CometAPI mit POST /v1/videos eine HappyHorse-Text-zu-Video- oder Referenzbild-Videoaufgabe, fragen Sie dann die Aufgabe ab und laden Sie die fertige MP4-Datei herunter.
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, um die Aufgabe abzufragen und das fertige Video herunterzuladen.
POST /v1/videos verwendet multipart/form-data. Senden Sie Steuerelemente als Formularfelder und Referenzbilder als input_reference-Felder, jeweils mit einer HTTPS-URL oder hochgeladenen Bilddatei pro Feld.
Einen Eingabemodus auswählen
| Ziel | Modell | Erforderliche Felder | Optionale Felder |
|---|---|---|---|
| Text-zu-Video | happyhorse-1.0, happyhorse-1.1 | model, prompt | seconds, size |
| Referenz-zu-Video | happyhorse-1.0, happyhorse-1.1 | model, prompt, 1–9 input_reference URLs oder Dateien | seconds, size |
| Bild-zu-Video mit erstem Frame | happyhorse-1.0, happyhorse-1.1 | model, prompt, eine first_frame-URL oder -Datei | seconds, size |
input_reference einmal pro Bild in Bildreihenfolge.
Verwenden Sie innerhalb dieses Feldes nur URLs oder nur Dateien. Senden Sie jede URL separat, anstatt URLs durch Kommas zu verbinden.
Für input_reference muss jedes Referenzbild höchstens 10 MB groß sein und happyhorse-1.0 aufweisen.
Bei happyhorse-1.1 muss jedes Referenzbild höchstens 20 MB groß sein.
Diese Modellgrenzen gelten sowohl für Bild-URLs als auch für hochgeladene Dateien.
Verwenden Sie JPEG-, JPG-, PNG- oder WEBP-Bilder mit einer kürzesten Seite von mindestens 400 px.
Das Upload-Limit für input_reference beträgt 20 MiB (20 × 1024 × 1024 Byte) pro Datei. Hochgeladene Bilder müssen außerdem die oben angegebene modellspezifische Grenze erfüllen.
Die Anfragebeispiele oben auf dieser Seite zeigen mehrere Bild-URLs für HappyHorse 1.1 und mehrere Datei-Uploads für beide Modelle.
Um den Anfangsframe festzulegen, senden Sie first_frame einmal mit einer öffentlich zugänglichen HTTPS-Bild-URL oder einer Bilddatei. Verwenden Sie dieses Feld in einer separaten Anfrage von input_reference.
Dauer und Größe festlegen
| Modell-ID | seconds | Standard |
|---|---|---|
happyhorse-1.0 | Ganzzahl 3-15 | 5 Sekunden, 1920x1080 |
happyhorse-1.1 | Ganzzahl 3-15 | 5 Sekunden, 1920x1080 |
WxH-Wert für size aus der Tabelle unten.
Bei Anfragen mit erstem Frame bestimmt das Bild den Bildausschnitt und das Seitenverhältnis, während size die Ausgabestufenauflösung auswählt.
| Modell | Frame-Form | size Werte |
|---|---|---|
happyhorse-1.0 | Querformat | 1280x720, 1920x1080 |
| Hochformat | 720x1280, 1080x1920 | |
| Quadratisch | 1440x1440 | |
happyhorse-1.1 | Querformat | 1280x720, 1920x1080 |
| Hochformat | 720x1280, 1080x1920 | |
| Quadratisch | 1440x1440 | |
| Klassisches Querformat | 1440x1080 | |
| Klassisches Hochformat | 720x960, 1080x1440 | |
| Breites Querformat | 2520x1080 | |
| Breites Hochformat | 1080x2520 | |
| Fast quadratisches Querformat | 900x720, 1350x1080 | |
| Fast quadratisches Hochformat | 720x900, 1080x1350 |
Task-Ablauf
Task erstellen
id.Task abfragen
status den Wert completed, failed oder error hat.Ergebnis herunterladen
completed ist, rufen Sie HappyHorse-Videoinhalte abrufen auf, um die MP4-Datei herunterzuladen.Autorisierungen
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://Antwort
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
}