Instructions to use lightx2v/Wan2.2-NVFP4-Sparse with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use lightx2v/Wan2.2-NVFP4-Sparse 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-NVFP4-Sparse", 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
ComfyUI is not working.
I cannot load it in ComfyUI ; it throws the following error:
mat1 and mat2 shapes cannot be multiplied (19320x5120 and 2560x5120)
ComfyUI\comfy\ops.py", line 366, in forward_comfy_cast_weights
x = torch.nn.functional.linear(input, weight, bias)
RuntimeError: mat1 and mat2 shapes cannot be multiplied (19320x5120 and 2560x5120)
The model isn't using same nvfp4 convention as ComfyUI, I've converted it here and tested on my 5090, the datatype is still the same so the conversion should be lossless:
https://huggingface.co/Kijai/WanVideo_comfy_nvfp4/tree/main/Lightx2v
Note that we don't have the sparse inference part currently available in ComfyUI, so this is just partial support, the model does seem to produce what looks like good quality outputs with normal dense attention too though.
Thanks, Kijai!
I've already started using it in ComfyUI. It really is fast—it seems to be the T2V version; they don't appear to have released the I2V version yet.
这个模型,可以工作在RTX3090-24GB 的显卡上吗?