Instructions to use lightx2v/Wan2.2-Distill-Models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use lightx2v/Wan2.2-Distill-Models with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("lightx2v/Wan2.2-Distill-Models", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Diffusion Single File
How to use lightx2v/Wan2.2-Distill-Models with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse filesdocs: update Wan2.2 distilled model inference instructions
README.md
CHANGED
|
@@ -170,23 +170,26 @@ Or refer to [Quick Start Documentation](https://lightx2v-zhcn.readthedocs.io/zh-
|
|
| 170 |
|
| 171 |
4. Select and modify configuration file
|
| 172 |
|
| 173 |
-
|
| 174 |
|
| 175 |
-
|
| 176 |
-
-
|
| 177 |
|
| 178 |
-
|
| 179 |
-
- I2V: [wan_moe_i2v_distill_4090.json](https://github.com/ModelTC/LightX2V/blob/main/configs/wan22/wan_moe_i2v_distill_4090.json)
|
| 180 |
|
|
|
|
| 181 |
|
| 182 |
-
5. Run inference
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
bash wan22/run_wan22_moe_i2v_distill.sh
|
| 186 |
-
```
|
| 187 |
|
| 188 |
-
|
| 189 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
|
| 191 |
#### LightX2V Documentation
|
| 192 |
- **Quick Start Guide**: [LightX2V Quick Start](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/getting_started/quickstart.html)
|
|
|
|
| 170 |
|
| 171 |
4. Select and modify configuration file
|
| 172 |
|
| 173 |
+
For the FP8 I2V weights downloaded above, choose:
|
| 174 |
|
| 175 |
+
- [FP8 configuration](https://github.com/ModelTC/LightX2V/blob/main/configs/distill/wan22/wan_moe_i2v_distill_quant.json)
|
| 176 |
+
- [RTX 4090 FP8 configuration with CPU offload](https://github.com/ModelTC/LightX2V/blob/main/configs/distill/wan22/wan_moe_i2v_distill_4090.json)
|
| 177 |
|
| 178 |
+
Set `high_noise_quantized_ckpt`, `low_noise_quantized_ckpt`, and `t5_quantized_ckpt` in the selected JSON to your local checkpoint paths. Use an attention backend supported by your GPU and installed environment.
|
|
|
|
| 179 |
|
| 180 |
+
For BF16 distilled weights, use the [BF16 configuration](https://github.com/ModelTC/LightX2V/blob/main/configs/distill/wan22/wan_moe_i2v_distill_model.json) instead, and update `high_noise_original_ckpt` and `low_noise_original_ckpt`.
|
| 181 |
|
| 182 |
+
5. Run inference
|
| 183 |
+
|
| 184 |
+
Edit the [I2V launch script](https://github.com/ModelTC/LightX2V/blob/main/scripts/wan22/inference/distill/run_wan22_moe_i2v_distill.sh): set `lightx2v_path`, `model_path`, `CUDA_VISIBLE_DEVICES`, and the input/output paths. Set `--config_json` to the configuration selected above.
|
|
|
|
|
|
|
| 185 |
|
| 186 |
+
Keep `model_path` pointed at the complete Wan2.2-I2V-A14B model directory containing the required encoders, tokenizer, and VAE.
|
| 187 |
|
| 188 |
+
Run from the LightX2V repository root:
|
| 189 |
+
|
| 190 |
+
```bash
|
| 191 |
+
bash scripts/wan22/inference/distill/run_wan22_moe_i2v_distill.sh
|
| 192 |
+
```
|
| 193 |
|
| 194 |
#### LightX2V Documentation
|
| 195 |
- **Quick Start Guide**: [LightX2V Quick Start](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/getting_started/quickstart.html)
|