LTX 2.3
This guide shows how to generate videos using LTX Video 2.3 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 '{
"request": {
"model": "ltxv-2.3-pro",
"public": false,
"parameters": {
"prompt": "<Your_PROMPT>",
"mode": "RESOLUTION_1080",
"prompt_enhance": "AUTO",
"quantity": 1,
"duration": 8,
"audio": true,
"width": 1920,
"height": 1080,
"guidances": {
"start_frame": [
{
"image": {
"id": "<YOUR_START_IMAGE_ID>",
"type": "GENERATED"
}
}
],
"end_frame": [
{
"image": {
"id": "<YOUR_END_IMAGE_ID>",
"type": "UPLOADED"
]
}
}
}'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.3-pro or ltxv-2.3-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, OFF, or AUTO. |
| quantity | number | Number of videos to generate per request. Max 1. |
| duration | number | Length of the generated video in seconds. Pro: 6, 8, 10 (default: 8). Fast: 6, 8, 10, 12, 14, 16, 18, 20 (default: 8). |
| seed | number | Optional. Seed value for reproducible generation. |
| width | number | Sets the width of the video in pixels. Default 1920. |
| height | number | Sets the height of the video in pixels. Default 1080. Set width: 1080, height: 1920 for 9:16 portrait. |
| mode | string | Resolution tier. Set to RESOLUTION_1080 (default), RESOLUTION_1440, or RESOLUTION_2160. |
| motion_has_audio | boolean | Whether to generate audio for the video. Default true. |
| guidances.start_frame | array | Optional. Single image to use as the starting frame (image-to-video). Max 1 item. |
| guidances.end_frame | array | Optional. Single image to use as the ending frame (transition video). Requires start_frame to also be set. Max 1 item. |
Dimensions
The API accepts width and height parameters in the following aspect ratio combinations:
Text-to-Video
| Resolution | Aspect Ratio | Pixel Values (Width × Height) |
|---|---|---|
| 1080p | 16:9 | 1920 × 1080 |
| 1080p | 9:16 | 1080 × 1920 |
| 1440p | 16:9 | 2560 × 1440 |
| 1440p | 9:16 | 1440 × 2560 |
| 2160p | 16:9 | 3840 × 2160 |
| 2160p | 9:16 | 2160 × 3840 |
Image-to-Video
Image-to-video may specify height and width for cropping, or set both to 0 to default to the source image's aspect ratio.
Note: When width and height are not specified, and guidances.start_frame is specified, the generation will base the dimensions on the guidances.start_frame image.
Updated 2 months ago
