Motion 2.0

This guide shows how to generate videos using the Motion 2.0 model 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": "motion_2.0",
  "public": false,
  "parameters": {
    "prompt": "A koala and a cat playing together in a sunlit meadow",
    "quantity": 1,
    "width": 1024,
    "height": 1024,
    "mode": "RESOLUTION_480"
  }
}
'

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
controlsarrayOptional. An array of Motion Control items (same format, but are defined separately from Motion Elements). Maximum 1 item.
elementsarrayOptional. An array of Motion Elements (same format, but are defined separately from Motion Control!).
frame_interpolationbooleanOptional. Whether the video generation will smoothly blend frames. Defaults to True.
guidancesobjectOptional. Object defining guidance inputs (e.g. reference images, start/end frames) that influence the result.
guidances.start_framearrayOptional. Creative reinterpretation of vibe or structure from a reference image. Maximum 1 item. Each item includes image.id and image.type (INIT, GENERATION, UPLOADED, GENERATED, VARIATION).
heightstringOptional. Height of the output in pixels.
modestringOptional. Resolution mode for the generation. Accepts RESOLUTION_480, RESOLUTION_720. Defaults to RESOLUTION_480.
modelstringRequired. Specifies the model used for generation. Set to motion_2.0.
negative_promptstringOptional. The negative prompt to use for the generation. Maximum 1000 characters.
promptstringRequired. The prompt to use for the generation. Maximum 9999 characters.
prompt_enhancestringOptional. Whether to enhance the prompt or not. Accepts AUTO, ON, OFF. Defaults to AUTO.
publicbooleanOptional. Controls whether the generation is public (true) or private (false).
quantitynumberOptional. The number of outputs to generate. Defaults to 1. Range 1-1.
seednumberOptional. The seed value for video generation.
style_idsarrayOptional. An array of zero or more style UUIDs for video models (vibe, lighting, color). Defaults to [].
widthstringOptional. Width of the output in pixels.

Dimensions

The API accepts integer width and height values in pixels.

The mode parameter accepts: RESOLUTION_480, RESOLUTION_720.