Instructions to use diffusers/HunyuanVideo-vae with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use diffusers/HunyuanVideo-vae with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("diffusers/HunyuanVideo-vae", 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
Update handler.py
Browse files- handler.py +1 -0
handler.py
CHANGED
|
@@ -11,6 +11,7 @@ class EndpointHandler:
|
|
| 11 |
self.device = "cuda"
|
| 12 |
self.dtype = torch.float16
|
| 13 |
self.vae = cast(AutoencoderKLHunyuanVideo, AutoencoderKLHunyuanVideo.from_pretrained(path, torch_dtype=self.dtype).to(self.device, self.dtype).eval())
|
|
|
|
| 14 |
|
| 15 |
self.vae_scale_factor = self.vae_scale_factor_spatial = self.vae.spatial_compression_ratio
|
| 16 |
self.video_processor = VideoProcessor(
|
|
|
|
| 11 |
self.device = "cuda"
|
| 12 |
self.dtype = torch.float16
|
| 13 |
self.vae = cast(AutoencoderKLHunyuanVideo, AutoencoderKLHunyuanVideo.from_pretrained(path, torch_dtype=self.dtype).to(self.device, self.dtype).eval())
|
| 14 |
+
self.vae.enable_tiling()
|
| 15 |
|
| 16 |
self.vae_scale_factor = self.vae_scale_factor_spatial = self.vae.spatial_compression_ratio
|
| 17 |
self.video_processor = VideoProcessor(
|