LTX 2.0
This guide shows how to generate videos using LTX Video 2.0 models via the Leonardo.AI REST API.
This guide shows how to generate videos using LTX Video 2.0 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": "ltxv-2.0-pro",
"public": false,
"parameters": {
"prompt": "A cinematic shot of rain falling on a quiet city street at night",
"start_frame": {
"id": "<YOUR_START_IMAGE_ID>",
"type": "UPLOADED"
},
"mode": "RESOLUTION_1080",
"prompt_enhance": "OFF",
"quantity": 1,
"duration": 8,
"seed": 453560,
"width": 1920,
"height": 1080,
"audio": true
}
}'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
| Parameter | Type | Definition |
|---|---|---|
| model | string | Specifies the model used for generation. Set to ltxv-2.0-pro or ltxv-2.0-fast. |
| public | boolean | Controls whether the generated video is public (true) or private (false) |
| prompt | string | Text description of the video content to generate. |
| prompt_enhance | string | Controls whether prompt enhancement is applied. Set to ON or OFF. Default is OFF |
| quantity | number | Number of videos to generate per request. |
| duration | number | Length of the generated video in seconds. Set to 6 or 8 |
| seed | number | Optional. Seed value for reproducible generation. |
| width | number | Sets the width of the video in pixels. |
| height | number | Sets the height of the video in pixels. |
| start_frame.id | string | Optional. The ID of the image to use as the starting frame. If omitted, the generation will be text-to-video only. |
| start_frame.type | string | Optional. The source type of the start frame image. Set to GENERATED or UPLOADED. Required when start_frame.id is provided. |
Dimensions
The API accepts width and height parameters in the following aspect ratio combinations:
| Resolution | Aspect Ratio | Pixel Values (Width x Height) |
|---|---|---|
| 1080p | 16:9 | 1920 ร 1080 |
| 1440p | 16:9 | 2560 ร 1440 |
| 2160p | 16:9 | 3840 ร 2160 |
Note: When width and heightare not specified, and guidances.start_frame is specified, the generation will base the dimensions on the guidances.start_frame image.
Updated about 9 hours ago
