--- library_name: diffusers pipeline_tag: text-to-video tags: - physisserve - wan - autoregressive - video-generation - same-step-kv - safetensors ---

PhysisServe

# PhysisServe — Wan2.2 5B A development release of **Wan2.2 5B** with autoregressive video weights trained by **Physis-AI** for same-step noisy-KV inference. The `ls-dev` suffix identifies Physis-AI-trained weights. [Code](https://github.com/Physis-AI/PhysisServe) · [Technical blog](https://physis-ai.com/blog/physisserve/en) · [Model collection](https://huggingface.co/collections/Physis-AI/physisserve-dev-model) These weights are intended for **PhysisServe's four-step autoregressive inference**. The Diffusers component layout does not make a stock Diffusers pipeline equivalent to this inference procedure: same-step KV caching, the attention sink, and the denoising schedule are implemented by PhysisServe. ## Inference profile The following defaults are defined by the PhysisServe model profile. | Setting | Default | | --- | --- | | Resolution (width × height) | 1280 × 704 | | Output FPS | 24 | | Denoising steps per chunk | 4 | | First chunk | 3 latent frames | | Each subsequent chunk | 1 latent frame | | Chunks per generation, including the first | 29 | | Attention sink | Clean bootstrap, σ = 0 | | KV history | Up to 18 recent chunks, plus the first-chunk sink without duplication | At denoising step `s`, a chunk reads noisy KV entries recorded at the same step `s` by preceding chunks. The first chunk is generated before the rest and receives an additional forward pass to build the persistent sink. A latent frame is not a decoded video frame; the VAE determines the temporal expansion. FPS is fixed by the model profile. ## Quick start Use Python 3.10+ with a CUDA-enabled PyTorch installation, then install PhysisServe: ```bash pip install "git+https://github.com/Physis-AI/PhysisServe.git" ``` Save the following as `generate.py` and run `python generate.py`. Adjust `pipeline_parallel_size` to your available GPUs and memory before running; `1` below is an API example, not a single-GPU memory guarantee. ```python import imageio.v3 as iio from physisserve import PhysisServe, SamplingParams def main(): model = PhysisServe( "Physis-AI/physisserve-wan2p2_5b-same_step-ls-dev", pipeline_parallel_size=1, ) sampling_params = SamplingParams(mode="offline_decode", seed=0) prompts = ["A corgi running along the beach at sunset."] outputs = model.generate(prompts, sampling_params) for index, output in enumerate(outputs): iio.imwrite( f"video-{index}.mp4", output["video"].numpy(), fps=output["fps"], codec="libx264", pixelformat="yuv420p", macro_block_size=None, output_params=["-movflags", "+faststart"], ) if __name__ == "__main__": main() ``` `offline_decode` saves latents under a separate directory in `./latents` for each call, waits for all streams to finish denoising, and then decodes them. Set `SamplingParams(latent_dir="your-directory", mode="offline_decode")` to change the save location. The example writes playable MP4 files; `generate()` itself does not write MP4s. A single prompt string or a list of prompts uses the same API. Multiple prompts create separate streams and increase memory demand. ## Acknowledgments We thank the [Wan](https://github.com/Wan-Video/Wan2.2) team for the base model and the [Diffusers](https://github.com/huggingface/diffusers) contributors for the model components.