Text-to-Video
Diffusers
Safetensors
WanPipeline
physisserve
wan
autoregressive
video-generation
same-step-kv
Instructions to use Physis-AI/physisserve-wan2p2_5b-same_step-ls-dev with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Physis-AI/physisserve-wan2p2_5b-same_step-ls-dev with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Physis-AI/physisserve-wan2p2_5b-same_step-ls-dev", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
|
Download README.md from Physis-AI/physisserve-wan2p2_5b-same_step-ls-dev: direct link, hf CLI and curl.
- Browser
- Download file 3.71 kB
-
https://huggingface.co/Physis-AI/physisserve-wan2p2_5b-same_step-ls-dev/resolve/main/README.md
- Command line
-
hf download hf://Physis-AI/physisserve-wan2p2_5b-same_step-ls-dev/README.md
-
curl -L -o README.md https://huggingface.co/Physis-AI/physisserve-wan2p2_5b-same_step-ls-dev/resolve/main/README.md
3.71 kB
| library_name: diffusers | |
| pipeline_tag: text-to-video | |
| tags: | |
| - physisserve | |
| - wan | |
| - autoregressive | |
| - video-generation | |
| - same-step-kv | |
| - safetensors | |
| <p align="center"> | |
| <a href="https://github.com/Physis-AI/PhysisServe"> | |
| <img src="./assets/logo.png" alt="PhysisServe" width="180"> | |
| </a> | |
| </p> | |
| # 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. | |