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
Upload folder using huggingface_hub
Browse files- handler.py +2 -2
handler.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
from typing import Dict, List, Any
|
| 2 |
import torch
|
| 3 |
-
from base64 import b64decode
|
| 4 |
from diffusers import AutoencoderKLHunyuanVideo
|
| 5 |
from diffusers.video_processor import VideoProcessor
|
| 6 |
from diffusers.utils import export_to_video
|
|
@@ -61,4 +61,4 @@ class EndpointHandler:
|
|
| 61 |
with open(path, "rb") as f:
|
| 62 |
video = f.read()
|
| 63 |
|
| 64 |
-
return video
|
|
|
|
| 1 |
from typing import Dict, List, Any
|
| 2 |
import torch
|
| 3 |
+
from base64 import b64decode, b64encode
|
| 4 |
from diffusers import AutoencoderKLHunyuanVideo
|
| 5 |
from diffusers.video_processor import VideoProcessor
|
| 6 |
from diffusers.utils import export_to_video
|
|
|
|
| 61 |
with open(path, "rb") as f:
|
| 62 |
video = f.read()
|
| 63 |
|
| 64 |
+
return {'bytes': b64encode(video).decode("utf-8")}
|