A simple web-based service for generating 10-20 second videos using Open-Sora 2.0, with image and text input.
- 🎬 Generate high-quality videos (10-20 seconds)
- 🖼️ Image + Text conditioning for better control
- 🚀 Simple web interface
- 📥 Direct video download
- 🔓 No content restrictions
- Backend: FastAPI (Python)
- Frontend: Vanilla HTML/CSS/JavaScript
- Model: Open-Sora 2.0 (11B model)
- Python 3.10+
- CUDA-compatible GPU (H100/H800 recommended)
- 40GB+ VRAM for optimal performance
- PyTorch >= 2.4.0
NEW: Run frontend & backend locally, use remote GPU for generation!
This is the most cost-effective and flexible setup:
- ✅ No local GPU required
- ✅ Pay for GPU only when generating
- ✅ Works on Windows, Mac, Linux
- ✅ Quick 5-minute setup
# On Lambda GPU instance
./lambda_run_gpu_service.sh --api-key your-secret-key
# On your local machine
./run_local.sh --gpu-url http://lambda-ip:8001 --api-key your-secret-key
# Open browser
http://localhost:8000Complete guide: See QUICKSTART_REMOTE.md and REMOTE_GPU_SETUP.md
Run everything (frontend + backend + GPU) on a single Lambda instance.
# 1. Launch instance at https://cloud.lambdalabs.com
# 2. SSH into instance
ssh ubuntu@<instance-ip>
# 3. Run automated setup
git clone <your-repo-url> ~/sora2
cd ~/sora2
./lambda_setup.sh
# 4. Start service
./lambda_run.shComplete guide: See LAMBDA_LABS.md
For local GPU servers or other cloud providers.
git clone https://github.com/hpcaitech/Open-Sora.git
cd Open-Sora
pip install -v .
pip install xformers==0.0.27.post2 --index-url https://download.pytorch.org/whl/cu121
pip install flash-attn --no-build-isolationcd /path/to/sora2
pip install -r requirements.txtEdit backend/config.py and set the OPENSORA_PATH to your Open-Sora installation directory.
# From the project root
python backend/main.pyThe service will start on http://localhost:8000
- Open
http://localhost:8000in your browser - Upload an input image (PNG/JPG)
- Enter your text prompt
- Configure video settings:
- Duration (10-20 seconds)
- Aspect ratio (16:9, 9:16, 1:1, 2.39:1)
- Motion intensity
- Click "Generate Video"
- Wait for generation (1-5 minutes depending on GPU)
- Preview and download your video
POST /api/generate
Content-Type: multipart/form-data
Parameters:
- image: File (required)
- prompt: string (required)
- duration: integer (10-20, default: 15)
- aspect_ratio: string (default: "16:9")
- motion_score: float (0.0-1.0, default: 0.5)
Response:
{
"video_id": "uuid",
"status": "processing"
}GET /api/status/{video_id}
Response:
{
"status": "completed",
"video_url": "/api/download/{video_id}"
}GET /api/download/{video_id}Edit backend/config.py:
OPENSORA_PATH = "/path/to/Open-Sora"
OUTPUT_DIR = "./outputs"
MAX_CONCURRENT_JOBS = 2
ENABLE_QUEUE = True- 256px: ~60 seconds on single H100/H800
- 768px: ~276 seconds with 8 GPUs
- Use
--offload Truefor memory optimization on GPUs with <40GB VRAM
- Lambda Labs (Recommended): See LAMBDA_LABS.md - Quick 5-minute setup
- Docker: See DEPLOYMENT.md
- Production: See DEPLOYMENT.md for systemd, nginx, SSL setup
Add --offload True to the generation command in backend/generator.py
- Use multiple GPUs with
--nproc_per_node - Reduce resolution or frame count
- Enable sequence parallelism
Models are downloaded automatically from HuggingFace. If you experience issues:
- Use ModelScope mirror (Chinese users)
- Download manually and update config paths
This service wrapper is provided as-is. Open-Sora 2.0 is licensed under Apache 2.0.
- Open-Sora by HPC-AI Tech