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/generations

Headers

--header "accept: application/json" \
--header "authorization: Bearer <YOUR_API_KEY>" \
--header "content-type: application/json"

Body Parameters

ParameterTypeDefinition
modelstringSpecifies the model used for generation. Set to ltxv-2.0-pro or ltxv-2.0-fast.
publicbooleanControls whether the generated video is public (true) or private (false)
promptstringText description of the video content to generate.
prompt_enhancestringControls whether prompt enhancement is applied. Set to ON or OFF. Default is OFF
quantitynumberNumber of videos to generate per request.
durationnumberLength of the generated video in seconds. Set to 6 or 8
seednumberOptional. Seed value for reproducible generation.
widthnumberSets the width of the video in pixels.
heightnumberSets the height of the video in pixels.
start_frame.idstringOptional. The ID of the image to use as the starting frame. If omitted, the generation will be text-to-video only.
start_frame.typestringOptional. 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:

ResolutionAspect RatioPixel Values (Width x Height)
1080p16:91920 ร— 1080
1440p16:92560 ร— 1440
2160p16:93840 ร— 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.