Seedance 2.0
Seedance 2.0
Tai lieuBat dau
Tong quan APIVan ban thanh videoHinh anh thanh video
Tai lieu tham khao API

Hinh anh thanh video

Tao video tu hinh anh va media tham chieu voi Seedance 2.0 Open API.

Trong che do nay, ban gui mot hoac nhieu URL media cong khai qua mediaUrls.

Endpoint

POST /api/open/v1/video/generations

Loai tham chieu duoc ho tro

TypeCommon formatsTypical usage
Hinh anh.jpg, .jpeg, .png, .webp, .gif, .bmpKhung hinh dau, khung hinh cuoi, tham chieu phong cach
Video.mp4, .mov, .m4vTham chieu chuyen dong va camera
Am thanh.mp3, .wavTham chieu nhip dieu hoac timing

Vi du request

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"
  }'

Response thanh cong

{
  "success": true,
  "requestId": "req_1234567890",
  "status": "queued",
  "creditsCharged": 64
}

Truong request

FieldTypeRequiredDescription
modelstringYesMot trong cac gia tri seedance-2.0, seedance-2.0-fast, seedance-1.5-pro.
promptstringYesPrompt ngon ngu tu nhien mo ta video muc tieu.
mediaUrlsstring[]YesTu mot den nam URL media tham chieu cong khai.
aspectRatiostringNoMot trong cac gia tri 16:9, 9:16, 1:1.
durationintegerNoseedance-2.0 va seedance-2.0-fast ho tro 4-15 giay; seedance-1.5-pro ho tro 5 hoac 10 giay.
resolutionstringNoMot trong cac gia tri 480p, 720p, 1080p.
webhookUrlstringNoCallback URL nhan ket qua cuoi cung.
metadataobjectNoMetadata tuy chinh duoc luu cung voi request.

Kiem tra ket qua

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
}

Huy job

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"
}

Luu y

  • mediaUrls ho tro toi da 5 muc.
  • Hay su dung URL HTTPS cong khai co the truy cap duoc.
  • Neu khong can media tham chieu, hay dung Van ban thanh video.

Van ban thanh video

Tao video tu prompt van ban voi Seedance 2.0 Open API.

Start

Kế tiếp

Mục lục

EndpointLoai tham chieu duoc ho troVi du requestResponse thanh congTruong requestKiem tra ket quaHuy jobLuu y