Gemini Omni Flash

This guide shows how to generate videos using the Gemini Omni 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": "gemini-omni-flash",
    "public": false,
    "parameters": {
      "prompt": "The koala plays with the cat",
      "guidances": {
        "image_reference": [
          {
            "image": {
              "id": "<YOUR_IMAGE_ID>",
              "type": "UPLOADED"
            },
            "strength": "MID"
          }
        ]
      },
      "duration": 5,
      "quantity": 1,
      "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, 10. Defaults to 5.
guidances.image_referencearrayMaximum 5 items. References images to guide the video generation. Each item includes image.id, image.type (INIT, GENERATION, UPLOADED, GENERATED, or VARIATION), and strength (LOW, MID, or HIGH; defaults to MID). An optional order sets the ordering of guidances.
heightnumberSets the height of the output video in pixels.
modelstringSpecifies the model used for generation. Set to gemini-omni-flash.
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)
720p16:9 (Landscape)1280x720
9:16 (Portrait)720x1280

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