API Pixverse V6
Tài liệu tham chiếu API đầy đủ cho các mô hình tạo video Pixverse V6. Tất cả biến thể đều dùng endpoint tác vụ video thống nhất.
Biến thể mô hình
So sánh nhanh
Các mô hình text-to-video hỗ trợ tỷ lệ khung hình: 21:9, 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3.
Pixverse V6 Text to Video
Endpoint
POST /api/v1/video/task
Tham số yêu cầu
Bắt buộc
Tùy chọn
Ví dụ yêu cầu
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: 'pixverse-v6-text-to-video',
prompt: 'A cinematic street scene at night with neon reflections',
duration: 8,
resolution: '1080p',
aspect_ratio: '16:9',
sound: true,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
Pixverse V6 Image to Video
Tham số yêu cầu
Bắt buộc
Tùy chọn
Ví dụ yêu cầu
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: 'pixverse-v6-image-to-video',
prompt: 'Fluid camera pan; maintain subject identity',
duration: 6,
resolution: '720p',
image_url: 'https://example.com/first-frame.jpg',
sound: true,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
Pixverse V6 Transition
Tạo chuyển động giữa ảnh keyframe đầu tiên và cuối cùng. Hỗ trợ negative prompting và seeding tùy chọn.
Tham số yêu cầu
Bắt buộc
Tùy chọn
Ví dụ yêu cầu
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: 'pixverse-v6-transition',
prompt: 'Seamless blend with natural lighting continuity',
duration: 6,
resolution: '720p',
image_url: 'https://example.com/start.jpg',
image_end_url: 'https://example.com/end.jpg',
sound: true,
negative_prompt: 'blur, watermark, text overlay',
seed: 0,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
Pixverse V6 Extend
Tiếp tục một clip hiện có. Cung cấp URL video nguồn và prompt mô tả câu chuyện nên tiến triển như thế nào.
Tham số yêu cầu
Bắt buộc
Tùy chọn
Ví dụ yêu cầu
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: 'pixverse-v6-extend',
prompt: 'Continue the walk into the forest clearing',
duration: 5,
resolution: '720p',
video_url: 'https://example.com/source-clip.mp4',
sound: false,
negative_prompt: 'low quality, jitter',
seed: 0,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
Định dạng phản hồi
Phản hồi ban đầu
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
Phản hồi polling
Poll GET /api/v1/video/{taskId} để kiểm tra trạng thái:
{
"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"
}
]
}
}
}
Giá trị trạng thái
submitted: Tác vụ đã được chấp nhận và đang chờ xử lý
processing: Đang tạo video
succeed: Tạo video đã hoàn tất
failed: Tạo video thất bại
Thực hành tốt nhất
- Extend: Dùng video nguồn sạch và ổn định để mô hình có thể tiếp tục chuyển động mà không tạo lỗi hình ảnh.
- Transition: Kết hợp
negative_prompt với seed khi bạn cần các bài kiểm thử chuyển tiếp có thể lặp lại.
- Độ phân giải: Khớp
resolution với mục tiêu phân phối của bạn; độ phân giải cao hơn sẽ mất nhiều thời gian xử lý hơn.
- Polling: Poll mỗi 5–10 giây cho đến khi
task_status là succeed hoặc failed.