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 ImagesTo use a generated image ID, change
imageType
toGENERATED
.
DurationDuration can be 4, 6, or 8. The units is seconds.
With end frame only support 8 seconds (end frame requires start frame)
Default DimensionVeo3.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
andwidth
are not required.Please note uploaded images will be cropped to fit those dimensions.
Switch to Motion 2To use Motion 2.0, remove the
model
parameter or set it toMOTION2
.Parameters such as
frameinterpolation
andpromptEnhance
are not compatible with Veo3.1
End Frame RequiredWhen using
endFrame
,startFrame
data must be included in the request, with bothimageId
andimageType
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
Updated about 15 hours ago