File size: 309 Bytes
4620b21
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import torch
from safetensors.torch import load_file

# 1. 载入 safetensors 权重文件
safetensor_path = "diffusion_pytorch_model.safetensors"
state_dict = load_file(safetensor_path)

# 2. 保存为 PyTorch 的 .pth 格式
torch.save(state_dict, "Wan2.1_VAE.pth")

print("转换完成:Wan2.1_VAE.pth")