mirror of
https://github.com/modelscope/DiffSynth-Studio.git
synced 2026-03-19 23:08:13 +00:00
19 lines
425 B
Python
19 lines
425 B
Python
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)
|