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
| Model | Duration | Quality | Best For |
|---|---|---|---|
| fal-ai/minimax/video-01 | 5-10s | High | Fast, general purpose |
| fal-ai/kling-video/v1/standard | 5-10s | High | Cinematic quality |
| fal-ai/hunyuan-video | 5-10s | High | Diverse styles |
| fal-ai/ltx-video | 2-5s | Good | Quick 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 readyPolling 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
| Parameter | Type | Description |
|---|---|---|
| prompt | string | Text description of the video |
| duration | number | Video length in seconds (model-dependent) |
| aspect_ratio | string | "16:9", "9:16", "1:1" |
| image_url | string | Starting 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.