diff options
author | Kohaku-Blueleaf <59680068+KohakuBlueleaf@users.noreply.github.com> | 2023-10-25 03:53:37 +0000 |
---|---|---|
committer | Kohaku-Blueleaf <59680068+KohakuBlueleaf@users.noreply.github.com> | 2023-10-25 03:53:37 +0000 |
commit | 4830b251366436ee8499c003fe87e46ddb4a4581 (patch) | |
tree | 5c7cd5befb2f030fdbb5158ae52bad7f6e5997fb /modules/sd_models.py | |
parent | 1df6c8bfec4715610d64684b6ad2fa38c76c1df6 (diff) | |
download | stable-diffusion-webui-gfx803-4830b251366436ee8499c003fe87e46ddb4a4581.tar.gz stable-diffusion-webui-gfx803-4830b251366436ee8499c003fe87e46ddb4a4581.tar.bz2 stable-diffusion-webui-gfx803-4830b251366436ee8499c003fe87e46ddb4a4581.zip |
Fix alphas_cumprod dtype
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r-- | modules/sd_models.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py index 69395294..23660454 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -416,6 +416,7 @@ 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
|