diff options
author | Kohaku-Blueleaf <59680068+KohakuBlueleaf@users.noreply.github.com> | 2023-10-25 04:54:28 +0000 |
---|---|---|
committer | Kohaku-Blueleaf <59680068+KohakuBlueleaf@users.noreply.github.com> | 2023-10-25 04:54:28 +0000 |
commit | bf5067f50ca32cd4764638702e3cc38bca8bfd8b (patch) | |
tree | 85c3e8faaee5e626db2d4d88287d4ad9f7f5c379 /modules/sd_models.py | |
parent | 4830b251366436ee8499c003fe87e46ddb4a4581 (diff) | |
download | stable-diffusion-webui-gfx803-bf5067f50ca32cd4764638702e3cc38bca8bfd8b.tar.gz stable-diffusion-webui-gfx803-bf5067f50ca32cd4764638702e3cc38bca8bfd8b.tar.bz2 stable-diffusion-webui-gfx803-bf5067f50ca32cd4764638702e3cc38bca8bfd8b.zip |
Fix alphas cumprod
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r-- | modules/sd_models.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py index 23660454..7ed89a9c 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -396,6 +396,8 @@ def load_model_weights(model, checkpoint_info: CheckpointInfo, state_dict, timer enable_fp8 = True
elif model.is_sdxl and shared.cmd_opts.opt_unet_fp8_storage_xl:
enable_fp8 = True
+ else:
+ enable_fp8 = False
if enable_fp8:
devices.fp8 = True
@@ -416,7 +418,6 @@ def load_model_weights(model, checkpoint_info: CheckpointInfo, state_dict, timer module.to(torch.float8_e4m3fn)
model.model.diffusion_model = model.model.diffusion_model.to(torch.float8_e4m3fn)
timer.record("apply fp8 unet")
- model.alphas_cumprod = model.alphas_cumprod.to(torch.float32)
devices.unet_needs_upcast = shared.cmd_opts.upcast_sampling and devices.dtype == torch.float16 and devices.dtype_unet == torch.float16
|