# Repository Briefing: alibaba/Tora
> Source: https://repoforai.com/repo/alibaba/Tora (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/alibaba/Tora
- **Official Docs / Website**: https://ali-videoai.github.io/tora_video
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: B (51/100 · Maintenance 12/35 · Adoption 13/25 · Releases 6/20 · License 20/20)
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: Local AI, GPU
- **Momentum**: 1,246 ★ total (+0 24h / +1 7d) · 61 forks
- **When to Use**: Best for: Previsualization, research, and local video prototyping where an explicit motion path is part of the shot specification; trial Diffusers first on a 16 GB GPU. Skip if: Prompt-only video is sufficient, you need a turnkey serving stack with predictable concurrency, or you cannot accommodate the checkpoint terms and measured GPU requirements.

## Overview
```text
### Architecture & Core Mechanics
Tora extends a CogVideoX-5B spatiotemporal diffusion transformer with a dedicated motion-conditioning path. The Trajectory Extractor uses a 3D video compression network to encode arbitrary paths as hierarchical spacetime motion patches. The Motion-guidance Fuser feeds those patches into DiT blocks alongside text and, for image-to-video, a reference first frame. The trajectory guides generation inside the model rather than warping an already generated clip.

The `sat/` implementation uses PyTorch and the bundled `modules/SwissArmyTransformer`, with a T5 text encoder, a 3D VAE, and separate Tora checkpoints for text-to-video and image-to-video. `sat/sample_video.py` is the YAML-driven inference entrypoint, launched through `torchrun`. The separate `diffusers-version/` directory provides a second inference route with corresponding weights; do not assume that SAT commands and checkpoint layouts carry over.

### Key Capabilities & Differentiators
Tora exposes trajectory-guided text-to-video and first-frame image-to-video. SAT inference accepts prompt and trajectory files through `--input-file` and `--point_path`. In image-to-video mode, `--image2video` enables image conditioning, `--img_dir` supplies the source images, and `@@` associates each prompt with a first-frame filename. The 256×256 canvas defines path coordinates, not output resolution. The architecture targets varied durations, aspect ratios, and resolutions, but no supported output matrix is established here.

The SAT implementation includes a Gradio demo and a text-to-video training pipeline. `train_video.py` pairs `labels/*.txt` with `videos/*.mp4` and uses `train_dense.yaml` followed by `train_sparse.yaml`. Stage 1 uses a CogVideoX-5B SAT checkpoint. The documented training path is text-to-video; the availability of image-to-video inference weights does not establish an equivalent training workflow.

### Trade-offs & Limitations
Compared with prompt-driven CogVideoX, Tora gives shot designers explicit control over the desired motion path. That is valuable when the direction or timing of motion matters, but it adds trajectory preparation, coordinate alignment, and output verification to the workflow. A motion-control project such as DragNUWA is a more relevant comparison when paths are mandatory; there is not enough matched evidence to rank their fidelity or throughput. Sparse prompts can weaken both visual quality and motion adherence, so keep prompt quality consistent when evaluating trajectories.

Diffusers is the better first deployment test for a memory-constrained workstation; SAT is the supplied route for the two-stage text-to-video training workflow. The inference and training VRAM figures are configuration-specific, not concurrent serving capacity estimates. Licensing is a separate decision: the repository is listed as Apache-2.0, but the Tora weights carry `CogVideoX_LICENSE` terms that must be reviewed before commercial use or redistribution.

### Hardware & Deployment Guide
For SAT, use Python 3.10–3.12; the example environment pairs PyTorch 2.4.0 with torchvision 0.19.0 and CUDA 12.1. Install `modules/SwissArmyTransformer` in editable mode and apply `sat/requirements.txt`. Download assets from Hugging Face, ModelScope, or direct links and arrange the T5, VAE, and selected task checkpoint under `sat/ckpts`. Run `sample_video.py` through `torchrun` for CLI inference or `sat/app.py` for the local Gradio demo. Once the assets and dependencies are in place, this is a local GPU path, not a hosted inference API dependency.

For a 16 GB workstation, evaluate Diffusers first: its reported inference footprint is around 5 GiB, versus about 30 GiB for the tested SAT text-to-video run on an A100. SAT text-to-video training was tested at about 60 GiB on an A100. The December 2024 Diffusers update added SageAttention2 and model compilation; the reported A10 speedup of approximately 52% applies to inference steps after the first, not to complete jobs. Image-to-video code and weights followed in January 2025. These milestones are project updates, not tagged GitHub releases.
```

## Key Capabilities
```text
- Backbone: Tora uses a CogVideoX-5B SAT configuration with a T5 text encoder and a 3D VAE.
- Motion conditioning: The Trajectory Extractor encodes paths into hierarchical spacetime patches, and the Motion-guidance Fuser injects them into DiT blocks.
- Input contract: SAT accepts prompt and point files, uses a 256×256 trajectory canvas, and pairs image-to-video prompts with first-frame filenames via `@@`.
- GPU fit: Diffusers reports around 5 GiB for inference; SAT text-to-video inference was tested at about 30 GiB on an A100.
- Training: `train_video.py` runs a dense-then-sparse text-to-video recipe, with a CogVideoX-5B SAT checkpoint for stage 1.
- Licensing: Tora weights are subject to `CogVideoX_LICENSE` separately from the repository's Apache-2.0 listing.
```

## Quick Start / Clone
```bash
# Clone this repository.
git clone https://github.com/alibaba/Tora.git
cd Tora

# Install Pytorch (we use Pytorch 2.4.0) and torchvision following the official instructions: https://pytorch.org/get-started/previous-versions/. For example:
conda create -n tora python==3.10
conda activate tora
conda install pytorch==2.4.0 torchvision==0.19.0 pytorch-cuda=12.1 -c pytorch -c nvidia

# Install requirements
cd modules/SwissArmyTransformer
pip install -e .
cd ../../sat
pip install -r requirements.txt
cd ..
```
