Seedance 2.0 API
เอกสารอ้างอิง API ฉบับสมบูรณ์สำหรับโมเดลสร้างวิดีโอ Seedance 2.0 โดย ByteDance.
ตัวเลือกโมเดล {#}
API นี้รองรับ model variants 6 แบบ:
เปรียบเทียบอย่างรวดเร็ว
อัตราส่วนภาพที่รองรับ
21:9, 16:9, 9:16, 1:1, 4:3, 3:4
ตัวเลือกความละเอียด
Seedance 2.0 ข้อความเป็นวิดีโอ
จุดเชื่อมต่อ
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-v2.0-text-to-video',
prompt: 'A golden retriever running through a sunlit meadow',
duration: 6,
resolution: '720p',
aspect_ratio: '16:9'
})
});
const { data } = await response.json();
const taskId = data.task_id;
Seedance 2.0 รูปภาพเป็นวิดีโอ
พารามิเตอร์คำขอ
จำเป็น
ไม่บังคับ
ตัวอย่างคำขอ
{
model_name: 'seedance-v2.0-image-to-video',
image_url: 'https://example.com/image.jpg',
image_end_url: 'https://example.com/end-frame.jpg',
prompt: 'Camera slowly pulls back to reveal the full landscape',
duration: 6,
resolution: '720p',
aspect_ratio: '16:9'
}
Seedance 2.0 อ้างอิงเป็นวิดีโอ
พารามิเตอร์คำขอ
จำเป็น
สื่ออ้างอิง
ส่งรูปภาพ 1-9 รูป สามารถละรูปภาพได้เฉพาะเมื่อมีวิดีโออ้างอิงอย่างน้อยหนึ่งรายการ
ตัวยึดตำแหน่งอ้างอิง @ (AT)
ฟีเจอร์อ้างอิง @ (AT) เชื่อมโยงสื่ออ้างอิงกับพรอมต์ผ่านตัวยึดตำแหน่ง <<<...>>> ที่มีหมายเลข หมายเลขเริ่มจาก 1 แยกกันสำหรับสื่อแต่ละประเภทและเรียงตามอาร์เรย์ที่เกี่ยวข้อง:
ตัวอย่างเช่น หากรูปแรกเป็นข้อมูลอ้างอิงตัวละครและรูปที่สองเป็นข้อมูลอ้างอิงฉาก ให้ใช้ <<<image_1>>> สำหรับตัวละครและ <<<image_2>>> สำหรับฉากใน prompt ตัวยึดตำแหน่งแต่ละรายการต้องชี้ไปยังรายการที่มีอยู่ในอาร์เรย์ที่เกี่ยวข้อง
ไม่บังคับ
ตัวอย่างคำขอ
{
model_name: 'seedance-v2.0-reference-to-video',
prompt: 'Use image one for the subject, video one for the movement, and audio one for the atmosphere',
duration: 8,
resolution: '1080p',
aspect_ratio: '16:9',
sound: true,
images: ['https://example.com/subject-reference.jpg'],
videos: ['https://example.com/motion-reference.mp4'],
audios: ['https://example.com/atmosphere-reference.mp3']
}
ตัวอย่างคำขอ Reference-to-Video แบบ @ (AT)
{
model_name: 'seedance-v2.0-reference-to-video',
prompt: 'Place the explorer from <<<image_1>>> in the environment from <<<image_2>>>, following the camera movement in <<<video_1>>> and speaking with the reference voice from <<<audio_1>>>',
duration: 8,
resolution: '1080p',
aspect_ratio: '16:9',
sound: true,
images: [
'https://example.com/explorer-reference.jpg',
'https://example.com/environment-reference.jpg'
],
videos: ['https://example.com/camera-movement-reference.mp4'],
audios: ['https://example.com/voice-reference.mp3']
}
ตัวเลือกแบบเร็ว
รุ่น Fast ให้ความสำคัญกับความเร็วในการประมวลผล โดยรองรับเอาต์พุตเฉพาะ "480p" และ "720p" เท่านั้น Fast Text-to-Video และ Fast Image-to-Video ใช้รูปแบบคำขอมาตรฐานที่เกี่ยวข้องในส่วนอื่น ๆ ส่วน Fast Reference-to-Video ใช้ข้อจำกัดสื่ออ้างอิงเดียวกับโมเดลมาตรฐาน
ตัวอย่างคำขอแบบเร็ว
{
model_name: 'seedance-v2.0-fast-reference-to-video',
prompt: 'Use image one for the subject, follow the movement from video one, and use audio one for the atmosphere',
duration: 8,
resolution: '720p',
aspect_ratio: '9:16',
sound: true,
images: ['https://example.com/subject-reference.jpg'],
videos: ['https://example.com/motion-reference.mp4'],
audios: ['https://example.com/atmosphere-reference.mp3']
}
ตัวอย่างคำขอ Fast Reference-to-Video แบบ @ (AT)
{
model_name: 'seedance-v2.0-fast-reference-to-video',
prompt: 'Have the dancer from <<<image_1>>> perform the movement from <<<video_1>>> on the stage in <<<image_2>>>, using the rhythm from <<<audio_1>>>',
duration: 8,
resolution: '720p',
aspect_ratio: '9:16',
sound: true,
images: [
'https://example.com/dancer-reference.jpg',
'https://example.com/stage-reference.jpg'
],
videos: ['https://example.com/dance-movement-reference.mp4'],
audios: ['https://example.com/rhythm-reference.mp3']
}
พารามิเตอร์ Seedance 2.0 Fast Reference-to-Video
จำเป็น
สื่ออ้างอิง
หลักการใช้ตัวยึดตำแหน่งที่เริ่มนับจาก 1 ข้างต้นใช้กับโมเดล Fast Reference-to-Video เช่นกัน
ไม่บังคับ
รูปแบบการตอบกลับ
การตอบกลับเริ่มต้น
ทุกโมเดลจะส่งคืน 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: การสร้างวิดีโอล้มเหลว
เวลาประมวลผล
โมเดล Standard: 3-8 นาที ขึ้นอยู่กับระยะเวลาและความละเอียด.
โมเดล Fast: 1-4 นาทีสำหรับการกำหนดค่าส่วนใหญ่.
Poll ทุก 5-10 วินาทีเพื่อตรวจสถานะ.
แนวทางปฏิบัติที่ดี
- เลือก variant ให้เหมาะ: ใช้โมเดล fast สำหรับการวนปรับ และใช้โมเดล standard สำหรับเอาต์พุตสุดท้าย
- อธิบายการเคลื่อนไหวให้ชัดเจน: ใส่คำอธิบายการเคลื่อนไหวเฉพาะในพรอมต์
- การเลือกความละเอียด: ใช้
480p เพื่อประมวลผลเร็วขึ้น และ 720p เพื่อคุณภาพสูงสุดที่มี
- การควบคุมกล้อง: ตั้ง
camera_fixed: true เมื่อต้องการมุมกล้องคงที่
- วิดีโอ reference: สำหรับ reference-to-video ให้ใช้วิดีโอ reference ที่ชัดเจนและคุณภาพสูงเมื่อต้องการนำทางการเคลื่อนไหวหรือสไตล์
- การทำซ้ำผลลัพธ์: ใช้พารามิเตอร์
seed เพื่อทำซ้ำการสร้างเฉพาะรายการ
- การเสริมเสียง: เปิดใช้
sound เพื่อประสบการณ์วิดีโอที่สมจริงขึ้น