sand-ai/MAGI-2-preview
Summary
Sand.ai releases MAGI-2 Preview, a 114B-parameter unified audio-video generation model that activates only 6B parameters per token, built on MagiMoE and co-designed across architecture, systems, and data to explore an efficient path to scaling video generation.
View Cached Full Text
Cached at: 11/26/26, 09:56 AM
sand-ai/MAGI-2-preview · Hugging Face
Source: https://huggingface.co/sand-ai/MAGI-2-preview

Magi-2 Preview is a 114B-parameter unified audio-video generation model that activates just 6B parameters per token. Built on MagiMoE and co-designed across architecture, systems, and data, it explores an efficient path to scaling video generation. The architecture, the training system built around it, and the data pipeline are described inMAGI-2 Preview: Scaling Video Generation Models Efficiently; the weights are on Hugging Face atsand-ai/MAGI-2-preview.
This repository is the inference code. It generates video from a text prompt (T2V) or from a prompt plus a still image (I2V), with sound generated alongside the video and muxed into the output file. Clips are 10 seconds long, which is the only duration the model currently supports. Generation runs in two stages:magi2\_previewdenoises the clip at low resolution, andmagi2\_refinertakes that result up to 1080p.
https://huggingface.co/sand-ai/MAGI-2-preview#requirementsRequirements
- NVIDIA Hopper GPUs, 8 of them.
- Python 3.12 and a recent CUDA toolkit.
ffmpegonPATH, to mux the audio track. Without it the video is still written, just silently.
https://huggingface.co/sand-ai/MAGI-2-preview#setupSetup
https://huggingface.co/sand-ai/MAGI-2-preview#dockerDocker
The published image,sandai/magi-2-preview, already has the dependencies built, including the ones that need a compiler:
docker pull sandai/magi-2-preview:latest
docker run --gpus all -it -v /path/to/ckpt:/workspace/ckpt sandai/magi-2-preview:latest
There is a tag per commit as well,sandai/magi\-2\-preview:<commit\>. Name that one when reporting a result, becauselatestmoves; the image also records what it was built from in/etc/magi2\-build\-info.
Building it yourself is only necessary to change a dependency version, or to work somewhere the registry is not reachable:
docker build -t magi-2-preview:local .
https://huggingface.co/sand-ai/MAGI-2-preview#from-sourceFrom source
pip install -r requirements.txt
MAGI-2 also needsMagiAttentionandMagiCompiler. The pinned revisions are recorded as build args in theDockerfile.
https://huggingface.co/sand-ai/MAGI-2-preview#checkpointsCheckpoints
Weights are not bundled with the code. Everything the pipeline loads lives in one Hugging Face repository,sand-ai/MAGI-2-preview, roughly 307 GB in total. Download it intockpt/in the repository root, which is gitignored:
pip install huggingface_hub
hf download sand-ai/MAGI-2-preview --local-dir ckpt
The directory names in that repository are the ones the configs already expect, so nothing needs renaming afterwards:
ckpt/
├── preview/ # preview stage: 56 safetensors shards + index
├── refiner/ # refiner stage: 3 shards + index
├── text_encoder/ # text encoder
├── vae/ # video VAE
│ └── Wan2.2_VAE.pth
├── stable-audio-open-1.0/ # audio VAE
└── turbo_vae/ # fast VAE decoder
├── TurboV3-Wan22-TinyShallow_7_7.json
└── checkpoint.ckpt
DirectorySizeContentspreview228 GBPreview-stage transformer, released with MAGI-2text\_encoder56 GBText encoder,Qwen/Qwen3.5-27Brefiner14 GBRefiner-stage transformer, released with MAGI-2stable\-audio\-open\-1\.05 GBAudio VAE, decodes the generated audio latentsvae3 GBVideo VAE, fromWan-AI/Wan2.2-TI2V-5Bturbo\_vae2 GBDistilled VAE decoder, used for decoding by default
The configs underconfigs/reference these as$\{MAGI2\_CKPT\_ROOT\}/<name\>, and that variable defaults to<repo\>/ckpt. To keep weights somewhere else, point it at them rather than editing the configs:
export MAGI2_CKPT_ROOT=/data/magi2-weights
https://huggingface.co/sand-ai/MAGI-2-preview#promptsPrompts
The captions the model was trained on are long and structured, so a prompt written by hand underuses it. Two system prompts for a prompt-enhancement LLM are included:prompts/t2v\.mdfor text to video, andprompts/i2v\.mdfor a prompt plus a still image.
Use one as the system prompt of an instruction-following model, pass the raw prompt as the message (the still as well, for I2V), and feed the JSON caption it returns to the pipeline in place of the prompt. Both lay out the 10 seconds the model generates.
assets/has both ends of that step.sample\_000\.txtthroughsample\_002\.txtare raw prompts, the kind you would hand to the enhancer;sample\_enhanced\_t2v\.jsonis the shape one comes back in. The demo batch runs both, so enhancing is not a precondition for generating.
https://huggingface.co/sand-ai/MAGI-2-preview#running-inferenceRunning inference
scripts/run\_demo\.shlaunchesinference/pipeline/entry\.pyundertorchrunon every visible GPU. It generates at 1080p, with seed 42 and the batch inassets/demo\_samples\.json:
bash scripts/run_demo.sh
SAMPLES=my_samples.json bash scripts/run_demo.sh # a different batch
OUTPUT_DIR=output/run7 bash scripts/run_demo.sh
The script takesSAMPLES,OUTPUT\_DIR,SEEDandMASTER\_PORTfrom the environment. Videos land in$OUTPUT\_DIR/sample\_000\.mp4and up, numbered by position in the batch.
A samples file is a JSON array with one entry per video. An entry carries its prompt inline aspromptor as a path inprompt\_file, and a first frame inimage; leavingimageout makes it a T2V entry. The shipped batch runs the three stills inassets/as I2V, the same three prompts again as T2V, andassets/sample\_enhanced\_t2v\.json.
For a single clip, call the entry point directly:
torchrun --nproc_per_node=8 inference/pipeline/entry.py \
--prompt "a red fox in snow" --output output/
It also takes\-\-prompt\-file,\-\-image,\-\-seed,\-\-config,\-\-output\-width/\-\-output\-height,\-\-num\-inference\-steps,\-\-refiner\-num\-inference\-stepsand\-\-deterministic. Of these only\-\-seed,\-\-samplesand\-\-outputare reachable throughrun\_demo\.sh.
1080p runsconfigs/magi2\_refiner\.json: the preview stage generates 512x896 and the refiner takes that to 1088x1920.magi2\_refiner\.jsonextendsmagi2\_preview\.jsonand carries only what the refiner stage adds, so a shared setting is edited in one place.
1080p is a delivery tier, not the shape that gets generated. The VAE stride constrains every generated dimension to a multiple of 16, so the tier generates 1088 wide rather than 1080, and the video is written at that generated shape. Pass\-\-output\-widthand\-\-output\-heightto have the finished video rescaled to an exact size, 1080x1920 the way the reference delivers the tier.
Four environment variables decide where each large component sits between phases:MAGI2\_TEXT\_ENC\_OFFLOAD\_MODE,MAGI2\_PREVIEW\_OFFLOAD\_MODE,MAGI2\_REFINER\_OFFLOAD\_MODEandMAGI2\_VAE\_OFFLOAD\_MODE, each one ofcpu,gpuorroundtrip. The preview and the refiner default toroundtrip, staged in and out around the stage that needs them, because at 1080p neither fits on an 80GB card next to the other’s activations.
Decoding uses the distilled turbo decoder fromckpt/turbo\_vae, a temporal sliding window that runs on one rank per video.MAGI2\_DETERMINISTIC=1, or\-\-deterministic, makes the MoE scatter and the attention kernels bit-exact at some cost in speed.MAGI2\_SAVE\_LATENT\_PATHwrites the post-refiner latent of each sample to that directory.
https://huggingface.co/sand-ai/MAGI-2-preview#licenseLicense
Apache 2.0. SeeLICENSE.
Similar Articles
MAGI-2
Sand AI released MAGI-2, a 480B-parameter model for cinematic video generation, expanding on its MAGI-1 video model.
MAGI-2: A 480B Frontier Video Generation Model (10 minute read)
Sand.ai launches MAGI-2, a 480B-parameter (28B active) flagship video generation model trained on 4T tokens, capable of up to 30 seconds of 1080p native audio-video with omni-reference, timeline control, and video editing, boosting Artificial Analysis Video Arena Elo by +151.8 over its preview.
@kaifulee: Congratulations to https://Sand.ai on the launch of MAGI-2, its next-generation video generation model.
Sand.ai announced MAGI-2, its next-generation video generation model capable of producing up to 30 seconds of native 1080p audio-video content in a single pass, with features like multimodal referencing, precise editing, and autonomous camera planning; 400B-parameter open weights are said to be coming soon.
@hidecloud: Awesome! More open video models are coming.
MAGI-2 is introduced as a new open video generation model that turns text, images, video and audio into up to 30 seconds of 1080p video with sound, with 400B-parameter open weights coming soon, priced at $0.08 per second.
@hasantoxr: MAGI-2 just launched and the price is the craziest part Frontier level AI video. Native 1080p. Up to 30 seconds in a si…
MAGI-2 has launched, offering frontier-level AI video generation with native 1080p output, up to 30-second single generations, and built-in synced audio at a fraction of Seedance 2.5's price.