Wan 2.7 API
Alibaba의 Wan 2.7 비디오 생성 모델에 대한 완전한 API 레퍼런스입니다.
모델 변형
이 API는 네 가지 모델 변형을 지원합니다:
빠른 비교
Wan 2.7 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.7-text-to-video',
prompt: 'A cat playing with a ball of yarn in a sunlit room',
duration: 6,
resolution: '720p',
aspect_ratio: '16:9',
negative_prompt: 'blur, low quality',
seed: 42
})
});
const { data } = await response.json();
const taskId = data.task_id;
Wan 2.7 Image to Video
요청 매개변수
필수
선택 사항
요청 예시
{
model_name: 'wan-2.7-image-to-video',
image_url: 'https://example.com/first-frame.jpg',
image_end_url: 'https://example.com/last-frame.jpg',
video_url: 'https://example.com/reference-continuation.mp4',
audio_url: 'https://example.com/driving-audio.mp3',
prompt: 'Gentle camera push-in; leaves rustle softly in the breeze',
duration: 6,
resolution: '720p',
negative_prompt: 'blur, low quality',
seed: 42
}
Wan 2.7 Video Edit
요청 매개변수
필수
선택 사항
요청 예시
{
model_name: 'wan-2.7-video-edit',
prompt: 'Replace the sky with warm sunset colors, keep subjects natural',
negative_prompt: 'artifacts, flicker',
seed: 42,
video_url: 'https://example.com/source.mp4',
images: ['https://example.com/ref-a.jpg', 'https://example.com/ref-b.jpg'],
audio_setting: 'auto'
}
Wan 2.7 Reference to Video
순서가 지정된 이미지 및 비디오 참조로 새 비디오를 생성하고, 선택적으로 하나의 오디오 클립에서 음성 안내를 받을 수 있습니다.
요청 매개변수
필수
참조 미디어
참조 이미지 또는 참조 비디오가 하나 이상 필요합니다. images와 videos의 항목 수는 합계 5개를 초과할 수 없습니다.
선택 사항
@ (AT) 참조 플레이스홀더
@ (AT) 참조 기능은 번호가 지정된 <<<...>>> 플레이스홀더를 통해 참조 미디어를 프롬프트에 연결합니다. 번호는 미디어 유형별로 독립적으로 1부터 시작하며 해당 배열의 순서를 따릅니다.
요청 예시
{
model_name: 'wan-2.7-reference-to-video',
prompt: 'Use image one for the hero and video one for the motion; keep the hero voice consistent with audio one',
resolution: '1080p',
duration: 8,
aspect_ratio: '16:9',
images: ['https://example.com/hero-reference.jpg'],
videos: ['https://example.com/motion-reference.mp4'],
audios: ['https://example.com/voice-reference.mp3'],
negative_prompt: 'flicker, distorted hands, duplicate subjects',
seed: 42
}
@ (AT) Reference-to-Video 요청 예시
{
model_name: 'wan-2.7-reference-to-video',
prompt: 'Place the presenter from <<<image_1>>> in the studio from <<<image_2>>>, follow the camera path in <<<video_1>>>, and use the reference voice from <<<audio_1>>>',
resolution: '1080p',
duration: 8,
aspect_ratio: '16:9',
images: [
'https://example.com/presenter-reference.jpg',
'https://example.com/studio-reference.jpg'
],
videos: ['https://example.com/camera-path-reference.mp4'],
audios: ['https://example.com/voice-reference.mp3'],
negative_prompt: 'flicker, distorted hands, duplicate subjects',
seed: 42
}
응답 형식
초기 응답
모든 모델은 폴링을 위한 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분.
1080p에서 긴 비디오(10-15초)는 최대 8분이 소요될 수 있습니다.
모범 사례
- 장면 및 모션 설명: 프롬프트에 장면 내용과 카메라 움직임을 모두 포함하세요
- 해상도 선택: 빠른 처리를 위해서는 720p, 최고 품질을 위해서는 1080p를 사용하세요
- 재생 시간 계획: 긴 비디오는 비용이 더 많이 듭니다(초당 가격 책정)
- 오디오 통합:
audio_url 매개변수를 통해 사용자 정의 오디오를 추가하세요
- 이미지 품질: 이미지-비디오 변환의 경우, 최상의 결과를 위해 고품질 입력 이미지를 사용하세요
- 비디오 편집 프롬프트: 변경할 내용과 유지할 내용을 구체적으로 명시하세요
- 참조 에셋 수: Reference-to-Video에서는
images와 videos의 합계를 5개 이하로 유지하세요
- 참조 음성:
audios는 음성 정체성 안내에만 사용하고 원하는 발화 내용은 프롬프트에 설명하세요