Seedance 1.5 Pro API
เอกสารอ้างอิง API ฉบับสมบูรณ์สำหรับโมเดลสร้างวิดีโอ Seedance 1.5 Pro.
ตัวเลือกโมเดล {#}
API นี้รองรับโมเดล 2 ตัวเลือก:
เปรียบเทียบอย่างรวดเร็ว
อัตราส่วนภาพที่รองรับ
21:9, 16:9, 9:16, 1:1, 4:3, 3:4
ตัวเลือกความละเอียด
Seedance 1.5 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: 'seedance-v1.5-pro-text-to-video',
prompt: 'A golden retriever running through a sunlit meadow',
duration: 6,
resolution: '1080p',
aspect_ratio: '16:9'
})
});
const { data } = await response.json();
const taskId = data.task_id;
ตัวอย่างเฉพาะ body พร้อมพารามิเตอร์เสริม:
{
model_name: 'seedance-v1.5-pro-text-to-video',
prompt: 'A golden retriever running through a sunlit meadow',
duration: 6,
resolution: '1080p',
aspect_ratio: '16:9',
sound: true,
camera_fixed: false,
seed: 42
}
Seedance 1.5 Pro รูปภาพเป็นวิดีโอ
พารามิเตอร์คำขอ
จำเป็น
ไม่บังคับ
ตัวอย่างคำขอ
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: 'seedance-v1.5-pro-image-to-video',
image_url: 'https://example.com/image.jpg',
prompt: 'Camera slowly pulls back to reveal the full landscape',
duration: 6,
resolution: '1080p',
aspect_ratio: '16:9'
})
});
const { data } = await response.json();
const taskId = data.task_id;
ตัวอย่างเฉพาะ body:
{
model_name: 'seedance-v1.5-pro-image-to-video',
image_url: 'https://example.com/image.jpg',
prompt: 'Camera slowly pulls back to reveal the full landscape',
duration: 6,
resolution: '1080p',
aspect_ratio: '16:9',
sound: true
}
รูปแบบการตอบกลับ
การตอบกลับเริ่มต้น
ทั้งสองโมเดลส่งคืน task_id สำหรับการ Poll:
{
"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: การสร้างวิดีโอล้มเหลว
เวลาประมวลผล
เวลาประมวลผลโดยทั่วไป: 2-5 นาที ขึ้นอยู่กับระยะเวลาและความละเอียด.
วิดีโอที่ยาวขึ้นที่ 1080p อาจใช้เวลาสูงสุด 8 นาที Poll ทุก 5-10 วินาทีเพื่อตรวจสถานะ.
แนวทางปฏิบัติที่ดี
- อธิบายการเคลื่อนไหวให้ชัดเจน: ใส่คำอธิบายการเคลื่อนไหวเฉพาะในพรอมต์เพื่อผลลัพธ์ที่คาดการณ์ได้มากขึ้น
- การเลือกความละเอียด: ใช้
480p หรือ 720p เพื่อวนปรับเร็วขึ้น และใช้ 1080p สำหรับเอาต์พุตสุดท้าย
- การควบคุมกล้อง: ตั้ง
camera_fixed: true เมื่อต้องการให้วัตถุเป็นจุดโฟกัสโดยไม่มีกล้องเลื่อน
- อัตราส่วนภาพ: จับคู่อัตราส่วนภาพกับแพลตฟอร์มเป้าหมาย (เช่น
9:16 สำหรับมือถือ, 16:9 สำหรับเดสก์ท็อป)
- การทำซ้ำผลลัพธ์: ใช้พารามิเตอร์
seed เพื่อทำซ้ำหรือวนปรับการสร้างเฉพาะรายการ
- คุณภาพรูปภาพ: สำหรับ image-to-video ให้ใช้รูปภาพอินพุตความละเอียดสูงและมีแสงดีเพื่อผลลัพธ์ที่ดีที่สุด