support wanxvae

This commit is contained in:
mi804
2025-02-20 17:44:20 +08:00
parent 0c92f3b2cc
commit 491bbf5369
3 changed files with 660 additions and 0 deletions

18
examples/WanX/test_vae.py Normal file
View File

@@ -0,0 +1,18 @@
import torch
from diffsynth.models.wanx_vae import WanXVideoVAE
from diffsynth import ModelManager
model_manager = ModelManager(torch_dtype=torch.float, device="cuda")
model_manager.load_models([
"models/WanX/vae.pth",
])
vae = model_manager.fetch_model('wanxvideo_vae')
latents = [torch.load('sample.pt')]
videos = vae.decode(latents)
back_encode = vae.encode(videos)
print(latents)
print(videos)
print(back_encode)