Vidu Q3 API
เอกสารอ้างอิง API ฉบับสมบูรณ์สำหรับโมเดลสร้างวิดีโอ Vidu Q3 โดย Vidu.
ตัวเลือกโมเดล {#}
API นี้รองรับโมเดลย่อยเจ็ดแบบ:
เปรียบเทียบอย่างรวดเร็ว
Vidu Q3 ข้อความเป็นวิดีโอ (Turbo & Pro)
จุดเชื่อมต่อ
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: 'viduq3-turbo-text-to-video',
prompt: 'A cinematic drone shot over misty mountains at sunrise',
aspect_ratio: '16:9',
resolution: '720p',
duration: 5,
sound: true,
bgm: false,
style: 'general',
seed: 42
})
});
const { data } = await response.json();
const taskId = data.task_id;
Vidu Q3 รูปภาพเป็นวิดีโอ (Turbo & Pro)
พารามิเตอร์คำขอ
จำเป็น
ไม่บังคับ
ตัวอย่างคำขอ
{
model_name: 'viduq3-pro-image-to-video',
image_url: 'https://example.com/image.jpg',
prompt: 'Smooth pan across the scene with natural motion',
aspect_ratio: '16:9',
resolution: '720p',
duration: 5,
sound: true,
bgm: false,
seed: 42
}
Vidu Q3 Start-End Frame (Turbo & Pro)
สร้างวิดีโอที่เปลี่ยนผ่านระหว่างเฟรมเริ่มต้นและเฟรมสิ้นสุด.
พารามิเตอร์คำขอ
จำเป็น
ไม่บังคับ
ตัวอย่างคำขอ
{
model_name: 'viduq3-pro-start-end-frame',
image_url: 'https://example.com/start.jpg',
image_end_url: 'https://example.com/end.jpg',
prompt: 'Smooth transition from day to night with stars appearing',
aspect_ratio: '16:9',
resolution: '720p',
duration: 5,
sound: true,
bgm: false,
seed: 42
}
Vidu Q3 อ้างอิงเป็นวิดีโอ
สร้างวิดีโอจากรูปภาพอ้างอิงที่เรียงลำดับหนึ่งถึงสี่รูป ไม่รองรับอินพุตเสียงอ้างอิงและวิดีโออ้างอิง
พารามิเตอร์คำขอ
จำเป็น
ตัวยึดตำแหน่งอ้างอิง @ (AT)
ฟีเจอร์อ้างอิง @ (AT) เชื่อมโยงรูปภาพอ้างอิงกับพรอมต์ผ่านตัวยึดตำแหน่ง <<<image_N>>> ที่มีหมายเลข โดยเริ่มนับจาก 1 และเรียงตามอาร์เรย์ images
ไม่บังคับ
พารามิเตอร์ที่ไม่รองรับ: โมเดลนี้ไม่รองรับ audios หรือ videos
ตัวอย่างคำขอ
{
model_name: 'viduq3-reference-to-video',
prompt: 'Keep the character from image one and the jacket details from image two while walking through a rainy city',
images: [
'https://example.com/character-reference.jpg',
'https://example.com/outfit-reference.jpg'
],
aspect_ratio: '9:16',
resolution: '1080p',
duration: 8,
sound: true,
seed: 42
}
ตัวอย่างคำขอ Reference-to-Video แบบ @ (AT)
{
model_name: 'viduq3-reference-to-video',
prompt: 'Keep the character from <<<image_1>>> wearing the coat from <<<image_2>>> while entering the rainy city shown in <<<image_3>>>, then return to a close-up of <<<image_1>>>',
images: [
'https://example.com/character-reference.jpg',
'https://example.com/outfit-reference.jpg',
'https://example.com/city-reference.jpg'
],
aspect_ratio: '9:16',
resolution: '1080p',
duration: 8,
sound: true,
seed: 42
}
รูปแบบการตอบกลับ
การตอบกลับเริ่มต้น
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
การตอบกลับจากการ Poll
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: การสร้างวิดีโอล้มเหลว
เวลาประมวลผล
- Turbo: 1-3 นาที
- Pro: 3-6 นาที
แนวทางปฏิบัติที่ดี
- การเลือก tier: ใช้ Turbo สำหรับการวนปรับเร็ว และใช้ Pro สำหรับเอาต์พุตสุดท้าย
- การเขียนพรอมต์: อธิบายทั้งการเคลื่อนไหวของวัตถุและกล้องเพื่อผลลัพธ์ที่ชัดเจนขึ้น
- อินพุตรูปภาพ: ใช้เฟรมต้นฉบับที่ชัดเจนและความละเอียดสูงสำหรับเวิร์กโฟลว์ image-to-video และ start-end
- การวางแผนความละเอียด: เลือก
540p, 720p หรือ 1080p ตามความเร็ว คุณภาพ และงบเครดิต
- รูปภาพอ้างอิง: สำหรับ Reference-to-Video ให้ส่งรูปภาพ 1-4 รูปตามลำดับที่ตั้งใจและอ้างอิงอย่างสม่ำเสมอในพรอมต์
- สื่อที่ไม่รองรับ: อย่าส่ง
audios หรือ videos ไปยังโมเดล Reference-to-Video