Removed all submodules. Submodule free now, yay.

This commit is contained in:
Jaret Burkett
2025-04-18 10:39:15 -06:00
parent bd2de5b74e
commit bfe29e2151
18 changed files with 1246 additions and 62 deletions

20
toolkit/util/vae.py Normal file
View File

@@ -0,0 +1,20 @@
from diffusers import AutoencoderKL
def load_vae(vae_path, dtype):
try:
vae = AutoencoderKL.from_pretrained(
vae_path,
torch_dtype=dtype,
)
except Exception as e:
try:
vae = AutoencoderKL.from_pretrained(
vae_path.vae_path,
subfolder="vae",
torch_dtype=dtype,
)
except Exception as e:
raise ValueError(f"Failed to load VAE from {vae_path}: {e}")
vae.to(dtype)
return vae