You can use Gemini to generate images from a video, which can be useful to credate an image for a thumbnail for a video. Supported interfaces include the Google Cloud console and the Agent Platform API.
The following Gemini models support image generation from a video:
For more information about Gemini model capabilities, see Gemini models.
Generate images from video
The following shows how to generate images from video using either Agent Studio or using the API.
For more information about best practices for prompting, see Design multimodal prompts.
Console
To generate images from video with Gemini, do the following:
In the Agent Platform section of the Google Cloud console, go to Agent Studio > Image.
In Model settings, select one of the displayed models.
In the Prompt text area, click the add add button, and then select the source of the video file:
Upload
Select the file that you want to upload and click Open.
By URL
Enter the URL of the file that you want to use and click Insert.
YouTube
Enter the URL of the YouTube video that you want to use and click Insert.
You can use any public video or a video that's owned by the account that you used to sign in to the Google Cloud console.
Cloud Storage
Select the bucket and then the file from the bucket that you want to import and click Select.
Google Drive
- Choose an account and give consent to Gemini Enterprise Agent Platform Studio to access your account the first time you select this option. You can upload multiple files that have a total size of up to 10 MB. A single file can't exceed 7 MB.
- Click the file that you want to add.
Click Select.
The file thumbnail displays in the Prompt pane. The total number of tokens also displays. If your prompt data exceeds the token limit, the tokens are truncated and aren't included in processing your data.
Write a description of the image you want to generate in the text area of the Prompt text area.
Click the Prompt () button.
Gemini generates an image based on your description. This process takes a few seconds, but can be comparatively slower depending on capacity.
REST
After you set up your environment, you can use REST to test a text prompt. The following sample sends a request to the publisher model endpoint.
Before using any of the request data, make the following replacements:
-
PROJECT_ID: Your project ID. -
FILE_URI: The URI or URL of the file to include in the prompt. Acceptable values include the following:- Cloud Storage bucket URI: The object must either be publicly readable or reside in the same Google Cloud project that's sending the request.
- HTTP URL: The file URL must be publicly readable. You can specify one video file, one audio file, and up to 10 image files per request. Audio files, video files, and documents can't exceed 15 MB.
- YouTube video URL:The YouTube video must be either owned by the account that you used to sign in to the Google Cloud console or be public. Only one YouTube video URL is supported per request.
When specifying a
fileURI, you must also specify the media type (mimeType) of the file. If VPC Service Controls is enabled, specifying a media file URL forfileURIis not supported.If you don't have a video file in Cloud Storage, then you can use the following publicly available file:
gs://cloud-samples-data/video/animals.mp4with a mime type ofvideo/mp4. To view this video, open the sample MP4 file. -
MIME_TYPE: The media type of the file specified in thedataorfileUrifields. Acceptable values include the following:Click to expand MIME types
application/pdfaudio/mpegaudio/mp3audio/wavimage/pngimage/jpegimage/webptext/plainvideo/movvideo/mpegvideo/mp4video/mpgvideo/avivideo/wmvvideo/mpegpsvideo/flv
-
TEXT: The text instructions to include in the prompt. For example,What is in the video?
To send your request, choose one of these options:
curl
Save the request body in a file named request.json.
Run the following command in the terminal to create or overwrite
this file in the current directory:
cat > request.json << 'EOF'
{
"contents": {
"role": "USER",
"parts": [
{
"fileData": {
"fileUri": "FILE_URI",
"mimeType": "MIME_TYPE"
}
},
{
"text": "TEXT"
}
]
}
}
EOFThen execute the following command to send your REST request:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/global/publishers/google/models/gemini-3.1-flash-image:generateContent"
PowerShell
Save the request body in a file named request.json.
Run the following command in the terminal to create or overwrite
this file in the current directory:
@'
{
"contents": {
"role": "USER",
"parts": [
{
"fileData": {
"fileUri": "FILE_URI",
"mimeType": "MIME_TYPE"
}
},
{
"text": "TEXT"
}
]
}
}
'@ | Out-File -FilePath request.json -Encoding utf8Then execute the following command to send your REST request:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/global/publishers/google/models/gemini-3.1-flash-image:generateContent" | Select-Object -Expand Content
- Use the
generateContentmethod to request that the response is returned after it's fully generated. To reduce the perception of latency to a human audience, stream the response as it's being generated by using thestreamGenerateContentmethod. - The multimodal model ID is located at the end of the URL before the method
(for example,
gemini-2.5-flash). This sample might support other models as well. - When you use a regional API endpoint (for example,
us-central1), the region from the endpoint URL determines where the request is processed. Any conflicting location in the resource path is ignored.
What's next?
See the following links for more information about Gemini image generation: