API 參考
圖生影片
使用 Seedance 2.0 Open API 透過圖片與參考素材生成影片。
在這個模式下,你需要透過 mediaUrls 傳入一個或多個公開可訪問的素材地址。
Endpoint
POST /api/open/v1/video/generations支援的參考素材類型
| Type | Common formats | Typical usage |
|---|---|---|
| 圖片 | .jpg, .jpeg, .png, .webp, .gif, .bmp | 首幀、尾幀、風格參考 |
| 影片 | .mp4, .mov, .m4v | 動作與鏡頭運動參考 |
| 音訊 | .mp3, .wav | 節奏或時序參考 |
請求示例
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 | 一到五個公開可訪問的參考素材地址。 |
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 | 任務完成後接收回調通知的地址。 |
metadata | object | No | 與本次請求一同保存的自訂資料。 |
查詢結果
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個素材地址。- 建議使用公開可訪問的 HTTPS 連結。
- 若不需要參考素材,請直接使用 文生影片。