Unverified Commit 006997d1 authored by AUTOMATIC1111's avatar AUTOMATIC1111 Committed by GitHub
Browse files

Merge pull request #6770 from brkirch/approx-nn-fix

Fix Approx NN not working on torch devices other than CUDA
parents d8b90ac1 eef1990a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)