Merge pull request #283 from mi804/hunyuanvideo

hunyuanvideo text encoder
This commit is contained in:
Zhongjie Duan
2024-12-17 14:42:46 +08:00
committed by GitHub
13 changed files with 1351749 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
from diffsynth import ModelManager, HunyuanVideoPipeline, download_models
import torch
# Download models (automatically)
download_models(["HunyuanVideo"])
# Load models
model_manager = ModelManager(torch_dtype=torch.float16, device="cuda")
model_manager.load_models([
"t2i_models/HunyuanVideo/text_encoder/model.safetensors",
"t2i_models/HunyuanVideo/text_encoder_2",
])
pipe = HunyuanVideoPipeline.from_model_manager(model_manager)
prompt = 'A cat walks on the grass, realistic style.'
pipe(prompt)