Wan 2.6 API
Alibaba의 Wan 2.6 비디오 생성 모델에 대한 완전한 API 참조 문서입니다.
모델 변형
이 API는 두 가지 모델 변형을 지원합니다:
빠른 비교
Wan 2.6 Text to Video
엔드포인트 {#}
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: 'wan-2.6-text-to-video',
prompt: 'A cat playing with a ball of yarn',
duration: 5,
resolution: '1080p'
})
});
const { data } = await response.json();
const taskId = data.task_id;
Wan 2.6 Image to Video
요청 매개변수
필수 매개변수
선택 매개변수
요청 예시
{
model_name: 'wan-2.6-image-to-video',
image_url: 'https://example.com/image.jpg',
prompt: 'Gentle camera pan from left to right',
duration: 5,
resolution: '1080p'
}
응답 형식
초기 응답
두 모델 모두 폴링을 위한 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"
}
}
폴링 응답
상태를 확인하려면 /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분.
긴 비디오(10-15초)는 최대 8분이 걸릴 수 있습니다.
모범 사례
- 장면 및 모션 설명: 프롬프트에 장면 내용과 카메라 움직임을 모두 포함하세요
- 해상도 선택: 빠른 처리를 위해 720p를, 최고 품질을 위해 1080p를 사용하세요
- 길이 계획: 긴 비디오는 더 많은 비용이 듭니다(초당 가격 책정)
- 오디오 통합:
audio_url 매개변수를 통해 사용자 정의 오디오를 추가할 수 있습니다
- 이미지 품질: 이미지-비디오의 경우 최상의 결과를 위해 고품질 입력 이미지를 사용하세요
사용 사례 예시
제품 데모 비디오
{
model_name: 'wan-2.6-text-to-video',
prompt: 'Smooth 360-degree rotation of a luxury watch on a pedestal',
duration: 8,
resolution: '1080p'
}
애니메이션 초상화
{
model_name: 'wan-2.6-image-to-video',
image_url: 'portrait.jpg',
prompt: 'Subtle head movement, natural breathing, soft smile',
duration: 5,
resolution: '1080p'
}
오디오가 있는 장면
{
model_name: 'wan-2.6-text-to-video',
prompt: 'Ocean waves crashing on a beach at sunset',
duration: 10,
resolution: '1080p',
audio_url: 'https://example.com/ocean-sounds.mp3'
}