diff options
author | brkirch <brkirch@users.noreply.github.com> | 2023-01-15 13:13:33 +0000 |
---|---|---|
committer | brkirch <brkirch@users.noreply.github.com> | 2023-01-15 13:13:33 +0000 |
commit | eef1990a5e6c41ecb6943ff5529316ad5ededb2a (patch) | |
tree | cf26c01d537ca0d8d6208e97c0f59c88b5fab9fa | |
parent | ebfdd7baeb660ec66f78e1a0e5e45442025f262d (diff) | |
download | stable-diffusion-webui-gfx803-eef1990a5e6c41ecb6943ff5529316ad5ededb2a.tar.gz stable-diffusion-webui-gfx803-eef1990a5e6c41ecb6943ff5529316ad5ededb2a.tar.bz2 stable-diffusion-webui-gfx803-eef1990a5e6c41ecb6943ff5529316ad5ededb2a.zip |
Fix Approx NN on devices other than CUDA
-rw-r--r-- | modules/sd_vae_approx.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/sd_vae_approx.py b/modules/sd_vae_approx.py index 0a58542d..0027343a 100644 --- a/modules/sd_vae_approx.py +++ b/modules/sd_vae_approx.py @@ -36,7 +36,7 @@ def model(): if sd_vae_approx_model is None:
sd_vae_approx_model = VAEApprox()
- sd_vae_approx_model.load_state_dict(torch.load(os.path.join(paths.models_path, "VAE-approx", "model.pt")))
+ 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))
sd_vae_approx_model.eval()
sd_vae_approx_model.to(devices.device, devices.dtype)
|