Instructions to use lightx2v/Wan2.1-Distill-Models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use lightx2v/Wan2.1-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("Wan-AI/Wan2.1-T2V-14B,Wan-AI/Wan2.1-I2V-14B-480P,Wan-AI/Wan2.1-I2V-14B-720P", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("lightx2v/Wan2.1-Distill-Models") 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.1-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
- Local Apps
- Draw Things
KeyError: 'in_dim'
#2
by christopher5106 - opened
Hi,
I get this error:
File "/workspace/LightX2V/lightx2v/infer.py", line 115, in <module>
main()
File "/workspace/LightX2V/lightx2v/infer.py", line 104, in main
runner = init_runner(config)
^^^^^^^^^^^^^^^^^^^
File "/workspace/LightX2V/lightx2v/infer.py", line 26, in init_runner
runner.init_modules()
File "/workspace/LightX2V/lightx2v/models/runners/default_runner.py", line 39, in init_modules
self.load_model()
File "/workspace/LightX2V/lightx2v/utils/profiler.py", line 77, in sync_wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/workspace/LightX2V/lightx2v/models/runners/default_runner.py", line 86, in load_model
self.model = self.load_transformer()
^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/LightX2V/lightx2v/models/runners/wan/wan_distill_runner.py", line 34, in load_transformer
model = WanDistillModel(self.config["model_path"], self.config, self.init_device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/LightX2V/lightx2v/models/networks/wan/distill_model.py", line 22, in __init__
super().__init__(model_path, config, device, model_type)
File "/workspace/LightX2V/lightx2v/models/networks/wan/model.py", line 66, in __init__
self._init_weights()
File "/workspace/LightX2V/lightx2v/models/networks/wan/model.py", line 265, in _init_weights
self.pre_weight = self.pre_weight_class(self.config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/LightX2V/lightx2v/models/networks/wan/weights/pre_weights.py", line 13, in __init__
self.in_dim = config["in_dim"]
~~~~~~^^^^^^^^^^
KeyError: 'in_dim'