Gemini Omni 1.1 Flash

This guide shows how to generate videos using the Gemini Omni 1.1 Flash 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": "google/gemini-omni-1.1-flash-preview",
    "public": false,
    "parameters": {
      "prompt": "The koala plays with the cat",
      "guidances": {
        "start_frame": [
          {
            "image": {
              "id": "<YOUR_START_IMAGE_ID>",
              "type": "UPLOADED"
            }
          }
        ],
        "end_frame": [
          {
            "image": {
              "id": "<YOUR_END_IMAGE_ID>",
              "type": "UPLOADED"
            }
          }
        ]
      },
      "duration": 5,
      "quantity": 1,
      "motion_has_audio": true,
      "width": 1280,
      "height": 720
    }
}
'

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, or 10. Defaults to 5.
guidances.end_framearrayMaximum 1 item. Each item includes image.id and image.type (UPLOADED, GENERATED, VARIATION, URL, or BASE64). Sets the final frame of the generated video.
guidances.image_referencearrayMaximum 10 items. References images to guide your video generation. Each item includes image.id and image.type (UPLOADED, GENERATED, VARIATION, URL, or BASE64). An optional order sets the ordering of guidances.
guidances.start_framearrayMaximum 1 item. Each item includes image.id and image.type (UPLOADED, GENERATED, VARIATION, URL, or BASE64). Sets the first frame of the generated video.
guidances.video_reference_basearrayMaximum 3 items. Base video to be edited. Each item includes video.id, video.type (UPLOADED or GENERATED), and video.duration, which must not exceed 10 seconds.
heightnumberSets the height of the output video in pixels.
modelstringSpecifies the model used for generation. Set to google/gemini-omni-1.1-flash-preview.
motion_has_audiobooleanControls whether the video generation includes audio. Defaults to true.
promptstringText description of the video content to generate. Maximum of 2500 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.

Dimensions

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

ResolutionAspect RatioPixel Values (Width x Height)
360p16:9 (Landscape)640x360
9:16 (Portrait)360x640
720p16:9 (Landscape)1280x720
9:16 (Portrait)720x1280
1080p16:9 (Landscape)1920x1080
9:16 (Portrait)1080x1920
4K16:9 (Landscape)3840x2160
9:16 (Portrait)2160x3840

width and height must be set together using one of the combinations above, or omitted together.


Did this page help you?