Get Started Veo

quickstartsgemini-cookbookgemini-apigemini

Copyright 2025 Google LLC.

[ ]

Get started with Video generation using Veo

If you're reading this notebook on Github, open it in Colab by clicking the above button to see the generated videos.

⚠️ Veo is a paid only feature. This notebook won't run with the Free Tier. (cf. pricing for more details).

[ ]
I_am_aware_that_veo_is_a_paid_feature
False

What's Veo?

Veo enables creators to create high quality videos with incredible detail, minimal artifacts, and extended durations in resolutions up to 1080p. Veo supports both text-to-video and images-to-video.

With Veo 3, you can create videos with:

  • Advanced language understanding: Veo deeply understands natural language and visual semantics, capturing the nuance and tone of complex prompts to render intricate details in extended scenes, including cinematic terms like "timelapse" or "aerial shots."
  • Unprecedented creative control: Veo provides an unprecedented level of creative control, understanding prompts for all kinds of cinematic effects, like timelapses or aerial shots of a landscape.
  • Videos with audio: Veo 3 generates videos with audio automatically, with no additional effort from the developer.
  • More accurate video controls: Veo 3 is more accurate on lighting, accurate physics, and camera controls.

Veo 3.1 brings new capabilities:

The Veo 3 family of models includes both Veo 3/3.1 as well as Veo 3/3.1 Fast, which are a faster and more accessible version of the models. The Veo Fast models are ideal for backend services that programmatically generate ads, tools for rapid A/B testing of creative concepts, or apps that need to quickly produce social media content.

Safety is a core focus, with robust measures to prevent inappropriate or harmful content, and all generated videos are digitally watermarked with Google DeepMind’s SynthID.

Note that the previous model generation, Veo 2, is still available for developers via the Gemini API for a while. However, unlike Veo 3, videos generated by Veo 2 do not contain audio.

Setup

Install SDK

Install the SDK from PyPI.

[ ]
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45.3/45.3 kB 1.1 MB/s eta 0:00:00
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 237.3/237.3 kB 13.4 MB/s eta 0:00:00

Setup your API key and initialize client

To run the following cell, your API key must be stored it in a Colab Secret named GOOGLE_API_KEY. If you don't already have an API key, or you're not sure how to create a Colab Secret, see Authentication image for an example.

[ ]

Select the Veo model

[ ]
VEO_MODEL_ID

Text-to-video

Describe your desired scene, whether crafted by you or with Gemini's assistance, and Veo 3 brings it to life.

Prompting Tips for Veo

To get the most out of Veo, consider incorporating specific video terminology into your prompts. Veo understands a wide range of terms related to:

  • Shot composition: Specify the framing and number of subjects in the shot (e.g., "single shot", "two shot", "over-the-shoulder shot").
  • Camera positioning and movement: Control the camera's location and movement using terms like "eye level", "high angle", "worms eye", "dolly shot", "zoom shot", "*pan shot," and "tracking shot".
  • Focus and lens effects: Use terms like "shallow focus", "deep focus", "soft focus", "macro lens", and "wide-angle lens" to achieve specific visual effects.
  • Overall style and subject: Guide Veo's creative direction by specifying styles like "sci-fi", "romantic comedy", "action movie" or "animation". You can also describe the subjects and backgrounds you want, such as "cityscape", "nature", "vehicles", or "animals."

Check the Veo prompt guide for more details and tips.

Optional parameters

The prompt is the only mandatory parameters, the others are all optional.

  • negative_prompt: What you don't want to see in the video,
  • person_generation: Tell you model if it's allowed to generate adults in the videos or not. Children are always blocked,
  • duration_seconds: 4, 6 or 8s with Veo 3.1 (always 8s for Veo 3 and 7s when extending)
  • aspect ratio: Either 16:9 (landscape) or 9:16 (portrait),
  • resolution: Either 720p or 1080p

More details about each parameters in the related section of the documentation.

Create a video from a simple text prompt

It takes about a minute for the video to be generated.

[ ]
prompt
negative_prompt
aspect_ratio
resolution
Watch a sample generation 🎥

🍿 The video you will generate will be similar to this: A golden retriever playing in a field of sunflowers.

Select your resolution and aspect ratio

For landscape videos, you can select either the 720p or the 1080p resolutions. But if you prefer a vertical video you can set the aspect_ratio to 9:16 and get a portrait video.

[ ]
prompt
negative_prompt
aspect_ratio
resolution
Watch a sample generation 🎥

🍿 The video you will generate will be similar to this: A unicorn takes off from the top of the arc de triomphe and fly to the Eiffel tower..

Control the lighting

Veo 3 also allows you to have a good control on the lighing of the video being generated.

[ ]
prompt
negative_prompt
aspect_ratio
resolution
Watch a sample generation 🎥

🍿 The video you will generate will be similar to this: A solitary, ancient oak tree silhouetted against a dramatic sunset.

Control the camera

Veo 3 also allows you to have a good control on the camera shots and behavior of the video being generated.

[ ]
prompt
negative_prompt
aspect_ratio
resolution
Watch a sample generation 🎥

🍿 The video you will generate will be similar to this: a futuristic red sportscar speeding down a winding coastal highway.

Control the audio

Veo 3 also allows you to control audio details on your generated video.

[ ]
prompt
negative_prompt
aspect_ratio
resolution
Watch a sample generation 🎥

🍿 The video you will generate will be similar to this: fireworks at a beautiful city skyline scene.

Manage your dialogs

You have the flexibility to define the dialog on your videos too.

[ ]
prompt
negative_prompt
aspect_ratio
resolution
Watch a sample generation 🎥

🍿 The video you will generate will be similar to this: A dialog of two charismatic and funny raindrops like coloured characters.

Image-to-video

You can also generate videos from an base image and a prompt. Here are three examples, one in which you provide the image and one in which you will use Gemini Flash Image to generate the image. The last one will mix multiple reference images into a video!

Use your own images

If you want to use your own image, upload it to colab by clicking on the folder icon in the left menu (it should be the 5th choice), then on the upload icon (the first one) at the top of left left panel that should have been opened.

Your images will be uploaded in the /content folder of this colab instance.

Alternatively, you can use the code in this cell to upload your image:

[ ]
Saving ginger.jpeg to ginger.jpeg

Now that you have your own image, you can add it to your Veo prompt.

If you don't know what to prompt about your image, keep the prompt empty and the model will figure out what to generate.

[ ]
Output
[ ]
prompt
image_name
negative_prompt
aspect_ratio
resolution
Watch a sample generation 🎥

🍿 The video you will generate will be similar to this: A video generated from the uploaded image.

Use Gemini Image to generate the base image

This time you're going to generate a base image with Gemini Image and, when happy with it, create a video out of it.

If you want to know more about Gemini native image-generation capability, check out the dedicated notebook.

⚠️ Be careful, Image generation is a paid only feature (cf. pricing).

[ ]
prompt
negative_prompt
aspect_ratio
Output

When you are happy with your image, you can use Veo to make a video out of it.

[ ]
prompt
negative_prompt
aspect_ratio
resolution
Watch a sample generation 🎥

🍿 The video you will generate will be similar to this: A video generated from the Gemini generated image.

Add an ending image

Let's now add an ending image to control how the video should end. This can be used to make sure the video will blend with your existing content.

Note that you cannot use only an ending image, you always need to also add a starting one.

[ ]
prompt
negative_prompt
aspect_ratio
Output

When you are happy with your ending image, you can use Veo to make a video bridging between your two images. You just need to pass the ending image using config.last_frame as you can see below:

[ ]
prompt
negative_prompt
aspect_ratio
resolution
Watch a sample generation 🎥

🍿 The video you will generate will be similar to this: A video generated with a starting and ending frame.

References-to-video

You can also send multiple reference images to the model, they can be characters or objects that you want to see in the video or a style that you want to adhere to.

Note that it's only available using Veo 3.1 (not Fast) and in 720p and landscape (16:9).

Add multiple references to your videos

Let's start by generating a couple of reference images.

[ ]
OutputOutput

Now create a video using those two reference images. Note that you need to convert your images into a VideoGenerationReferenceImage and indicate that they are assets.

[ ]
prompt
negative_prompt
aspect_ratio
resolution
Watch a sample generation 🎥

🍿 The video you will generate will be similar to this: A video generated from multiple images.

Extend videos (WIP)

You can also pass a video to extend it by 7s. It can be done multiple times, or starting with a video longer than 8s The main contraint is that the final video duration can only be up to 148 seconds long which means you can extent your first 8s video about 20 times.

The contraints on the video you want to extend are:

  • Only with 720p resolution
  • The input video must be Veo generated
  • Less that 141s long

You just need to pass it using the video parameter.

[ ]
prompt
negative_prompt
Watch a sample generation 🎥

🍿 Here's a video that has been extended multiple times: A cat's car takes to the air, multiple times

Next Steps

Useful API references:

Check the Veo documentation and the prompt guide for more details on how to use Veo and best prompt it.

Continue your discovery of the Gemini API

Here are other cool Gemini features that you might find interesting:

  • Gemini's Image-out built-in image output can generate images with fine details, and let you iterate on them by chatting with the model;
  • Imagen can also generate images ;
  • Built-in Audio-out is also a great multimodal output capability that's quite fun to play with.
[ ]