aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sd_models.py
diff options
context:
space:
mode:
authorDepFA <35278260+dfaker@users.noreply.github.com>2022-10-10 14:13:48 +0000
committerGitHub <noreply@github.com>2022-10-10 14:13:48 +0000
commitce2d7f7eaccbd1843835ca2d048d78ba5cb1ea13 (patch)
tree948c77a1ed9ed85278bc97ca02857b0c9efbd4b0 /modules/sd_models.py
parent4117afff11c7b0a2162c73ea02be8cfa30d02640 (diff)
parentce37fdd30e9fc0fe0bc5805a068ce8b11b42b5a3 (diff)
downloadstable-diffusion-webui-gfx803-ce2d7f7eaccbd1843835ca2d048d78ba5cb1ea13.tar.gz
stable-diffusion-webui-gfx803-ce2d7f7eaccbd1843835ca2d048d78ba5cb1ea13.tar.bz2
stable-diffusion-webui-gfx803-ce2d7f7eaccbd1843835ca2d048d78ba5cb1ea13.zip
Merge branch 'master' into embed-embeddings-in-images
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r--modules/sd_models.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py
index e63d3c29..2cdcd84f 100644
--- a/modules/sd_models.py
+++ b/modules/sd_models.py
@@ -149,6 +149,7 @@ def load_model_weights(model, checkpoint_info):
model.half()
devices.dtype = torch.float32 if shared.cmd_opts.no_half else torch.float16
+ devices.dtype_vae = torch.float32 if shared.cmd_opts.no_half or shared.cmd_opts.no_half_vae else torch.float16
vae_file = os.path.splitext(checkpoint_file)[0] + ".vae.pt"
if os.path.exists(vae_file):
@@ -158,6 +159,8 @@ def load_model_weights(model, checkpoint_info):
model.first_stage_model.load_state_dict(vae_dict)
+ model.first_stage_model.to(devices.dtype_vae)
+
model.sd_model_hash = sd_model_hash
model.sd_model_checkpoint = checkpoint_file
model.sd_checkpoint_info = checkpoint_info