mirror of
https://github.com/modelscope/DiffSynth-Studio.git
synced 2026-03-20 15:48:20 +00:00
support wanxvae
This commit is contained in:
18
examples/WanX/test_vae.py
Normal file
18
examples/WanX/test_vae.py
Normal 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)
|
||||
Reference in New Issue
Block a user