Przejdź do głównej treści
POST
Utwórz film HappyHorse z tekstu, obrazów referencyjnych lub klatki otwierającej. API natychmiast zwraca identyfikator zadania. Zapisz zwrócony id, aby odpytywać zadanie i pobrać ukończony film. POST /v1/videos używa multipart/form-data. Wysyłaj elementy sterujące jako pola formularza, a obrazy referencyjne jako pola input_reference, po jednym adresie HTTPS lub przesłanym pliku obrazu na pole.

Wybierz tryb wejściowy

Obrazy referencyjne określają obiekty i szczegóły wizualne w filmie. Wyślij 1–9 publicznie dostępnych adresów HTTPS obrazów lub 1–9 plików obrazów, powtarzając input_reference raz dla każdego obrazu w kolejności obrazów. W tym polu używaj wyłącznie adresów URL albo wyłącznie plików. Wysyłaj każdy adres URL osobno, zamiast łączyć adresy URL przecinkami. W przypadku input_reference każdy obraz referencyjny musi mieć rozmiar nie większy niż 10 MB z happyhorse-1.0. W przypadku happyhorse-1.1 każdy obraz referencyjny musi mieć rozmiar nie większy niż 20 MB. Te ograniczenia modelu dotyczą zarówno adresów URL obrazów, jak i przesłanych plików. Używaj obrazów JPEG, JPG, PNG lub WEBP, których krótszy bok ma co najmniej 400 px. Limit przesyłania input_reference wynosi 20 MiB (20 × 1024 × 1024 bajtów) na plik. Przesłane obrazy muszą również spełniać podane wyżej ograniczenie właściwe dla modelu. Przykłady żądań u góry tej strony pokazują wiele adresów URL obrazów dla HappyHorse 1.1 oraz wielokrotne przesyłanie plików dla obu modeli. Aby ustawić klatkę otwierającą, wyślij first_frame raz z jednym publicznie dostępnym adresem HTTPS obrazu lub jednym plikiem obrazu. Użyj tego pola w osobnym żądaniu niż input_reference.

Ustaw czas trwania i rozmiar

Wybierz dokładną wartość WxH dla size z poniższej tabeli. W żądaniach z pierwszą klatką obraz określa kadrowanie i proporcje, a size wybiera poziom rozdzielczości wyjściowej.

Przepływ zadania

1

Utwórz zadanie

Wyślij żądanie formularza multipart i zapisz zwrócony id.
2

Odpytuj zadanie

Wywołuj Pobierz film HappyHorse aż status ma wartość completed, failed lub error.
3

Pobierz wynik

Gdy zadanie ma stan completed, wywołaj Pobierz zawartość filmu HappyHorse aby pobrać plik MP4.

Autoryzacje

Authorization
string
header
wymagane

Bearer authentication. Use your CometAPI API key.

Treść

multipart/form-data
model
enum<string>
wymagane

HappyHorse model ID for this endpoint.

Dostępne opcje:
happyhorse-1.0,
happyhorse-1.1
Przykład:

"happyhorse-1.1"

prompt
string
wymagane

Text prompt that describes the video to generate. For image inputs, describe the motion and visual details to preserve.

Przykład:

"Use the uploaded reference image as the visual guide. Create a short cinematic shot with gentle natural motion."

seconds
integer
domyślnie:5

Requested clip duration in whole seconds. Send an integer from 3 through 15 as a form field. The default is 5.

Wymagany zakres: 3 <= x <= 15
Przykład:

3

size
string

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.

Przykład:

"1920x1080"

input_reference

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.

Pattern: ^https://
first_frame

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.

Pattern: ^https://

Odpowiedź

Task created. Store the returned id and poll GET /v1/videos/{task_id}.

id
string
wymagane

Task ID. Use this value with retrieve and content endpoints.

Przykład:

"task_example"

object
string
wymagane

Object type. Video tasks return video.

Przykład:

"video"

model
string
wymagane

Model ID used for the task.

Przykład:

"happyhorse-1.1"

status
enum<string>
wymagane

Task lifecycle status. Poll until the value is completed, failed, or error.

Dostępne opcje:
queued,
in_progress,
completed,
failed,
error
Przykład:

"queued"

progress
integer
wymagane

Task progress as a coarse percentage.

Wymagany zakres: 0 <= x <= 100
Przykład:

0

created_at
integer
wymagane

Task creation time as a Unix timestamp in seconds.

Przykład:

1779938152

task_id
string

Compatibility alias for id when present.

Przykład:

"task_example"

completed_at
integer

Task completion time as a Unix timestamp in seconds. This field appears on completed tasks.

Przykład:

1779938219

video_url
string

Temporary video delivery URL. This field appears on completed tasks.

Przykład:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.

Ostatnia modyfikacja 9 września 2026