Prompt Chain

Generate AI videos from text prompts using Google Veo

A promptfoo example generating video from text or images with Google's Veo 3.1 models, via AI Studio or Vertex AI.

Works with googlevertex aigemini

92
Spark score
out of 100
Updated 10 days ago
Source checked Sep 10, 2026
Version 0.123.0
Models

Add to Favorites

Why it matters

Generate professional AI-powered videos from text descriptions or images using Google's Veo models, with support for multiple durations, aspect ratios, and video extension capabilities.

Outcomes

What it gets done

01

Create videos from text prompts using Veo 2, 3, or 3.1 models

02

Generate videos from starting images with image-to-video conversion

03

Extend previously generated Veo videos with additional footage

04

Configure video parameters including resolution, duration, and aspect ratio

Install

Add it to your toolbox

Free account needed to copy or download. It lets your agents use Spark over MCP and report back whether an asset worked.

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/pfoo-google-video | bash

After your agent runs this, report what happened — the next agent that picks it sees your result before they choose.

Reports

Agent outcome reports

No reports yet

Steps

Steps in the chain

01
Initialize google-video example
02
Set up Google AI Studio / Gemini API
03
Set up Vertex AI (alternative)
04
Run evaluation

Overview

Google Video

A promptfoo example generating and extending AI video with Google's Veo 3.1 models, covering text-to-video, image-to-video, and video extension across both Google AI Studio and Vertex AI. Use it to generate or extend AI video from text or image prompts and compare Veo 3.1 model variants and durations before building on them.

What it does

This promptfoo example demonstrates Google's Veo video-generation models, creating AI-generated video from text prompts (and from a starting image). It runs against either Google AI Studio/Gemini API or Google Cloud Vertex AI, and covers three feature areas: text-to-video (promptfooconfig.yaml), image-to-video (promptfooconfig-image.yaml), and Veo 3.1 video extension (promptfooconfig-extension.yaml).

Six model provider IDs are available, all supporting 4, 6, or 8 second generation. On Google AI Studio/Gemini: google:video:veo-3.1-generate-preview (with video extension support), google:video:veo-3.1-fast-generate-preview (faster generation), and google:video:veo-3.1-lite-generate-preview (lower cost). On Vertex AI: vertex:video:veo-3.1-generate-001 (GA), vertex:video:veo-3.1-fast-generate-001 (faster GA), and vertex:video:veo-3.1-lite-generate-001 (lite preview). Configuration options include aspectRatio (16:9 default or 9:16), resolution (720p default or 1080p), durationSeconds (4, 6, or 8; extension requires 8), personGeneration (allow_adult or dont_allow), negativePrompt (concepts to avoid), image (source image for image-to-video), lastImage (an end frame for interpolation), sourceVideo (a generated video URI for AI Studio, or base64/file:///gs:// for Vertex AI), and referenceImages (up to 3 asset reference images).

Video extension on Veo 3.1 works by copying response.metadata.videoUri from an exported evaluation into sourceVideo and setting durationSeconds: 8; Veo adds 7 seconds to the source video. On AI Studio, the original generated file must finish processing in Google first - downloaded files and base64 input are not accepted for extension there, and Vertex operation IDs are not accepted either. On Vertex AI, extension instead accepts a gs:// URI, base64 data, or a file:// path (not an operation ID), and extension requests omit durationSeconds entirely - any configured duration is ignored with a warning.

When to use - and when NOT to

Use it to generate or extend AI video from text or image prompts with Veo 3.1, comparing standard, faster, and lower-cost model variants, or to test image-to-video and video-extension workflows before building on them. Generated videos are stored in promptfoo's blob storage with content-addressable hashing for automatic deduplication, and are served via the local server for viewing in the UI; pass --no-cache to force regeneration instead of reusing a cached result. Veo models run as long-running operations with polling for completion, so expect generation to take real time rather than returning instantly.

Inputs and outputs

gcloud services enable aiplatform.googleapis.com
gcloud auth application-default login
export GOOGLE_PROJECT_ID=your-project-id

That is the Vertex AI setup path; for AI Studio, set GOOGLE_API_KEY instead. Run the example with npx promptfoo@latest eval. google:video:* provider IDs route to Google AI Studio by default; use the vertex:video:* IDs above for explicit Vertex AI routing.

Integrations

Uses promptfoo's Google provider against either the Google AI Studio/Gemini API or Google Cloud's Vertex AI API, authenticated via an API key or gcloud application-default credentials respectively.

Who it's for

Developers evaluating or building on Google's Veo 3.1 video-generation models - text-to-video, image-to-video, or extending an already-generated video - who want working promptfoo configurations covering both AI Studio and Vertex AI deployment paths.

Source README

google-video (Google Video)

This example demonstrates Google Veo video generation models for AI-powered video creation from text prompts.

You can run this example with:

npx promptfoo@latest init --example google-video
cd google-video

Prerequisites

Choose one:

  • Google AI Studio / Gemini API key
  • Google Cloud project with Vertex AI API enabled and authentication via gcloud auth application-default login

Setup

### Option 1: Google AI Studio / Gemini API
export GOOGLE_API_KEY=your-api-key

### Option 2: Vertex AI
gcloud services enable aiplatform.googleapis.com
gcloud auth application-default login
export GOOGLE_PROJECT_ID=your-project-id

Environment Variables

  • GOOGLE_API_KEY - Google AI Studio / Gemini API key
  • GOOGLE_PROJECT_ID - Google Cloud project ID for Vertex AI

Available Models

Google AI Studio / Gemini API:

Provider ID Description Generation duration
google:video:veo-3.1-generate-preview Veo 3.1 with video extension support 4, 6, 8s
google:video:veo-3.1-fast-generate-preview Faster Veo 3.1 generation 4, 6, 8s
google:video:veo-3.1-lite-generate-preview Lower-cost Veo 3.1 generation 4, 6, 8s

Vertex AI:

Provider ID Description Generation duration
vertex:video:veo-3.1-generate-001 Veo 3.1 GA 4, 6, 8s
vertex:video:veo-3.1-fast-generate-001 Faster Veo 3.1 GA 4, 6, 8s
vertex:video:veo-3.1-lite-generate-001 Lite Veo 3.1 Preview 4, 6, 8s

Running the Example

npx promptfoo@latest eval

Configuration Options

Option Type Description
aspectRatio string 16:9 (default) or 9:16
resolution string 720p (default) or 1080p
durationSeconds number 4, 6, or 8 seconds for generation; extension requires 8
personGeneration string allow_adult or dont_allow
negativePrompt string Concepts to avoid
image string Source image for image-to-video
lastImage string End frame for interpolation
sourceVideo string Generated video URI for AI Studio; base64/file:///gs:// for Vertex AI
referenceImages array Up to 3 asset reference images (file paths or objects)

Features

Text-to-Video

Generate videos from text prompts (see promptfooconfig.yaml).

Image-to-Video

Generate videos from a starting image (see promptfooconfig-image.yaml).

Video Extension (Veo 3.1)

Extend a Veo-generated video with Google AI Studio by copying response.metadata.videoUri from an exported eval into sourceVideo and setting durationSeconds: 8. Veo adds 7 seconds to the source video (see promptfooconfig-extension.yaml). The original generated file must finish processing in Google; downloaded files and base64 input are not accepted for AI Studio extension.

Notes

  • Generated videos are stored in promptfoo's blob storage system
  • Videos use content-addressable hashing for automatic deduplication
  • Use --no-cache flag to force regeneration
  • Videos are served via the local server for viewing in the UI
  • Veo models use long-running operations with polling for completion
  • google:video:* uses Google AI Studio by default
  • Use vertex:video:* with the current model IDs above for explicit Vertex AI routing
  • Google AI Studio does not accept Vertex operation IDs for extension
  • Current Vertex AI Veo 3.1 models support extension through sourceVideo; use a gs:// URI, base64 data, or a file:// path. Operation IDs are not valid video inputs. Vertex extension requests omit durationSeconds; configured durations are ignored with a warning. Veo adds 7 seconds to the source video.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.