diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-30 18:13:24 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-30 18:13:24 +0000 |
commit | d43333ff7193279acee5d7284b40902af351c9d7 (patch) | |
tree | 1e2efa67640655bf19696cfd9d4babc4e3d7aaf1 /modules/sd_samplers_common.py | |
parent | 0cdbd90d6b1ac19274ae249e17320096df1a5873 (diff) | |
download | stable-diffusion-webui-gfx803-d43333ff7193279acee5d7284b40902af351c9d7.tar.gz stable-diffusion-webui-gfx803-d43333ff7193279acee5d7284b40902af351c9d7.tar.bz2 stable-diffusion-webui-gfx803-d43333ff7193279acee5d7284b40902af351c9d7.zip |
fix an issue where VAE would remain in fp16 after an auto-switch to fp32
Diffstat (limited to 'modules/sd_samplers_common.py')
-rw-r--r-- | modules/sd_samplers_common.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/sd_samplers_common.py b/modules/sd_samplers_common.py index 6c935a38..58efcad2 100644 --- a/modules/sd_samplers_common.py +++ b/modules/sd_samplers_common.py @@ -95,6 +95,8 @@ def images_tensor_to_samples(image, approximation=None, model=None): else:
if model is None:
model = shared.sd_model
+ model.first_stage_model.to(devices.dtype_vae)
+
image = image.to(shared.device, dtype=devices.dtype_vae)
image = image * 2 - 1
if len(image) > 1:
|