sup.ai.video
The sup.ai.video package provides AI-powered video generation capabilities using Google’s Veo models. It is accessed through sup.ai.video.
// Generate a video from text promptconst video = sup.ai.video.create("a cat playing with a ball of yarn");
// Generate with custom optionsconst hdVideo = sup.ai.video.create( "sunset over ocean with waves", { duration: 8, aspectRatio: "16:9", resolution: "1080p", model: "best" });
// Generate from an imageconst imageToVideo = sup.ai.video.create( sup.input.image, "animate this image with gentle movement");Methods
sup.ai.video.create()
(prompt: string | SupImage, options?: VideoCreateOptions) → SupVideo
// Simple text-to-videoconst video = sup.ai.video.create("a bird flying through clouds");
// With custom duration and aspect ratioconst video = sup.ai.video.create("dancing robot", { duration: 6, aspectRatio: "9:16", resolution: "720p"});
// Image-to-videoconst video = sup.ai.video.create( sup.input.image, "make this image come alive with subtle animation");Creates a video using AI based on a text prompt, image, or existing video.
Parameters:
prompt(string | SupImage | SupVideo):- Text prompt: Description of the video to generate
- SupImage: Starting image to animate
description(optional string): When using image or video input, provide a text descriptionoptions(optional object):duration(number): Length of video in seconds (default varies by model)aspectRatio(string): Video dimensions:"16:9": Landscape (default)"9:16": Portrait
resolution(string): Output quality:"720p": HD quality (default)"1080p": Full HD quality
model(string): Which Veo model to use:"fast": Fast generation with Veo 3.1"best": Highest quality with Veo 3.1 (default)"veo-3.1-fast-generate-001": Explicit fast model"veo-3.1-generate-001": Explicit best model"veo-3.1-fast-generate-preview"/"veo-3.0-fast-generate-preview": Legacy aliases mapped to fast GA endpoint"veo-3.1-generate-preview"/"veo-3.0-generate-preview"/"veo-2.0-generate-preview"/"veo-2.0-generate-exp": Legacy aliases mapped to best GA endpoint
Returns: A SupVideo object containing the generated video
Examples:
// Portrait video for social mediaconst socialVideo = sup.ai.video.create( "person dancing to upbeat music", { aspectRatio: "9:16", duration: 8, resolution: "1080p" });
// Quick preview with fast modelconst quickPreview = sup.ai.video.create( "car driving down highway", { model: "fast", duration: 4 });
// Animate a still imageconst animatedPainting = sup.ai.video.create( artworkImage, "bring this painting to life with gentle movements and lighting changes");sup.ai.video.interpret()
(...args: (string | SupVideo)[]) → string
const video = sup.input.video;const description = sup.ai.video.interpret(video);
// With a custom promptconst analysis = sup.ai.video.interpret( video, "What actions are happening in this video?");Analyzes a video using AI and returns a text description. Uses Gemini 3 Flash for multimodal video understanding.
Parameters:
video(SupVideo): The video to analyzeprompt(optional string): Custom instructions for the AI analysis. If not provided, uses a default prompt.
Returns: A string containing the AI’s interpretation of the video
Examples:
// Basic video descriptionconst video = sup.input.video;const description = sup.ai.video.interpret(video);
// Analyze specific aspectsconst actions = sup.ai.video.interpret( video, "Describe the main actions and movements in this video.");
// Transcribe speech in videoconst transcript = sup.ai.video.interpret( video, "Provide a transcript of all spoken words in this video.");Notes
- Generated videos are returned as
SupVideoobjects which can be displayed by returning them frommain(). - The Veo models excel at understanding natural language descriptions and generating realistic motion.
- Video generation can take longer than image generation depending on duration and quality settings.
- For best results, provide detailed descriptions including camera movement, lighting, and action.
- The
"best"model produces higher quality but takes longer to generate than"fast". - Image-to-video can be used to animate still images with motion.