Grok Imagine 1.5

Grok Imagine 1.5

This guide shows how to generate videos using the Grok Imagine 1.5 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": "grok-imagine-1.5",
    "public": false,
    "parameters": {
      "prompt": "<YOUR_PROMPT>",
      "guidances": {
        "start_frame": [
          {
            "image": {
              "id": "<YOUR_START_IMAGE_ID>",
              "type": "UPLOADED"
            }
          }
        ]
      },
      "duration": 6,
      "width": 1280,
      "height": 720,
      "quantity": 1,
      "motion_has_audio": true
    }
}
'

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
durationnumberLength of the generated video in seconds. Set to 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, or 15. Defaults to 6.
guidances.start_framearrayRequired. Maximum 1 item. Each item includes image.id and image.type (INIT, GENERATION, UPLOADED, GENERATED, or VARIATION).
heightnumberSets the height of the output video in pixels. Set to 0, 400, 544, 720, 736, 960, or 1280. Defaults to 720.
modelstringSpecifies the model used for generation. Set to grok-imagine-1.5.
motion_has_audiobooleanWhether the video generation will include audio. Defaults to true.
promptstringText description of the video content to generate. Maximum of 5000 characters.
publicbooleanControls whether the generated video is public (true) or private (false).
quantitynumberThe number of outputs to generate. Set to 1. Defaults to 1.
widthnumberSets the width of the output video in pixels. Set to 0, 400, 544, 720, 736, 960, or 1280. Defaults to 1280.

Dimensions

The API accepts width and height parameters in the following combinations:

Aspect RatioPixel Values (Width x Height)
Auto0x0
1:1 (Square)544x544
1:1 (Square)960x960
16:9 (Landscape)1280x720
9:16 (Portrait)720x1280
9:16 (Portrait)400x736
16:9 (Landscape)736x400