Referencja API
Obraz na wideo
Generuj wideo z obrazow i mediow referencyjnych za pomoca Seedance 2.0 Open API.
W tym trybie przekazujesz jeden lub wiecej publicznych URL-i mediow przez mediaUrls.
Endpoint
POST /api/open/v1/video/generationsObslugiwane typy referencji
| Type | Common formats | Typical usage |
|---|---|---|
| Obraz | .jpg, .jpeg, .png, .webp, .gif, .bmp | Pierwsza klatka, ostatnia klatka, referencja stylu |
| Wideo | .mp4, .mov, .m4v | Referencja ruchu i kamery |
| Audio | .mp3, .wav | Referencja rytmu lub timingu |
Przyklad zapytania
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"
}'Poprawna odpowiedz
{
"success": true,
"requestId": "req_1234567890",
"status": "queued",
"creditsCharged": 64
}Pola requestu
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Jedna z wartosci: seedance-2.0, seedance-2.0-fast, seedance-1.5-pro. |
prompt | string | Yes | Prompt w jezyku naturalnym opisujacy docelowe wideo. |
mediaUrls | string[] | Yes | Od jednego do pieciu publicznie dostepnych URL-i mediow referencyjnych. |
aspectRatio | string | No | Jedna z wartosci: 16:9, 9:16, 1:1. |
duration | integer | No | seedance-2.0 i seedance-2.0-fast obsluguja 4-15 sekund; seedance-1.5-pro obsluguje 5 lub 10 sekund. |
resolution | string | No | Jedna z wartosci: 480p, 720p, 1080p. |
webhookUrl | string | No | URL callbacku, ktory otrzyma koncowy rezultat. |
metadata | object | No | Niestandardowe metadane zapisywane razem z requestem. |
Sprawdzanie wyniku
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
}Anulowanie zadania
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"
}Uwagi
mediaUrlsobsluguje do5elementow.- Uzywaj publicznie dostepnych adresow HTTPS.
- Jesli nie potrzebujesz mediow referencyjnych, uzyj Tekst na wideo.