Tạo video Seedance
Tạo tác vụ video Seedance trên CometAPI. Sử dụng prompt văn bản, nội dung tham chiếu hoặc tài sản nhân vật Seedance 2.5 cùng thời lượng và kích thước đầu ra WxH.
curl https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F 'prompt="A matte magenta cube rotates slowly above a cyan studio floor while a small yellow sphere circles it."' \
-F 'model="seedance-2-5"' \
-F 'seconds="4"' \
-F 'size="1280x720"'{
"id": "task_abc123",
"task_id": "task_abc123",
"object": "video",
"model": "doubao-seedance-2-0-mini",
"status": "queued",
"progress": 0,
"created_at": 1776681149
}size thành một giá trị WxH từ bảng kích thước dành cho model của bạn.doubao-seedance-2-0-mini cho Seedance 2.0 Mini.
Giá trị seedance-mini rút gọn không phải là một model ID hợp lệ.Các model ID được hỗ trợ
Chọn một model cho chế độ đầu vào và độ phân giải của bạn, rồi gửi ID chính xác của model đó trong trườngmodel.
| Model | Model ID chính xác | Chế độ và các mức độ phân giải | Được hỗ trợ seconds |
|---|---|---|---|
| Seedance 2.5 | seedance-2-5 | Văn bản sang video, nội dung tham chiếu; 480p, 720p | 4-30 |
| Seedance 2.0 | doubao-seedance-2-0 | Văn bản sang video, nội dung tham chiếu; 480p, 720p, 1080p, 4K | 4-15 |
| Seedance 2.0 Fast | doubao-seedance-2-0-fast | Văn bản sang video, nội dung tham chiếu; 480p, 720p | 4-15 |
| Seedance 2.0 Mini | doubao-seedance-2-0-mini | Văn bản sang video, nội dung tham chiếu; 480p, 720p | 4-15 |
| Seedance 1.5 Pro | doubao-seedance-1-5-pro | Văn bản sang video, hình ảnh sang video; 480p, 720p, 1080p | 4-12 |
| Seedance 1.0 Pro | doubao-seedance-1-0-pro | Văn bản sang video, hình ảnh sang video; 480p, 720p, 1080p | 2-10 |
Sử dụng hình ảnh tham chiếu
GửiPOST /v1/videos dưới dạng multipart/form-data, với hình ảnh tham chiếu trong input_reference.
Đối với nhiều hình ảnh tham chiếu tiêu chuẩn, hãy lặp lại trường theo thứ tự hình ảnh, với một URL hình ảnh HTTPS có thể truy cập công khai hoặc một tệp hình ảnh đã tải lên cho mỗi trường.
Đối với hình ảnh tham chiếu tiêu chuẩn, chỉ sử dụng URL hoặc chỉ sử dụng tệp trong trường này. Gửi riêng từng URL thay vì nối các URL bằng dấu phẩy.
Giữ mỗi hình ảnh đã tải lên ở mức 20 MiB trở xuống (20 × 1024 × 1024 byte).
Seedance 1.0 Pro và 1.5 Pro sử dụng một hình ảnh tham chiếu. Seedance 2.0, Fast và Mini chấp nhận tối đa 9 hình ảnh tham chiếu.
Seedance 2.5 chấp nhận tối đa 30 hình ảnh tham chiếu. Các số lượng này áp dụng cho cả URL và tệp đã tải lên.
Trong Prompt, hãy gán cho mỗi hình ảnh một vai trò, chẳng hạn như chủ thể, bối cảnh hoặc phong cách trực quan.
Mô tả diện mạo cần giữ lại, hành động và chuyển động của máy quay.
Các mẫu request ở đầu trang này minh họa đầu vào URL hình ảnh và nội dung tải lên một hoặc nhiều hình ảnh.
Gửi URL hình ảnh tham chiếu
Sử dụng hai URL hình ảnh để định hướng diện mạo chủ thể và bối cảnh:curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
--form-string 'model=doubao-seedance-2-0' \
--form-string 'prompt=Use the subject in @Image1 and the setting in @Image2. Use a slow camera push-in and natural motion.' \
--form-string 'seconds=5' \
--form-string 'size=1280x720' \
--form-string 'input_reference=https://your-image-host/subject.png' \
--form-string 'input_reference=https://your-image-host/setting.png'
Sử dụng tài sản nhân vật
Hãy tạo và kích hoạt tài sản nhân vật trước khi dùng tài sản đó trong yêu cầu Seedance 2.5. Bắt đầu bằng Tạo nhóm tài sản nhân vật, sau đó tải hình ảnh lên qua Tải lên tài sản nhân vật. Lưu ID tài sản được trả về và chờ đến khi trạng thái làactive.
Dùng ID tài sản với dạng tham chiếu asset://. Đặt tham chiếu tài sản trong input_reference. URL hình ảnh nguồn không được gửi vào yêu cầu video.
curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
--form-string 'model=seedance-2-5' \
--form-string 'prompt=Animate the character in the referenced asset with a slow camera push-in and natural motion.' \
--form-string 'seconds=5' \
--form-string 'size=1280x720' \
--form-string 'input_reference=asset://<ASSET_ID>'
Authorization. Yêu cầu video dùng khóa API CometAPI của bạn với lược đồ Bearer. Nếu tài sản vẫn ở trạng thái processing, failed hoặc không khả dụng, hãy đọc trạng thái tài sản hoặc xử lý tài sản trước khi gửi tác vụ video.
Sử dụng video và âm thanh tham chiếu
Seedance 2.0, Fast, Mini và 2.5 chấp nhậnreference_videos và reference_audios.
Sử dụng tệp MP4 cho video tham chiếu và tệp MP3 cho âm thanh tham chiếu. Gửi từng tệp dưới dạng URL HTTPS có thể truy cập công khai hoặc tệp đã tải lên.
Ghép âm thanh tham chiếu với ít nhất một hình ảnh hoặc video.
Trong prompt, hãy sử dụng @Image1, @Video1 và @Audio1 để gán vai trò cho các tài nguyên tham chiếu.
Đánh số các tài nguyên tham chiếu theo thứ tự của chúng trong từng loại phương tiện.
Bạn có thể kết hợp URL và tệp tải lên trên các trường khác nhau.
Trong từng trường input_reference, reference_videos và reference_audios, chỉ sử dụng toàn bộ URL hoặc toàn bộ tệp.
Đối với nhiều đầu vào, hãy lặp lại trường một lần cho mỗi đầu vào thay vì nối các URL bằng dấu phẩy.
| Dòng model | Hình ảnh tham chiếu | Video tham chiếu | Âm thanh tham chiếu | Tổng số đầu vào tham chiếu |
|---|---|---|---|---|
| Seedance 2.0, Fast và Mini | Tối đa 9 URL hoặc tệp trong input_reference | Tối đa 3 | Tối đa 3 | Tối đa 12 |
| Seedance 2.5 | Tối đa 30 URL hoặc tệp trong input_reference | Tối đa 10 URL hoặc 5 tệp | Tối đa 10 URL hoặc 5 tệp | Tối đa 50 |
doubao-seedance-2-0) có các giới hạn phương tiện bổ sung cho cả URL và tệp đã tải lên.
Đối với video tham chiếu, hãy giữ tổng thời lượng trong khoảng từ 2 đến 15 giây và tổng kích thước dưới 50 MB.
Sử dụng độ phân giải video tham chiếu từ khoảng 480p (640x640) đến 720p (834x1112).
Đối với âm thanh tham chiếu, hãy giữ tổng thời lượng tối đa 15 giây và mỗi tệp tối đa 15 MB.
Phương tiện đã tải lên cũng phải đáp ứng các giới hạn tải lên cho từng tệp nêu trên.
Gửi URL video tham chiếu
Sử dụng video tham chiếu để định hướng chuyển động máy quay và hành động:curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
--form-string 'model=doubao-seedance-2-0' \
--form-string 'prompt=Follow the camera movement and action in @Video1. Preserve the direction and pace of the motion.' \
--form-string 'seconds=5' \
--form-string 'size=1280x720' \
--form-string 'reference_videos=https://your-media-host/reference.mp4'
Ghép URL hình ảnh với âm thanh
Tạo chuyển động cho chủ thể tham chiếu theo nhịp điệu của âm thanh tham chiếu:curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
--form-string 'model=doubao-seedance-2-0' \
--form-string 'prompt=Animate the subject in @Image1 to the rhythm of @Audio1. Preserve the subject appearance and use a fixed camera.' \
--form-string 'seconds=5' \
--form-string 'size=1280x720' \
--form-string 'input_reference=https://your-image-host/subject.png' \
--form-string 'reference_audios=https://your-media-host/reference.mp3'
Tải phương tiện tham chiếu lên bằng Seedance 2.5
Tải lên hai hình ảnh, một video MP4 và một tệp âm thanh MP3 trong một yêu cầu:curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
--form-string 'model=seedance-2-5' \
--form-string 'prompt=Use the subject in @Image1 and the setting in @Image2. Follow the motion in @Video1 and the rhythm of @Audio1.' \
--form-string 'seconds=5' \
--form-string 'size=1280x720' \
--form 'input_reference=@/path/to/subject.png;type=image/png' \
--form 'input_reference=@/path/to/setting.png;type=image/png' \
--form 'reference_videos=@/path/to/reference.mp4;type=video/mp4' \
--form 'reference_audios=@/path/to/reference.mp3;type=audio/mpeg'
Thời lượng theo model
Đặtseconds thành một giá trị số nguyên trong phạm vi của model. Nếu bỏ qua, CometAPI sẽ yêu cầu một đoạn clip dài 5 giây.
| Nhóm model | Được hỗ trợ seconds | Mặc định | Hành vi ở giới hạn |
|---|---|---|---|
| Seedance 2.5 | 4-30 | 5 | Sử dụng số giây nguyên trong phạm vi. |
| Seedance 2.0, Seedance 2.0 Fast và Seedance 2.0 Mini | 4-15 | 5 | Sử dụng số giây nguyên trong phạm vi. |
| Seedance 1.5 Pro | 4-12 | 5 | Sử dụng số giây nguyên trong phạm vi. |
| Seedance 1.0 Pro | 2-10 | 5 | Sử dụng số giây nguyên trong phạm vi. |
Hỗ trợ kích thước theo model
Seedance 2.5
Đối với Seedance 2.5, các giá trịWxH này áp dụng cho cả Prompt văn bản và nội dung tham chiếu.
| Nhóm độ phân giải | 16:9 | 4:3 | 1:1 | 3:4 | 9:16 | 21:9 |
|---|---|---|---|---|---|---|
480p | 854x480 | 752x560 | 640x640 | 560x752 | 480x854 | 992x432 |
720p | 1280x720 | 1112x834 | 960x960 | 834x1112 | 720x1280 | 1470x630 |
Các model Seedance trước đó
Cột cuối cùng nhóm các giá trịWxH chính xác cho Seedance 1.5 Pro, Seedance 2.0 tiêu chuẩn và Fast.
Seedance 2.0 Fast chỉ sử dụng các giá trị 480p và 720p trong cột đó.
Các giá trị 1080p trong cột đó áp dụng cho Seedance 1.5 Pro và Seedance 2.0 tiêu chuẩn.
Các giá trị 4K chỉ áp dụng cho Seedance 2.0 tiêu chuẩn. Trong cột Mini, — nghĩa là độ phân giải không được hỗ trợ.
| Nhóm độ phân giải | Tỷ lệ khung hình | Seedance 2.0 Mini | Dòng Seedance 1.0 | Seedance 1.5 Pro / Seedance 2.0 tiêu chuẩn / Fast |
|---|---|---|---|---|
480p | 16:9 | 864x496 | 864x480 | 864x496 |
4:3 | 752x560 | 736x544 | 752x560 | |
1:1 | 640x640 | 640x640 | 640x640 | |
3:4 | 560x752 | 544x736 | 560x752 | |
9:16 | 496x864 | 480x864 | 496x864 | |
21:9 | 992x432 | 960x416 | 992x432 | |
720p | 16:9 | 1280x720 | 1248x704 | 1280x720 |
4:3 | 1112x834 | 1120x832 | 1112x834 | |
1:1 | 960x960 | 960x960 | 960x960 | |
3:4 | 834x1112 | 832x1120 | 834x1112 | |
9:16 | 720x1280 | 704x1248 | 720x1280 | |
21:9 | 1470x630 | 1504x640 | 1470x630 | |
1080p | 16:9 | — | 1920x1088 | 1920x1080 |
4:3 | — | 1664x1248 | 1664x1248 | |
1:1 | — | 1440x1440 | 1440x1440 | |
3:4 | — | 1248x1664 | 1248x1664 | |
9:16 | — | 1088x1920 | 1080x1920 | |
21:9 | — | 2176x928 | 2206x946 | |
4K | 16:9 | — | — | 3840x2160 (Chỉ Seedance 2.0) |
4:3 | — | — | 3326x2494 (Chỉ Seedance 2.0) | |
1:1 | — | — | 2880x2880 (Chỉ Seedance 2.0) | |
3:4 | — | — | 2494x3326 (Chỉ Seedance 2.0) | |
9:16 | — | — | 2160x3840 (Chỉ Seedance 2.0) | |
21:9 | — | — | 4398x1886 (Chỉ Seedance 2.0) |
480p và 720p. Đặt size thành một giá trị WxH từ cột Mini.Nội dung
Text prompt that describes the video. Required. When using reference images, describe what each image should control, such as the subject from @Image1, the secondary object from @Image2, and the background or style from @Image3. Also state the action, camera motion, visual style, and scene.
"A slow cinematic camera push across a coastal landscape at sunrise."
Seedance model ID. Use one of the exact values below. Aliases such as seedance-mini are not accepted.
seedance-2-5, doubao-seedance-2-0, doubao-seedance-2-0-fast, doubao-seedance-2-0-mini, doubao-seedance-1-5-pro, doubao-seedance-1-0-pro "doubao-seedance-2-0-mini"
Output size as an exact WxH value. For Seedance 2.5 text-to-video and image-to-video, use 854x480, 752x560, 640x640, 560x752, 480x854, or 992x432 for 480p; use 1280x720, 1112x834, 960x960, 834x1112, 720x1280, or 1470x630 for 720p. For Seedance 2.0 Mini, use 864x496, 752x560, 640x640, 560x752, 496x864, or 992x432 for 480p; use the same documented 720p values. The standard Seedance 2.0 model also accepts its documented 4K values.
^[1-9]\d{2,3}x[1-9]\d{2,3}$"854x480"
"480x854"
"864x496"
"752x560"
"640x640"
"560x752"
"496x864"
"992x432"
"1280x720"
"1112x834"
"960x960"
"834x1112"
"720x1280"
"1470x630"
"1920x1080"
"1080x1920"
"3840x2160"
"3326x2494"
"2880x2880"
"2494x3326"
"2160x3840"
"4398x1886"
Reference images or a CometAPI character asset. Repeat input_reference with one publicly accessible HTTPS image URL, one uploaded image file, or one asset:// reference per field. Use only URLs, asset references, or files within a request. Keep each uploaded image at or below 20 MiB. Seedance 2.0, Fast, and Mini allow up to nine image URLs or files and 12 reference inputs in total. Seedance 2.5 allows up to 30 image URLs or files and 50 reference inputs in total. For Seedance 1.0 Pro and 1.5 Pro, send one URL or one file. Submit images in the order you want to reference them in the prompt.
^https://Reference video inputs for Seedance 2.0, Fast, Mini, and 2.5. Repeat reference_videos with a publicly accessible HTTPS MP4 URL or an uploaded MP4 file. Use only URLs or only files within this field. Each file can be up to 50 MiB. Seedance 2.0, Fast, and Mini allow up to three video inputs and 12 reference inputs in total. Seedance 2.5 allows up to ten video URLs or five uploaded video files, with 50 reference inputs in total. For standard Seedance 2.0 (doubao-seedance-2-0), URL and uploaded references must have a combined video duration of 2 to 15 seconds and a total video size under 50 MB. Each reference video must have a resolution of approximately 480p (640x640) to 720p (834x1112). These media limits apply in addition to the 50 MiB per-file upload limit.
1 - 10 elements^https://"https://your-media-host/reference.mp4"
Reference audio inputs for Seedance 2.0, Fast, Mini, and 2.5. Repeat reference_audios with a publicly accessible HTTPS MP3 URL or an uploaded MP3 file. Use only URLs or only files within this field. Each file can be up to 15 MiB. Seedance 2.0, Fast, and Mini allow up to three audio inputs and 12 reference inputs in total. Seedance 2.5 allows up to ten audio URLs or five uploaded audio files, with 50 reference inputs in total. Pair audio with at least one reference image or video. For standard Seedance 2.0 (doubao-seedance-2-0), URL and uploaded audio references must have a combined duration at or below 15 seconds, with each audio file at or below 15 MB. These media limits apply in addition to the 15 MiB per-file upload limit.
1 - 10 elements^https://"https://your-media-host/reference.mp3"
Phản hồi
Task created. Save the returned id and poll GET /v1/videos/{id}.
curl https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F 'prompt="A matte magenta cube rotates slowly above a cyan studio floor while a small yellow sphere circles it."' \
-F 'model="seedance-2-5"' \
-F 'seconds="4"' \
-F 'size="1280x720"'{
"id": "task_abc123",
"task_id": "task_abc123",
"object": "video",
"model": "doubao-seedance-2-0-mini",
"status": "queued",
"progress": 0,
"created_at": 1776681149
}