# Repository Briefing: SandAI-org/MAGI-1
> Source: https://repoforai.com/repo/SandAI-org/MAGI-1 (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/SandAI-org/MAGI-1
- **Official Docs / Website**: https://sand.ai
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: B (54/100 · Maintenance 12/35 · Adoption 16/25 · Releases 6/20 · License 20/20)
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: GPU, CLI
- **Momentum**: 3,841 ★ total (+2 24h / +12 7d) · 245 forks
- **Topics**: `autoregressive`, `diffusion-models`, `video-generation`
- **When to Use**: Best for: Teams with NVIDIA GPU capacity that need self-hosted image animation, video-prefix continuation, or prompt changes within a sequence, and can benchmark checkpoints against their own workloads. Skip if: You need a turnkey hosted API, a CPU-only runtime, or a verified real-time SLA out of the box, or cannot operate the multi-GPU setup needed for the 24B variants.

## Overview
```text
### Architecture & Core Mechanics
MAGI-1 combines autoregression across video chunks with joint diffusion denoising within each 24-frame chunk. During training, noise increases across successive chunks, and block-causal attention preserves the temporal ordering. At inference, the next chunk can begin before the current one finishes denoising, allowing up to four chunks in flight. That overlap is a generation mechanism, not a measured real-time guarantee.

T5 supplies text conditioning and a Transformer VAE compresses video latents by 8× spatially and 4× temporally. The diffusion backbone combines parallel attention blocks, QK normalization, grouped-query attention, and SwiGLU feed-forward layers. The Python stack targets PyTorch 2.4.0 and CUDA 12.4, with pinned `diffusers`, `transformers`, `flash-attn`, and `flashinfer-python` dependencies. The repository separates inference code, example launch scripts, and ComfyUI custom nodes into `inference/`, `example/`, and `comfyui/`.

### Key Capabilities & Differentiators
MagiPipeline exposes text-to-video (`t2v`), image-to-video (`i2v`), and continuation from a supplied video prefix (`v2v`). Chunk-wise prompting gives operators a way to change instructions over the course of a sequence rather than relying on one static prompt. Both the 4.5B and 24B families offer base, distilled, and distilled FP8 checkpoints. Shortcut distillation uses step-consistency training to support different inference budgets with a single distilled model.

The reported Physics-IQ continuation scores are 56.02 for 24B and 42.44 for 4.5B, compared with 29.50 for VideoPoet in V2V. In I2V, the 24B score is 30.23. Treat these as separate conditioning regimes: V2V has motion history in its prefix, and its score does not predict the same result from a single image. Evaluate continuity and instruction following on your own footage, especially over multiple prompt changes.

### Trade-offs & Limitations
Choose MAGI-1 for video-prefix continuation and timed prompt changes, not on the assumption that it is universally better than Wan 2.1, HunyuanVideo, or a hosted option such as Kling. The human comparison is in-house, and Physics-IQ measures a specific aspect of physical behavior. Before selecting a checkpoint, compare visual quality, motion, and instruction following on representative inputs under matched output settings.

The 4.5B variants have a practical single-card starting point: one RTX 4090. The reference setup for 24B base and distilled is eight H100/H800 GPUs, while distilled FP8 lowers that to four H100/H800 GPUs or eight RTX 4090s. The latter still requires operating a multi-GPU job. No exact VRAM or latency budget is established for a target workload; measure peak memory, startup latency, and sustained throughput at the intended resolution, clip length, and concurrency.

### Hardware & Deployment Guide
The container path uses `sandai/magi:latest` with NVIDIA GPUs. The example grants privileged access and shares the host network and IPC while requesting 32 GB of shared memory; do not adopt those permissions as production defaults without reviewing which settings are necessary. The source path uses Python 3.10.12, PyTorch 2.4.0 with CUDA 12.4, and FFmpeg 4.4. MagiAttention is recommended on Hopper and is not required on non-Hopper GPUs.

Stage the chosen MAGI checkpoint plus the T5 and VAE weights, then configure and launch `example/4.5B/run.sh` or `example/24B/run.sh`. This is a local GPU inference path, not a packaged serving API. Repository milestones include ComfyUI support in May 2025 and the availability of MAGI-1.1 24B weights in June 2026; the concrete sizing guidance above applies to the listed MAGI-1 variants. No GitHub release is listed, so pin the repository revision, container digest, and checkpoint revisions for reproducibility.
```

## Key Capabilities
```text
- Causal denoising: Generates 24-frame chunks with block-causal attention and overlaps denoising across up to four chunks.
- Latent video: Transformer VAE compresses spatial dimensions by 8× and the temporal dimension by 4×.
- Conditioning: T5 text conditioning, image input, video-prefix continuation, and chunk-wise prompts address different control needs.
- Checkpoint variants: 4.5B and 24B families each offer base, distilled, and distilled FP8 checkpoints.
- Multi-GPU configuration: The eight-RTX-4090 24B setup uses `pp_size: 2` and `cp_size: 4`.
- Integration: Example CLI scripts cover both model sizes, with ComfyUI custom nodes for visual workflows.
```

## Quick Start / Clone
```bash
docker pull sandai/magi:latest

docker run -it --gpus all --privileged --shm-size=32g --name magi --net=host --ipc=host --ulimit memlock=-1 --ulimit stack=6710886 sandai/magi:latest /bin/bash
```
