Instructions to use Gjm1234/Wan2.2-I2V-A14B-Diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Gjm1234/Wan2.2-I2V-A14B-Diffusers with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Gjm1234/Wan2.2-I2V-A14B-Diffusers", 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 handler.py from Gjm1234/Wan2.2-I2V-A14B-Diffusers: direct link, hf CLI and curl.
- Browser
- Download file 413 Bytes
-
https://huggingface.co/Gjm1234/Wan2.2-I2V-A14B-Diffusers/resolve/main/handler.py
- Command line
-
hf download hf://Gjm1234/Wan2.2-I2V-A14B-Diffusers/handler.py
-
curl -L -o handler.py https://huggingface.co/Gjm1234/Wan2.2-I2V-A14B-Diffusers/resolve/main/handler.py
413 Bytes
| import torch | |
| from diffusers import DiffusionPipeline | |
| class EndpointHandler: | |
| def __init__(self, model_dir): | |
| self.pipe = DiffusionPipeline.from_pretrained( | |
| model_dir, | |
| custom_pipeline="pipeline_wan_i2v", | |
| torch_dtype=torch.float16 | |
| ).to("cuda") | |
| def __call__(self, data): | |
| image = data["image"] | |
| output = self.pipe(image) | |
| return output |