Happy Horse 1.0 API
Alibaba의 Happy Horse 1.0 비디오 생성 모델을 위한 전체 API 레퍼런스입니다.
모델 변형
이 API는 두 가지 모델 변형을 지원합니다:
빠른 비교
Text to Video에서 지원되는 화면비
Happy Horse 1.0 Text to Video
Endpoint
POST /api/v1/video/task
요청 파라미터
필수
선택
요청 예시
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model_name: 'happyhorse-1.0-text-to-video',
prompt: 'A cat playing with a ball of yarn on a sunny windowsill',
duration: 5,
resolution: '1080p',
aspect_ratio: '16:9',
seed: 42,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
Happy Horse 1.0 Image to Video
요청 파라미터
필수
선택
입력 이미지 요구사항
- 지원 형식:
JPEG, JPG, PNG, BMP, WEBP
- 지원 화면비 범위:
1:2.5 부터 2.5:1
- 최소 크기:
300px
- 명시적인 최대 해상도 제한 없음
- 출력 프레이밍은 업로드한 이미지 구도를 따릅니다
요청 예시
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model_name: 'happyhorse-1.0-image-to-video',
image_url: 'https://example.com/first-frame.jpg',
prompt: 'Gentle motion; cinematic lighting',
duration: 5,
resolution: '1080p',
seed: 42,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
응답 형식
초기 응답
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
폴링 응답
상태를 확인하려면 GET /api/v1/video/{taskId} 를 폴링하세요:
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "succeed",
"task_status_msg": null,
"task_result": {
"videos": [
{
"url": "https://example.com/generated-video.mp4"
}
]
}
}
}
상태 값
submitted: 작업이 접수되었으며 처리 대기 중
processing: 비디오 생성 진행 중
succeed: 비디오 생성 완료
failed: 비디오 생성 실패
처리 시간
일반적인 처리 시간: 길이와 대기열 부하에 따라 2-5분.
모범 사례
- 움직임을 명확하게 설명하기: 피사체 움직임, 카메라 움직임, 장면 전개를 추가하면 비디오의 역동성이 좋아집니다.
- 먼저 짧은 반복으로 시작하기: 더 긴 클립을 실행하기 전에 3-5초 생성으로 프롬프트 방향을 검증하세요.
- 적절한 입력 이미지 선택하기: image-to-video에는 피사체가 분명하고 조명이 좋은 선명한 이미지를 사용하세요.
- 변형 비교를 위해 Seed 재사용하기: 프롬프트를 다듬어 테스트할 때 동일한
seed 를 유지하면 결과를 더 일관되게
비교할 수 있습니다.
- 배포 채널에 맞는 비율 선택하기: 가로형 비디오에는
16:9, 쇼츠와 릴스에는 9:16, 정사각형 배치에는 1:1 을
사용하세요.