Model reference · open weights
PAN2 is an open-weight video model from IFM. PAN2 (BF16) weighs 86.1 GB; the smallest configuration that runs it is H100 80 GB.
For self-hosting, compare this build's requirements below with the GPU you plan to rent.
Summary of the IFM/PAN2 model card, 2026-11-20
What it is
| Released by | IFM |
|---|---|
| Released | 2026-10-07 |
| Parameters | 29.2B |
| VRAM | 86.1 GB for the weights |
What it runs on
| Card | Weights | Memory |
|---|---|---|
| RTX 3060 12 GB … L40S 48 GB | does not fit | |
| A100 80 GB | tight (encoders offloaded) | 78.2 GB |
| H100 80 GB | tight (encoders offloaded) | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | tight | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | fits | 107 GB |
| H200 141 GB | fits | 138 GB |
| B200 180 GB | fits | 176 GB |
From the model card
Developed by the Institute of Foundation Models (IFM) at MBZUAI.
PAN 2 is a general-purpose world model: it simulates how the world will change in response to actions. Given a current observation (an optional image plus text) and actions described in text, it simulates the outcome as a video of up to 20 seconds. This supports simulative reasoning: an agent can imagine the outcomes of its candidate actions before choosing among them, by simulating each plan with PAN 2 and acting on the one whose simulated outcome is best.
PAN 2 follows the Generative Latent Prediction (GLP) architecture formalized in Critique of World Models and couples conceptual reasoning by a large language model with perceptual reasoning by a latent diffusion model. The language model, the conceptual reasoning backbone, reasons over the observation and the requested actions and writes the next world state as a structured, time-grounded description of events, timed actions bound to actors, and camera motion. The frozen text encoder maps the structured description to the conditioning features used by the diffusion model. The 29B-parameter MMDiT, the perceptual reasoning backbone, trained from scratch on hundreds of millions of videos annotated in the same format, predicts the perceptual detail that the description leaves open: the video latents that realize the state, conditioned on it and on the VAE latent of the starting image. The Wan 2.2 VAE decoder renders the predicted latents as the next observation, so every prediction can be seen and checked against real footage.
PAN 2's latent diffusion model is released as a single checkpoint that serves both tasks. The frozen text encoder (Qwen3.5-9B) and VAE (Wan 2.2) are downloaded from their own repositories.
| Checkpoint | Supported Tasks | Input Conditions | Output | Precision |
|---|---|---|---|---|
PAN 2 diffusion backbone (IFM/PAN2) | Text-to-video (t2v), Image-to-video (i2v) | Structured world-state caption; optional first frame | Video via the VAE decoder, 704x1248 at 24 fps, up to 20 s | BF16 |
PAN 2 is also supported in Diffusers and vLLM; the instructions below use this repository's generate.py.
The released perceptual backbone weights are in the diffusers layout (PAN2Transformer3DModel). Download them and convert them once for this repository's generate.py:
hf download IFM/PAN2 --include "transformer/*" --local-dir /path/to/PAN2
python scripts/convert_checkpoint.py to-native \
--input /path/to/PAN2/transformer --output /transformer
Then pass /transformer as CKPT_PATH below.
Environment (see docs/environment.md):
conda create -n pan python=3.14 -y && conda activate pan
pip install torch==2.12.1 torchvision==0.27.1 --index-url https://download.pytorch.org/whl/cu132
pip install --pre "flash-attn-4[cu13]==4.0.0b29" --no-build-isolation
pip install "quack-kernels[cu13]==0.6.4"
pip install -r requirements.txt
Frozen components (text encoder and VAE, fetched from the Hugging Face cache at HF_HOME):
export HF_HOME=YOUR_HF_PATH
hf download Qwen/Qwen3.5-9B
hf download Wan-AI/Wan2.2-TI2V-5B-Diffusers
Checkpoint. CKPT_PATH is a training checkpoint-N/transformer directory (DCP), a model_state.pt, or a directory of *.safetensors. The architecture is read from config/sft_29B_720p.yaml; no model root is needed.
Generate (single node, one generate.py worker per GPU; each worker holds the full 29B diffusion model and takes every N-th prompt):
bash inference/inference.sh [PROMPTS_JSON] # or sbatch, same arguments
PROMPTS_JSON defaults to inference/prompts/examples.json (one t2v and one i2v record with structured negatives and a reference image). Any entry with an image_path (or type: i2v) runs as image-to-video. Videos land in /{t2v,i2v}/ next to a *_config.json; a rerun into the same directory skips finished clips.
Default sampler:
| Control | Value |
|---|---|
| Steps / flow shift | 50 / 9 |
| Classifier-free guidance | 2.5 on every step |
| Resolution / frame rate | 704 x 1248 at 24 fps |
| Frames | 241 (about 10 s) for entries without a duration; up to 481 (20 s) |
| Seed | 123 |
| Precision | bf16 transformer |
| I2V | temporal latent 0 uses the positive prediction without guidance |
Override any default through environment variables (NUM_STEPS, FLOW_SHIFT, GUIDANCE_SCALE, VIDEO_LENGTH, SEED, NUM_GPUS, ...) or pass extra generate.py flags in EXTRA_ARGS (CFG windows, skip-layer guidance, timestep schedules). See docs/inference.md.
The full workflow runs the conceptual reasoner on a free-text prompt, then the locally deployed perceptual pipeline on its structured output.
See docs/inference.md for the prompt JSON format.
The PAN 2 perceptual backbone is conditioned on structured world-state captions, so prompts work best in that format. Free-text prompts should be rewritten by a conceptual reasoner before generation.
inference/prompts_rewritter.py: offline rewriting with a local instruction-tuned model.Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.
Running it yourself
Rent a machine by the hour. ComfyUI is installed on it. Open ComfyUI through the tunnel and load the workflow from the model's card on Hugging Face; choose this model's file in its loader.
# on your rented machine (the ssh line is on its page in the console)
# get REPO FILE FOLDER: one file into /workspace/models/FOLDER, where ComfyUI loads it from
get() { hf download "$1" "$2" --local-dir /workspace/hf-files && mkdir -p "/workspace/models/$3" && mv "/workspace/hf-files/$2" "/workspace/models/$3/$4"; }
# the model (6.0 GB)
get IFM/PAN2 transformer/diffusion_pytorch_model-00014-of-00014.safetensors diffusion_models
get IFM/PAN2 vae/diffusion_pytorch_model.safetensors vae
start-comfyui
# on your computer, in a second terminal: ComfyUI in your browser at http://localhost:8188
# HOST, PORT and BOOKING are your machine's, from its page in the console
ssh -o HostKeyAlias=axforge-BOOKING -o StrictHostKeyChecking=accept-new -L 8188:localhost:8188 dev@HOST -p PORT