Shivp1413/local-ai-video-generator
Local AI Video Generator ๐ฌ
Generate creative videos using artificial intelligence right from your local machine! This Streamlit application leverages the CogVideoX-5b model to transform text prompts into engaging video sequences.
<table> <tr> <td><b>Panda Jumping on Moon</b></td> <td><b>Cars racing on Race-track </b></td> </tr> <tr> <td><img src="jumpingpanda.gif" width="400"/></td> <td><img src="3carracing.gif" width="400"/></td> </tr> </table>
๐ Features
- Text-to-video generation using CogVideoX-5b model
- User-friendly web interface built with Streamlit
- Adjustable video length (8 frames = 1 second of video)
- Custom random seed for reproducible results
- Supports both CPU and GPU acceleration
- Easy video download in MP4 format
- Real-time system information display
๐ ๏ธ Prerequisites
- Python 3.9 or higher
- CUDA-capable GPU (recommended) or CPU
- 12GB+ RAM recommended
- Windows/Linux/MacOS
โ๏ธ Installation
- Clone the repository
git clone https://github.com/Shivp1413/local-ai-video-generator.git
cd local-ai-video-generator- Create a virtual environment
# Windows
python -m venv venv
venv\Scripts\activate
# Linux/MacOS
python -m venv venv
source venv/bin/activate- Install required packages
pip install -r requirements.txt๐ Usage
- Start the application
streamlit run src/app.py- Access the interface
- Open your web browser
- Navigate to http://localhost:8501
- Generate a video
- Enter your creative prompt in the text area
- Adjust the number of frames (8 frames = 1 second)
- Set a random seed if you want reproducible results
- Click "Generate Video" and wait for the process to complete
- Download your video using the download button
๐ Example Prompts
Try these example prompts:
- "A panda playing guitar in a bamboo forest"
- "A spaceship flying through colorful nebulae"
- "A timelapse of a flower blooming in a garden"
- "A robot dancing in a futuristic city"
โก Performance Tips
- GPU Acceleration
- For optimal performance, use a CUDA-capable GPU
- Make sure you have the latest NVIDIA drivers installed
- The application will automatically detect and use GPU if available
- Memory Usage
- Reduce number of frames for faster generation
- Close other memory-intensive applications
- Monitor system resources in the sidebar
๐ง Troubleshooting
Common Issues:
- CUDA/GPU Issues
Error: Torch not compiled with CUDA enabledSolution: Install the CUDA-enabled version of PyTorch:
pip uninstall torch
pip install torch --index-url https://download.pytorch.org/whl/cu118- Memory Issues
CUDA out of memorySolution: Reduce the number of frames or try running on CPU
- Model Loading Issues
- Check your internet connection
- Ensure you have enough disk space
- Try clearing your cache
๐ Project Structure
local-ai-video-generator/
โโโ src/
โ โโโ app.py # Main Streamlit interface
โ โโโ model.py # Model loading and configuration
โ โโโ utils.py # Helper functions
โโโ requirements.txt # Package dependencies
โโโ .gitignore # Git ignore rules
โโโ README.md # Project documentation๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
โญ Show Your Support
If you find this project useful, please consider giving it a star on GitHub!
๐ง Contact
If you have any questions or suggestions, feel free to open an issue on GitHub.
Happy Video Generating! ๐ฅโจ
