API Pixverse C1
เอกสารอ้างอิง API ฉบับสมบูรณ์สำหรับโมเดลสร้างวิดีโอ Pixverse C1 ทุกตัวแปรใช้ endpoint งานวิดีโอแบบรวมเดียวกัน
ตัวแปรของโมเดล {#}
เปรียบเทียบอย่างรวดเร็ว
โมเดล text-to-video รองรับอัตราส่วนภาพ: 21:9, 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3.
Pixverse C1 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-c1-text-to-video',
prompt: 'A drone shot over coastline at golden hour',
duration: 5,
resolution: '720p',
aspect_ratio: '16:9',
sound: true,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
Pixverse C1 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-c1-image-to-video',
prompt: 'Slow zoom in; soft natural motion',
duration: 5,
resolution: '720p',
image_url: 'https://example.com/first-frame.jpg',
sound: false,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
Pixverse C1 Transition
สร้างการเคลื่อนไหวระหว่างภาพ keyframe แรก และ สุดท้าย.
พารามิเตอร์คำขอ
จำเป็น
ไม่บังคับ
ตัวอย่างคำขอ
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-c1-transition',
prompt: 'Smooth cinematic morph between the two scenes',
duration: 6,
resolution: '720p',
image_url: 'https://example.com/start.jpg',
image_end_url: 'https://example.com/end.jpg',
sound: true,
}),
});
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: สร้างวิดีโอล้มเหลว
แนวทางปฏิบัติที่ดี
- ความละเอียด: ใช้
720p หรือ 1080p เพื่อสมดุลระหว่างคุณภาพและเวลาสร้าง; ใช้ 360p หรือ 540p เพื่อการทำซ้ำที่เร็วขึ้น.
- ทรานซิชัน: ใช้เฟรมแรกและเฟรมสุดท้ายที่คมชัด มีแสงดี เพื่อให้โมเดลแทรกการเคลื่อนไหวได้อย่างน่าเชื่อถือ.
- เสียง: ตั้งค่า
sound เมื่อคุณต้องการเสียงบรรยากาศที่ซิงโครไนซ์; เว้นไว้หรือตั้งเป็น false สำหรับเอาต์พุตแบบไม่มีเสียง.
- Polling: Poll ทุก 5–10 วินาทีจนกว่า
task_status จะเป็น succeed หรือ failed.