Motion 2.0 Fast
This guide shows how to generate videos using the Motion 2.0 Fast 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-fast",
"public": false,
"parameters": {
"prompt": "A koala and a cat playing together in a sunlit meadow",
"quantity": 1,
"width": 1024,
"height": 1024,
"mode": "RESOLUTION_480"
}
}
'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 |
|---|---|---|
| controls | array | Optional. An array of Motion Control items (same format, but are defined separately from Motion Elements). Maximum 1 item. |
| elements | array | Optional. An array of Motion Elements (same format, but are defined separately from Motion Control!). |
| frame_interpolation | boolean | Optional. Whether the video generation will smoothly blend frames. Defaults to True. |
| guidances | object | Optional. Object defining guidance inputs (e.g. reference images, start/end frames) that influence the result. |
| guidances.start_frame | array | Optional. 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). |
| height | string | Optional. Height of the output in pixels. |
| mode | string | Optional. Resolution mode for the generation. Accepts RESOLUTION_480, RESOLUTION_720. Defaults to RESOLUTION_480. |
| model | string | Required. Specifies the model used for generation. Set to motion_2.0-fast. |
| negative_prompt | string | Optional. The negative prompt to use for the generation. Maximum 1000 characters. |
| prompt | string | Required. The prompt to use for the generation. Maximum 9999 characters. |
| prompt_enhance | string | Optional. Whether to enhance the prompt or not. Accepts AUTO, ON, OFF. Defaults to AUTO. |
| public | boolean | Optional. Controls whether the generation is public (true) or private (false). |
| quantity | number | Optional. The number of outputs to generate. Defaults to 1. Range 1-1. |
| seed | number | Optional. The seed value for video generation. |
| style_ids | array | Optional. An array of zero or more style UUIDs for video models (vibe, lighting, color). Defaults to []. |
| width | string | Optional. 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.
