mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-12-06 10:31:17 -08:00
Fix alphas cumprod
This commit is contained in:
parent
4830b25136
commit
bf5067f50c
2 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue