generate_video
Generate videos from text prompts or images using Google Veo 3.1. Support image-to-video animation, reference images for consistency, and multiple models, resolutions, and durations.
Instructions
Generate a video using Google Veo 3.1 API.
Supports:
Text-to-Video: Generate video from a text prompt
Image-to-Video: Animate a static image
Reference Images: Use up to 3 asset images or 1 style image for consistency
Models:
veo-3.1-generate-preview: High quality (default)
veo-3.1-fast-generate-preview: Faster generation
veo-3.1-lite-generate-preview: Cheapest, 720p/1080p only
Pricing (per second, audio always included):
Standard: $0.40 (720p/1080p), $0.60 (4K)
Fast: $0.10 (720p), $0.12 (1080p), $0.30 (4K)
Lite: $0.05 (720p), $0.08 (1080p)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Random seed for reproducibility (0-4294967295) | |
| wait | No | If false, return the operation_name immediately without waiting for completion. Poll with get_video_status and download with its download option. Default: true | |
| image | No | Image for Image-to-Video mode. Can be a file path, URL, or base64 string | |
| model | No | Model to use for generation. Default: veo-3.1-generate-preview | |
| prompt | No | Text prompt describing the video to generate. Required unless image is provided. | |
| resolution | No | Video resolution. 4K not available for lite model. 1080p/4K require duration_seconds: 8. Default: 720p | |
| output_path | No | Path to save the generated video. If not provided, uses OUTPUT_DIR env var | |
| aspect_ratio | No | Aspect ratio of the video. Default: 16:9 | |
| sample_count | No | Number of videos to generate per request (1-4). Default: 1 | |
| generate_audio | No | Whether to generate audio. Note: Gemini API preview always generates audio (this parameter is ignored). Use Vertex AI for audio control. | |
| negative_prompt | No | Elements to avoid in the generated video | |
| duration_seconds | No | Duration of the video in seconds (4, 6, or 8). Must be 8 when using 1080p/4K or reference images. Default: 8 | |
| reference_images | No | Reference images for consistency. Max 3 asset images or 1 style image | |
| person_generation | No | Control person generation: allow_adult (default), dont_allow, allow_all |