API Pixverse V6
เอกสารอ้างอิง API ฉบับสมบูรณ์สำหรับโมเดลสร้างวิดีโอ Pixverse V6 ทุกตัวแปรใช้ endpoint งานวิดีโอแบบรวมเดียวกัน
ตัวแปรของโมเดล {#}
เปรียบเทียบอย่างรวดเร็ว
โมเดล text-to-video รองรับอัตราส่วนภาพ: 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
พารามิเตอร์คำขอ
จำเป็น
ไม่บังคับ
ตัวอย่างคำขอ
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
พารามิเตอร์คำขอ
จำเป็น
ไม่บังคับ
ตัวอย่างคำขอ
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
สร้างการเคลื่อนไหวระหว่างภาพ keyframe แรก และ สุดท้าย รองรับ negative prompting และ seeding แบบไม่บังคับ.
พารามิเตอร์คำขอ
จำเป็น
ไม่บังคับ
ตัวอย่างคำขอ
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
ต่อคลิปที่มีอยู่ ให้ URL วิดีโอต้นทางและพรอมต์ที่อธิบายว่าเรื่องราวควรดำเนินต่ออย่างไร.
พารามิเตอร์คำขอ
จำเป็น
ไม่บังคับ
ตัวอย่างคำขอ
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;
รูปแบบการตอบกลับ
การตอบกลับเริ่มต้น
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
การตอบกลับจากการ Polling
Poll 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: สร้างวิดีโอล้มเหลว
แนวทางปฏิบัติที่ดี
- Extend: ใช้วิดีโอต้นทางที่สะอาดและนิ่ง เพื่อให้โมเดลดำเนินการเคลื่อนไหวต่อได้โดยไม่มี artefacts.
- Transition: ใช้
negative_prompt คู่กับ seed เมื่อคุณต้องการทดสอบทรานซิชันที่ทำซ้ำได้.
- ความละเอียด: จับคู่
resolution กับเป้าหมายการส่งมอบของคุณ; ความละเอียดสูงกว่าจะใช้เวลาประมวลผลนานขึ้น.
- Polling: Poll ทุก 5–10 วินาทีจนกว่า
task_status จะเป็น succeed หรือ failed.