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.
Panda Jumping on Moon | Cars racing on Race-track |
![]() |
![]() |
- 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
- Python 3.9 or higher
- CUDA-capable GPU (recommended) or CPU
- 12GB+ RAM recommended
- Windows/Linux/MacOS
-
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
-
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
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"
-
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
Common Issues:
-
CUDA/GPU Issues
Error: Torch not compiled with CUDA enabled
Solution: 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 memory
Solution: 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
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
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
If you find this project useful, please consider giving it a star on GitHub!
If you have any questions or suggestions, feel free to open an issue on GitHub.
Happy Video Generating! 🎥✨