Prompt Chain

Generate AI videos from text prompts using Google Veo

A promptfoo example for evaluating Google Veo text-to-video and image-to-video generation models.

Works with googlevertex aigemini

92
Spark score
out of 100
Updated 13 days ago
Version 0.121.18
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

Run in your project directory:

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

Steps

Steps in the chain

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

Overview

Google Video

A promptfoo example for evaluating Google Veo's text-to-video, image-to-video, and video-extension capabilities across its model lineup. Use it to evaluate Veo video generation via AI Studio or Vertex AI. Video extension requires the explicit Vertex provider path and is Veo 3.1 only.

What it does

This promptfoo example demonstrates Google's Veo video generation models for AI-powered video creation from text prompts, source images, or a combination of both together. It covers five models - veo-3.1-generate-preview (latest, with video extension support), veo-3.1-fast-preview, veo-3-generate, veo-3-fast, and veo-2-generate - each supporting 4, 6, or 8 second clips (veo-2 also supports 5 seconds).

When to use - and when NOT to

Use this example when you want to evaluate Veo's text-to-video, image-to-video, or video-extension capabilities. It works through either a Google AI Studio / Gemini API key or a Google Cloud project with Vertex AI enabled and gcloud application-default login - video extension specifically requires the explicit Vertex provider path and an operation ID from a prior generation, and is only available on Veo 3.1.

Inputs and outputs

Configuration options control aspect ratio (16:9 default or 9:16), resolution (720p default or 1080p), durationSeconds, personGeneration (allow_adult or dont_allow), a negativePrompt to steer away from unwanted concepts, an image input for image-to-video, a lastImage for interpolation to an end frame, extendVideoId for extending a prior Veo 3.1 generation, and up to three referenceImages for style reference:

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

Text-to-video uses promptfooconfig.yaml, image-to-video uses promptfooconfig-image.yaml, and video extension uses promptfooconfig-extension.yaml.

Integrations

Set GOOGLE_API_KEY for AI Studio, or enable the Vertex AI API and set GOOGLE_PROJECT_ID for Vertex AI. google:video:* uses AI Studio by default and auto-detects Vertex AI when project-based auth is configured; existing project-based google:video:* configs remain compatible, but vertex:video:* is the recommended explicit path for Vertex-only features like extendVideoId. Generated videos are stored in promptfoo's blob storage with content-addressable hashing for automatic deduplication, served via the local server for viewing, and can be forced to regenerate with --no-cache; Veo generation itself runs as a long-running operation with polling for completion.

Who it's for

Teams evaluating AI video generation quality and features - text-to-video, image-to-video, style reference, or extending existing clips - across Google's Veo model lineup. Veo 2 clips run 5, 6, or 8 seconds while the Veo 3.x family runs 4, 6, or 8 seconds, so teams comparing durations across generations should account for that difference rather than assuming identical duration options everywhere. The lastImage option (an end frame for interpolation) and the up-to-three referenceImages for style guidance are worth testing separately from plain image-to-video, since each shapes the output differently.

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

Model Description Duration
veo-3.1-generate-preview Latest with video extension support 4, 6, 8s
veo-3.1-fast-preview Fast Veo 3.1 4, 6, 8s
veo-3-generate Veo 3.0 standard 4, 6, 8s
veo-3-fast Veo 3.0 fast 4, 6, 8s
veo-2-generate Veo 2.0 5, 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 Duration: 4, 6, 8 for Veo 3.x; 5, 6, 8 for Veo 2
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
extendVideoId string Operation ID from previous Vertex Veo generation (Veo 3.1 only)
referenceImages array Up to 3 style 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 previously generated Veo videos using the explicit Vertex provider path and an operation ID (see promptfooconfig-extension.yaml).

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 and auto-detects Vertex AI when project-based auth is configured
  • Existing project-based google:video:* configs remain compatible, but vertex:video:* is the recommended explicit path for Vertex-only flows such as extendVideoId

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.