Wan 3.0 API
Alibaba의 Wan 3.0 비디오 생성 모델에 대한 전체 API 레퍼런스입니다.
모델 변형
이 API는 네 가지 모델 변형을 지원합니다.
빠른 비교
공통 엔드포인트
모든 Wan 3.0 변형은 비디오 작업 엔드포인트를 사용합니다.
POST /api/v1/video/task
공통 매개변수
필수 {#}
선택 사항
Wan 3.0 텍스트 비디오 생성
model_name을 "wan-3.0-text-to-video"로 설정하고 공통 필수 매개변수를 입력합니다.
요청 예시
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-3.0-text-to-video',
prompt: 'A cinematic tracking shot follows a cyclist through a rain-soaked neon city at night',
duration: 8,
resolution: '1080p',
aspect_ratio: '16:9',
sound: true,
seed: 42
})
});
const { data } = await response.json();
const taskId = data.task_id;
Wan 3.0 이미지 비디오 생성
필수 이미지 입력
두 이미지 모두 JPEG, JPG, 알파 채널이 없는 PNG, BMP 또는 WEBP 형식이어야 합니다. 각 이미지의 가로와 세로 길이는 240픽셀에서 8000픽셀 사이여야 합니다.
요청 예시
{
model_name: 'wan-3.0-image-to-video',
prompt: 'The camera glides forward as daylight gradually shifts into a warm evening glow',
image_url: 'https://example.com/start-frame.jpg',
image_end_url: 'https://example.com/end-frame.jpg',
duration: 8,
resolution: '1080p',
aspect_ratio: '16:9',
sound: true,
seed: 42
}
Wan 3.0 비디오 편집
필수 비디오 입력
소스 비디오 길이와 요청한 출력 duration의 합은 30초를 초과할 수 없습니다.
요청 예시
{
model_name: 'wan-3.0-video-edit',
prompt: 'Turn the daytime scene into a rainy evening while preserving the subject and camera movement',
video_url: 'https://example.com/source-video.mp4',
duration: 10,
resolution: '1080p',
aspect_ratio: '16:9',
sound: true,
seed: 42
}
Wan 3.0 참조 비디오 생성
참조 입력은 선택 사항이며 조합하여 사용할 수 있지만, files와 links는 함께 제출할 수 없습니다.
선택적 참조 입력
요청 예시
{
model_name: 'wan-3.0-reference-to-video',
prompt: 'Use the references to create a cinematic product launch with coordinated motion and sound',
duration: 12,
resolution: '1080p',
aspect_ratio: '16:9',
sound: true,
images: ['https://example.com/product-reference.jpg'],
videos: ['https://example.com/motion-reference.mp4'],
audios: ['https://example.com/sound-reference.mp3'],
links: ['https://example.com/public-creative-brief'],
seed: 42
}
웹페이지 대신 참조 파일을 사용하려면 links를 생략하고 files에 URL 하나를 전달합니다.
응답 형식
초기 응답
모든 모델은 폴링에 사용할 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: 비디오 생성 실패
모범 사례
- 프롬프트 지침: 피사체, 동작, 카메라 움직임, 속도감, 환경 및 의도한 사운드를 명확하게 설명하세요.
- 이미지 입력: 요청한 화면 비율과 일치하는 시작, 종료 및 참조 이미지를 사용하세요. PNG 이미지에는 알파 채널이 없어야 합니다.
- 비디오 편집 시간: 두 값의 합이 30초 이내가 되도록 요청할 출력 길이를 선택하기 전에 소스 길이를 확인하세요.
- 참조 제한: 제출하기 전에 각 참조 모음의 개수, 형식, 크기 및 총길이를 검증하세요.
- 파일 및 링크: 참조 파일 하나 또는 공개 웹페이지 링크 하나만 제출하고 동일한 요청에 둘 다 포함하지 마세요.