Generate with Veo3.1 and Veo3.1 Fast Using Start and End Frame

Example for generating a video with uploaded images as a start add end frame using Veo3.1 and Veo3.1 Fast

Follow this recipe to generate video using text:

The guide will recreate the following functionality in the Web UI via API.

Veo3.1 Using Start and End Frame Sample Request in 720p

Veo3.1 720p Using Uploaded Image Sample Request

curl --request POST \
     --url https://cloud.leonardo.ai/api/rest/v1/generations-image-to-video\
     --header 'accept: application/json' \
     --header 'authorization: Bearer `<YOUR_API_KEY>`' \
     --header 'content-type: application/json' \
     --data'
{
    "prompt":"YOUR PROMPT",
    "imageId" : <YOUR_IMAGE_ID>,
    "imageType": "UPLOADED",
    "endFrameImage":{
        "id" : <YOUR_IMAGE_ID>,
        "type": "UPLOADED"
    },
    "resolution": "RESOLUTION_720",
    "duration":8,
    "height":720,
    "width":1280,
    "model": "VEO3_1"
}
'

Veo3.1 Using Start and End Frame Sample Request in 1080p

Change "resolution": "RESOLUTION_720" to "resolution": "RESOLUTION_1080"

Veo3.1 1080p Using Uploaded Image Sample Request

curl --request POST \
     --url https://cloud.leonardo.ai/api/rest/v1/generations-image-to-video\
     --header 'accept: application/json' \
     --header 'authorization: Bearer `<YOUR_API_KEY>`' \
     --header 'content-type: application/json' \
     --data'
{
    "prompt":"YOUR PROMPT",
    "imageId" : <YOUR_IMAGE_ID>,
    "imageType": "UPLOADED",
    "endFrameImage":{
        "id" : <YOUR_IMAGE_ID>,
        "type": "UPLOADED"
    },
    "resolution": "RESOLUTION_1080",
    "duration":8,
    "height":1080,
    "width":1920,
    "model": "VEO3_1"
}
'

Generate With Veo3.1 Fast Model Start and End Frame Sample Request

Follow this recipe to generate video using text:

The guide will recreate the following functionality in the Web UI via API.

Veo3.1 Fast Using Start and End Frame Sample Request in 720p

curl --request POST \
     --url https://cloud.leonardo.ai/api/rest/v1/generations-image-to-video\
     --header 'accept: application/json' \
     --header 'authorization: Bearer `<YOUR_API_KEY>`' \
     --header 'content-type: application/json' \
     --data'
{
    "prompt":"YOUR PROMPT",
    "imageId" : <YOUR_IMAGE_ID>,
    "imageType": "UPLOADED",
    "endFrameImage":{
        "id" : <YOUR_IMAGE_ID>,
        "type": "UPLOADED"
    },
    "resolution": "RESOLUTION_720",
    "duration":8,
    "height":720,
    "width":1280,
    "model": "VEO3_1FAST"
}
'

Veo3.1 Fast Using Start and End Frame Sample Request in 720p

curl --request POST \
     --url https://cloud.leonardo.ai/api/rest/v1/generations-image-to-video\
     --header 'accept: application/json' \
     --header 'authorization: Bearer `<YOUR_API_KEY>`' \
     --header 'content-type: application/json' \
     --data'
{
    "prompt":"YOUR PROMPT",
    "imageId" : <YOUR_IMAGE_ID>,
    "imageType": "UPLOADED",
    "endFrameImage":{
        "id" : <YOUR_IMAGE_ID>,
        "type": "UPLOADED"
    },
    "resolution": "RESOLUTION_1080",
    "duration":8,
    "height":1080,
    "width":1920,
    "model": "VEO3_1FAST"
}
'
๐Ÿ“˜

Generated vs Uploaded Images

To use a generated image ID, change imageType to GENERATED.

๐Ÿ“˜

Duration

Duration can be 4, 6, or 8. The units is seconds.

With end frame only support 8 seconds (end frame requires start frame)

๐Ÿ“˜

Default Dimension

Veo3.1 720p generates at an aspect ratio of 16:9 at dimensions 1280x720.

Veo3.1 720p generates at an aspect ratio of 9:16 at dimensions 720x1280.

Veo3.1 1080p generates at an aspect ratio of 16:9 at dimensions 1920x1080.

Veo3.1 1080p generates at an aspect ratio of 9:16 at dimensions 1080x1920.

Dimensions will default to 16:9, height and width are not required.

Please note uploaded images will be cropped to fit those dimensions.

๐Ÿ“˜

Switch to Motion 2

To use Motion 2.0, remove the model parameter or set it to MOTION2.

Parameters such as frameinterpolation and promptEnhance are not compatible with Veo3.1


โ—๏ธ

End Frame Required

When using endFrame, startFrame data must be included in the request, with both imageId and imageType defined.

Only 8-second duration is supported when using endFrame.

Cost

Veo3.1 8s video costs 2140 API Credits

Veo3.1 6s video costs 1605 API Credits

Veo3.1 4s video costs 1070 API Credits

Veo3.1 Fast 8s video costs 1092 API Credits

Veo3.1 Fast 6s video costs 819 API Credits

Veo3.1 Fast 4s video costs 546 API Credits