Getting Started
Start generating videos with Open-Sora in minutes
1
Prerequisites
Before installing Open-Sora, ensure you have:
- Python 3.8 or higher
- CUDA-capable GPU (recommended for best performance)
- PyTorch installed
- Git installed
2
Clone the Repository
Start by cloning the Open-Sora repository:
git clone https://github.com/hpcaitech/Open-Sora.git
cd Open-Sora
3
Install Dependencies
Install Open-Sora and its dependencies:
pip install -e .
pip install -r requirements.txt
4
Download Model Weights
Download the pre-trained model weights from the repository. Check the GitHub repository for the latest model checkpoints.
5
Generate Your First Video
Test the installation with a simple text-to-video generation:
# Single GPU for 256px
torchrun --nproc_per_node 1 --standalone scripts/diffusion/inference.py \
configs/diffusion/inference/256px.py \
--prompt "raining, sea" \
--save-dir samples
This will generate a video based on your text prompt and save it to the samples directory.
Quick Tips
- GPU Memory: For 256px videos, you'll need at least 52GB GPU memory on a single GPU. Consider using multiple GPUs for larger resolutions.
- Performance: Multi-GPU setups significantly improve generation speed. Use
--nproc_per_nodeto specify the number of GPUs. - Resolution: Start with 256px for testing, then scale up to 768px for higher quality.
- Aspect Ratio: Use
--aspect_ratioto control video dimensions (16:9, 9:16, 1:1, 2.39:1).