Installing Open-Sora requires a step-by-step process to complete the environment configuration:
- Creating a Python Virtual Environment: Recommended to use Python 3.10, create a standalone environment via conda to avoid dependency conflicts
conda create -n opensora python=3.10 conda activate opensora
- Cloning Codebase: Getting project source code from GitHub
git clone https://github.com/hpcaitech/Open-Sora cd Open-Sora
- Installing core dependencies: Ensure that PyTorch version ≥ 2.4.0 is required
pip install -v .
Recommended in development mode:
pip install -v -e .
- Accelerated library installation: Install performance optimization libraries according to CUDA version
pip install xformers==0.0.27.post2 --index-url ... pip install flash-attn --no-build-isolation
- Model Download: get pre-trained weights from Hugging Face or ModelScope
huggingface-cli download hpcai-tech/Open-Sora-v2 --local-dir ./ckpts
After the installation is complete, you can access it via thepython -c "import opensora; print(opensora.__version__)"
Verify that it was successful.
This answer comes from the articleOpen Sora: An Open Source Video Generation Tool for Optimizing Face ConsistencyThe