modules/sd_vae_approx.py: fix VAE-approx path
This commit is contained in:
parent
8106117a47
commit
8e0d16e746
1 changed files with 4 additions and 1 deletions
|
@ -35,8 +35,11 @@ def model():
|
||||||
global sd_vae_approx_model
|
global sd_vae_approx_model
|
||||||
|
|
||||||
if sd_vae_approx_model is None:
|
if sd_vae_approx_model is None:
|
||||||
|
model_path = os.path.join(paths.models_path, "VAE-approx", "model.pt")
|
||||||
sd_vae_approx_model = VAEApprox()
|
sd_vae_approx_model = VAEApprox()
|
||||||
sd_vae_approx_model.load_state_dict(torch.load(os.path.join(paths.models_path, "VAE-approx", "model.pt"), map_location='cpu' if devices.device.type != 'cuda' else None))
|
if not os.path.exists(model_path):
|
||||||
|
model_path = os.path.join(paths.script_path, "models", "VAE-approx", "model.pt")
|
||||||
|
sd_vae_approx_model.load_state_dict(torch.load(model_path, map_location='cpu' if devices.device.type != 'cuda' else None))
|
||||||
sd_vae_approx_model.eval()
|
sd_vae_approx_model.eval()
|
||||||
sd_vae_approx_model.to(devices.device, devices.dtype)
|
sd_vae_approx_model.to(devices.device, devices.dtype)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue