เอกสารอ้างอิง API
ภาพเป็นวิดีโอ
สร้างวิดีโอจากภาพและสื่ออ้างอิงด้วย Seedance 2.0 Open API
ในโหมดนี้ คุณจะส่ง URL ของสื่อสาธารณะอย่างน้อยหนึ่งรายการผ่าน mediaUrls
Endpoint
POST /api/open/v1/video/generationsประเภทสื่ออ้างอิงที่รองรับ
| Type | Common formats | Typical usage |
|---|---|---|
| ภาพ | .jpg, .jpeg, .png, .webp, .gif, .bmp | เฟรมแรก เฟรมสุดท้าย และการอ้างอิงสไตล์ |
| วิดีโอ | .mp4, .mov, .m4v | การอ้างอิงการเคลื่อนไหวและกล้อง |
| เสียง | .mp3, .wav | การอ้างอิงจังหวะหรือ timing |
ตัวอย่างคำขอ
curl --request POST \
--url https://www.seedance2.ink/api/open/v1/video/generations \
--header 'Authorization: Bearer sd2_live_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2.0",
"prompt": "A young woman blows out birthday candles, warm indoor lighting, shallow depth of field",
"mediaUrls": [
"https://example.com/photo.jpg"
],
"aspectRatio": "16:9",
"duration": 5,
"resolution": "720p"
}'ตัวอย่างการตอบกลับสำเร็จ
{
"success": true,
"requestId": "req_1234567890",
"status": "queued",
"creditsCharged": 64
}ฟิลด์คำขอ
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | เลือกได้จาก seedance-2.0, seedance-2.0-fast, seedance-1.5-pro |
prompt | string | Yes | พรอมต์ภาษาธรรมชาติที่อธิบายวิดีโอเป้าหมาย |
mediaUrls | string[] | Yes | URL สื่ออ้างอิงสาธารณะจำนวนหนึ่งถึงห้ารายการ |
aspectRatio | string | No | เลือกได้จาก 16:9, 9:16, 1:1 |
duration | integer | No | seedance-2.0 และ seedance-2.0-fast รองรับ 4-15 วินาที ส่วน seedance-1.5-pro รองรับ 5 หรือ 10 วินาที |
resolution | string | No | เลือกได้จาก 480p, 720p, 1080p |
webhookUrl | string | No | Callback URL สำหรับรับผลลัพธ์สุดท้าย |
metadata | object | No | Metadata แบบกำหนดเองที่บันทึกไปพร้อมกับคำขอ |
ตรวจสอบผลลัพธ์
curl https://www.seedance2.ink/api/open/v1/video/generations/req_1234567890 \
--header 'Authorization: Bearer sd2_live_your_api_key'{
"success": true,
"requestId": "req_1234567890",
"status": "succeeded",
"model": "seedance-2.0",
"prompt": "A river flowing through an autumn forest, aerial view, cinematic motion",
"duration": 5,
"aspectRatio": "16:9",
"output": {
"type": "video",
"url": "https://pub-your-bucket.r2.dev/open-api-results/req_1234567890.mp4"
},
"error": null
}ยกเลิกงาน
curl --request POST \
--url https://www.seedance2.ink/api/open/v1/video/generations/req_1234567890/cancel \
--header 'Authorization: Bearer sd2_live_your_api_key'{
"success": true,
"requestId": "req_1234567890",
"status": "cancelled"
}หมายเหตุ
mediaUrlsรองรับได้สูงสุด5รายการ- โปรดใช้ URL แบบ HTTPS ที่เข้าถึงได้สาธารณะ
- หากไม่ต้องใช้สื่ออ้างอิง ให้ใช้ ข้อความเป็นวิดีโอ