Docs/Guides/Video Generation

Video Generation

Create AI-generated videos from text prompts or images.

Video generation takes longer

Video generation typically takes 30 seconds to several minutes. We recommend using async mode with webhooks for the best experience.

Available Models

ModelDurationQualityBest For
fal-ai/minimax/video-015-10sHighFast, general purpose
fal-ai/kling-video/v1/standard5-10sHighCinematic quality
fal-ai/hunyuan-video5-10sHighDiverse styles
fal-ai/ltx-video2-5sGoodQuick previews

Basic Usage

Generate a video from a text prompt using async mode:

// Start the video generation
const job = await abstrakt.run('fal-ai/minimax/video-01', {
  prompt: 'A timelapse of clouds moving over a mountain range',
  duration: 5,
  aspect_ratio: '16:9'
}, {
  async: true,
  webhook_url: 'https://your-server.com/webhooks/video'
});

console.log('Job started:', job.request_id);

// The webhook will be called when the video is ready

Polling for Status

If you prefer polling over webhooks:

// Start the job
const job = await abstrakt.run('fal-ai/minimax/video-01', {
  prompt: 'Ocean waves crashing on a beach at sunset'
}, { async: true });

// Poll for completion
let result;
while (true) {
  result = await abstrakt.getJob(job.request_id);
  
  if (result.status === 'completed') {
    console.log('Video URL:', result.output.items[0].url);
    break;
  } else if (result.status === 'failed') {
    throw new Error(result.error);
  }
  
  // Wait before polling again
  await new Promise(r => setTimeout(r, 5000));
}

Video Parameters

ParameterTypeDescription
promptstringText description of the video
durationnumberVideo length in seconds (model-dependent)
aspect_ratiostring"16:9", "9:16", "1:1"
image_urlstringStarting frame image (image-to-video)

Image to Video

Animate a static image into a video:

const result = await abstrakt.run('fal-ai/kling-video/v1/standard', {
  prompt: 'The woman slowly turns her head and smiles',
  image_url: 'https://example.com/portrait.jpg',
  duration: 5
}, { async: true });

Tips for Better Results

  • Describe motion: Include words like "moving", "flowing", "walking" to guide the animation.
  • Keep it simple: Complex scenes with many elements may produce inconsistent results.
  • Use reference images: Image-to-video produces more consistent results than text-only.
  • Start short: Test with shorter durations before generating longer videos.

Next Steps