generate_video
Generate or edit MP4 videos from text prompts, images, or references, with control over aspect ratio and duration.
Instructions
Generate or edit MP4 videos with Gemini Omni Flash.
Capabilities:
text_to_video: prompt-only video with generated audio.
image_to_video: one reference image plus motion and camera direction.
reference_to_video: multiple reference images for subjects, style, or props.
edit: use previous_interaction_id or input_video_path to edit existing video.
Parameters:
prompt: Describe the scene, motion, camera movement, lighting, mood, and audio.
task: text_to_video, image_to_video, reference_to_video, or edit. If omitted, inferred.
aspect_ratio: 16:9 landscape or 9:16 portrait.
duration_seconds: Optional 3 to 10 second target. If the API rejects this preview field, retry without it.
reference_image_paths: Up to 6 local images. Use or tags in the prompt for control.
input_video_path: Local MP4 to upload and edit through the Files API.
delivery: uri is recommended for generated MP4 files; inline is supported for smaller payloads.
previous_interaction_id: Continue editing a prior generated video.
enhance_prompt: Optional, default false. For edits, simple prompts usually work better.
Prompt tips:
Ask for "single continuous shot" and "no scene cuts" when you want one scene.
Include explicit audio direction such as "gentle ambient room tone, no dialogue".
For edits, say "Keep everything else the same".
Timing cues like [0-3s], [3-6s], [6-10s] are supported.
Limitations:
Output is MP4, currently 720p at 24fps, SynthID-watermarked, and preview quality.
System instructions, temperature, top_p, stop sequences, negative_prompt, voice edits, YouTube sources, and multi-video reasoning are unsupported.
Uploaded-video editing is unavailable in some regions.
Returns JSON including video.path, interaction_id, task, aspect_ratio, delivery, size, and URI metadata. After success, open video.path with the native OS video viewer.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | No | ||
| prompt | Yes | ||
| delivery | No | ||
| aspect_ratio | No | ||
| enhance_prompt | No | ||
| duration_seconds | No | ||
| input_video_path | No | ||
| reference_image_paths | No | ||
| previous_interaction_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |