--- base_model: Wan-AI/Wan2.1-T2V-1.3B-Diffusers license: apache-2.0 tags: - orbitquant - quantized - diffusers - diffusion-transformer --- # Wan-AI/Wan2.1-T2V-1.3B-Diffusers OrbitQuant W4A4 This repository contains a compact OrbitQuant transformer-component artifact for the source Diffusers model listed above. It is intended to be loaded into the original pipeline, not used as a standalone Diffusers pipeline repository. OrbitQuant is a calibration-free post-training quantization method for image and video diffusion transformers. This artifact keeps the text encoders, VAE, embeddings, timestep MLP, and final heads in the source precision by default and replaces the transformer linear projections with OrbitQuant modules. ## Usage Install OrbitQuant and the Hugging Face runtime dependencies: ```bash pip install "orbitquant[hf]" ``` Download this model repository as an OrbitQuant artifact, then load the source Diffusers pipeline with the quantized component patched in: ```python import torch from diffusers.utils import export_to_video from huggingface_hub import snapshot_download from orbitquant import load_quantized_pipeline_from_artifact artifact_id = "WaveCut/Wan2.1-T2V-1.3B-Diffusers-OrbitQuant-W4A4" artifact_dir = snapshot_download(artifact_id, repo_type="model") pipe = load_quantized_pipeline_from_artifact( artifact_dir, torch_dtype=torch.bfloat16, runtime_mode="auto_fused", ) pipe.enable_model_cpu_offload(device="cuda") frames = pipe( prompt="A cinematic shot of a small robot walking through a neon market", height=480, width=832, num_frames=81, num_inference_steps=50, guidance_scale=5.0, ).frames[0] export_to_video(frames, "wan-orbitquant.mp4", fps=16) ``` `runtime_mode="auto_fused"` is the default optimized runtime. On CUDA it tries the native packed low-bit matmul kernel first, then Triton packed matmul. On MPS it requires the native Metal packed matmul kernel. Use `runtime_mode="dequant_bf16"` only as an explicit compatibility/debug reference path. ## Native Settings Use these settings when comparing this artifact against the BF16 source model or the visual assets below: | Setting | Value | | --- | --- | | Pipeline | `WanPipeline` | | Resolution | `832x480` | | Frames | `81` | | Inference steps | `50` | | Guidance scale | `5.0` | | Export FPS | `16` | | Output | video | | Scope | paper video target | ## Validation Status - Native BF16-vs-OrbitQuant comparison: included when the visual matrix below is present. - Release-grade VBench metrics: not included in this artifact. - The model card reports artifact-level validation status only. ## Native Validation Evidence The compact benchmark summary records native BF16-vs-OrbitQuant evidence for the comparison matrix below. Detailed per-sample generation records are retained outside this compact artifact. | Evidence | Value | | --- | --- | | Comparison matrix | `assets/video_generation_comparison_matrix.webp` | | Paired prompt/seed count | `1` | | BF16 source generated samples | `1` | | BF16 source generated frames | `81` | | BF16 source nonempty outputs | `1` | | OrbitQuant generated samples | `1` | | OrbitQuant generated frames | `81` | | OrbitQuant nonempty outputs | `1` | ## Quantization - Method: `orbitquant` - Bits: `W4A4` - Runtime mode: `auto_fused` - Activation kernel backend: `auto` - Activation normalization epsilon: `1e-10` - Quantization device: `cuda` - Weight quantization backend: `triton_cuda` - Target policy: `wan` - AdaLN policy: `int4_rtn_group64_bf16_activation` - AdaLN group size: `64` - AdaLN group-size note: paper default. - Rotation: `rpbh` - Rotation seed: `0` - Block size: `paper` - Block size policy: `largest_power_of_two_dividing_dim` - Codebook: `lloyd_max` - Codebook version: `2` - Quantized transformer modules: `300` - AdaLN INT4 modules: `0` - Skipped modules: `6` - Calibration data: none - Text encoders and VAE: left in source precision by default ## Visual Comparison The following assets are stored in this artifact and compare the BF16 base generation against the OrbitQuant generation with the same prompt and seed. ![assets/video_generation_comparison_matrix.webp](assets/video_generation_comparison_matrix.webp) ## Source - Model: `Wan-AI/Wan2.1-T2V-1.3B-Diffusers` - Revision: `0fad780a534b6463e45facd96134c9f345acfa5b` - Source license: `apache-2.0` - OrbitQuant paper: https://arxiv.org/abs/2607.02461 ## Artifact Files - `model.safetensors`: packed OrbitQuant/INT4 module tensors. - `quantization_config.json`: serialized OrbitQuant runtime settings. - `orbitquant_manifest.json`: source provenance, policies, module lists, and checksums. - `orbitquant_codebooks.safetensors`: Lloyd-Max codebooks. - `orbitquant_rotations.safetensors`: deterministic RPBH rotation metadata. ## Limitations - This is a transformer-component artifact; load it into the source pipeline as shown above. - CUDA and MPS `auto_fused` inference requires a packed matmul kernel and fails loudly when the required kernel is unavailable. The explicit `dequant_bf16` reference mode materializes dequantized weights before BF16 matmul. - Quality depends on the source model and bit setting. Very low-bit settings can degrade prompt following or visual detail.