Generate with Kling 2.6
Guide for generating videos with Kling 2.6 using a start frame
Follow this recipe to generate video using a start frame:
Generate with Kling 2.6 Using Start Frames
Open Recipe
Core Parameters
model- Set to
kling-2.6to use Kling 2.6.
- Set to
prompt- Type: string
- Max length: 1500 characters
- Description: Text description of the video content to generate, can include description of audio
duration- Type: integer
- Valid values: 5 or 10
- Unit: seconds
- Description: Length of the generated video
Dimensions
The API accepts width and height parameters in the following aspect ratio combinations:
| Aspect Ratio | Width | Height |
|---|---|---|
| 16:9 (Landscape) | 1920 | 1080 |
| 1:1 (Square) | 1440 | 1440 |
| 9:16 (Portrait) | 1080 | 1920 |
Guidances
The guidances object contains an optional start frame (image-to-video) configuration.
Note:
- For best results, choose a
start_framethat matches the aspect ratio you want to generate.start_framecan either be uploaded to Leonardo (type: "UPLOADED"), or generated on the platform (type: "GENERATED")
start_frame- Type: array
- Max items: 1
- Items: Each item is an object containing:
image(object):id(string, uuid format)type(enum:"UPLOADED","GENERATED")
Sample Request Using a Start Frame
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": "kling-2.6",
"public": false,
"parameters": {
"prompt": "The woman plays with the cat",
"guidances": {
"start_frame": [
{
"image": {
"id": "<YOUR_START_IMAGE_ID>",
"type": "GENERATED"
}
}
]
},
"duration": 5,
"width": 1080,
"height": 1920
}
}
'
Cost
| Duration | API Credit Cost |
|---|---|
| 5 seconds | 604 API Credits |
| 10 seconds | 1208 API Credits |
Updated about 11 hours ago
