Seedance 2.0
This guide shows how to generate videos using Seedance 2.0 and Seedance 2.0 Fast models via the Leonardo.AI REST API.
Sample Request
curl --request POST \
--url https://cloud.leonardo.ai/api/rest/v2/generations \
--header 'accept: application/json' \
--header 'authorization: Bearer <YOUR_API_KEY>' \
--header 'content-type: application/json' \
--data '
{
"model": "seedance-2.0",
"public": false,
"parameters": {
"prompt": "A koala plays with a cat in a sunny garden",
"guidances": {
"start_frame": [
{
"image": {
"id": "<YOUR_START_IMAGE_ID>",
"type": "UPLOADED"
}
}
],
"end_frame": [
{
"image": {
"id": "<YOUR_END_IMAGE_ID>",
"type": "GENERATED"
}
}
]
},
"duration": 8,
"mode": "RESOLUTION_720",
"prompt_enhance": "OFF",
"width": 1280,
"height": 720
}
}
'Recipe
API Request Endpoint, Headers, Parameters
Endpoint
https://cloud.leonardo.ai/api/rest/v2/generationsHeaders
--header "accept: application/json" \
--header "authorization: Bearer <YOUR_API_KEY>" \
--header "content-type: application/json"Body Parameters
Both Seedance 2.0 and Seedance 2.0 Fast models share the same parameters.
| Parameter | Type | Definition |
|---|---|---|
| duration | integer | Length of the generated video in seconds. Set to 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, or 15. Defaults to 8. |
| guidances.end_frame | array | Maximum 1 item. Each item includes image.id and image.type (GENERATED or UPLOADED). Only available when start_frame is provided. |
| guidances.image_reference | array | Maximum 4 items. Reference images to guide style and composition. Incompatible with start_frame and end_frame. |
| guidances.start_frame | array | Maximum 1 item. Each item includes image.id and image.type (GENERATED or UPLOADED). |
| guidances.video_reference_base | array | Maximum 3 items. Reference videos to guide motion. Incompatible with start_frame and end_frame. |
| height | integer | Sets the height of the output video in pixels. Set to 0 to automatically use the source image's aspect ratio (image-to-video only). |
| model | string | Specifies the model used for generation. Set to seedance-2.0 or seedance-2.0-fast. |
| mode | string | Resolution tier. Set to RESOLUTION_480 for Standard (480p) or RESOLUTION_720 for HD (720p). Defaults to RESOLUTION_720. |
| motion_has_audio | boolean | When set to true, generates native audio including dialogue, narration, sound effects, and ambient sounds. Defaults to false. |
| prompt | string | Text description of the video content to generate. Maximum of 1500 characters. |
| prompt_enhance | string | Enables or disables prompt enhancement. Automatically disabled when start_frame is set. |
| public | boolean | Controls whether the generated video is public (true) or private (false). |
| quantity | integer | Number of videos to generate. Maximum 1. Defaults to 1. |
| seed | integer | Random seed for reproducibility. Range: 0โ4294967295. Set to -1 for random. Defaults to -1. |
| width | integer | Sets the width of the output video in pixels. Set to 0 to automatically use the source image's aspect ratio (image-to-video only). |
Constraints
Both models share the same constraints.
end_framerequiresstart_frameto also be set.guidances.image_referenceis incompatible withstart_frameandend_frame.guidances.video_reference_baseis incompatible withstart_frameandend_frame.- Setting
start_frameautomatically disablesprompt_enhance.
Dimensions
The API accepts width and height parameters in the following aspect ratio combinations. Both models use the same dimensions, determined by the mode parameter.
For image-to-video, set
width: 0andheight: 0to automatically use the source image's aspect ratio.
| Resolution | Aspect Ratio | (Width x Height) |
|---|---|---|
| 480p | 21:9 | 992x432 |
| 16:9 | 864x496 | |
| 4:3 | 752x560 | |
| 1:1 | 640x640 | |
| 3:4 | 560x752 | |
| 9:16 | 496x864 | |
| 9:21 | 432x992 | |
| 720p (default) | 21:9 | 1470x630 |
| 16:9 | 1280x720 | |
| 4:3 | 1112x834 | |
| 1:1 | 960x960 | |
| 3:4 | 834x1112 | |
| 9:16 | 720x1280 | |
| 9:21 | 630x1470 |
Updated about 5 hours ago
