Instructions to use lightx2v/Hy1.5-Quantized-Models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use lightx2v/Hy1.5-Quantized-Models with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image, export_to_video # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("lightx2v/Hy1.5-Quantized-Models", dtype=torch.bfloat16, device_map="cuda") pipe.to("cuda") prompt = "A man with short gray hair plays a red electric guitar." image = load_image( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png" ) output = pipe(image=image, prompt=prompt).frames[0] export_to_video(output, "output.mp4") - Diffusion Single File
How to use lightx2v/Hy1.5-Quantized-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 files
README.md
CHANGED
|
@@ -93,6 +93,14 @@ pipe.enable_offload(
|
|
| 93 |
vae_offload=False,
|
| 94 |
)
|
| 95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
# Create generator
|
| 97 |
pipe.create_generator(
|
| 98 |
attn_mode="sage_attn2",
|
|
@@ -142,6 +150,14 @@ pipe.enable_quantize(
|
|
| 142 |
image_encoder_quantized=False,
|
| 143 |
)
|
| 144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
# Optional: Enable offloading for lower VRAM usage
|
| 146 |
pipe.enable_offload(
|
| 147 |
cpu_offload=True,
|
|
|
|
| 93 |
vae_offload=False,
|
| 94 |
)
|
| 95 |
|
| 96 |
+
# Optional: Use lighttae
|
| 97 |
+
pipe.enable_lightvae(
|
| 98 |
+
use_tae=True,
|
| 99 |
+
tae_path="/path/to/lighttaehy1_5.safetensors",
|
| 100 |
+
use_lightvae=False,
|
| 101 |
+
vae_path=None,
|
| 102 |
+
)
|
| 103 |
+
|
| 104 |
# Create generator
|
| 105 |
pipe.create_generator(
|
| 106 |
attn_mode="sage_attn2",
|
|
|
|
| 150 |
image_encoder_quantized=False,
|
| 151 |
)
|
| 152 |
|
| 153 |
+
# Optional: Use lighttae
|
| 154 |
+
pipe.enable_lightvae(
|
| 155 |
+
use_tae=True,
|
| 156 |
+
tae_path="/path/to/lighttaehy1_5.safetensors",
|
| 157 |
+
use_lightvae=False,
|
| 158 |
+
vae_path=None,
|
| 159 |
+
)
|
| 160 |
+
|
| 161 |
# Optional: Enable offloading for lower VRAM usage
|
| 162 |
pipe.enable_offload(
|
| 163 |
cpu_offload=True,
|