Back to Templates

AI Video Generator
A Next.js application that demonstrates the power of the fal.ai SDK for AI-powered video generation. This project showcases how to use fal's queue management system and proxy setup to create animated videos from static images.
fal.ai is a serverless platform for running AI models at scale.
Features
- Upload static images and animate them using AI
- Real-time progress tracking and status updates
- Queue management for handling long-running video generation tasks
- Secure proxy setup for fal.ai API calls
- Modern, responsive UI built with Next.js and Tailwind CSS
Technology Stack
- Next.js - React framework for production
- fal.ai SDK - AI model deployment and inference platform
- Tailwind CSS - Utility-first CSS framework
- TypeScript - Type-safe JavaScript
Getting Started
- 
Clone the repository 
- 
Install dependencies: npm install# oryarn install# orpnpm install
- 
Set up your environment variables: - Copy .env.exampleto.env.local:cp .env.example .env.local
- Update the FAL_KEYin.env.localwith your fal.ai API key
 
- Copy 
- 
Run the development server: npm run dev# oryarn dev# orpnpm dev
- 
Open http://localhost:3000 with your browser to see the application. 
Project Structure
- app/components/VideoGenerator.tsx- Main component handling video generation
- app/api/fal/proxy/route.ts- API route for proxying fal.ai requests
- app/page.tsx- Main page component
How It Works
- Image Upload: Users can upload a static image through the web interface
- Prompt Input: Users provide a text prompt describing how they want the image to be animated
- Queue Management: The application uses fal.ai's queue system to handle video generation:
- Submits the generation task to the queue
- Polls for status updates
- Retrieves the final video when complete
 
- Proxy Setup: All fal.ai API calls are proxied through a secure API route to protect API keys
API Routes
The project includes a proxy route (/api/fal/proxy) that securely forwards requests to fal.ai, keeping your API keys private on the server side.
Learn More
License
MIT


