diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-17 04:54:07 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-17 04:54:07 +0000 |
commit | 0dc74545c0b5510911757ed9f2be703aab58f014 (patch) | |
tree | 7bd5a4b7826465e6c9e4005fe746f294705dd316 /modules/sd_models.py | |
parent | eaba3d7349c6f0e151be66ade3fdc848d693a10d (diff) | |
download | stable-diffusion-webui-gfx803-0dc74545c0b5510911757ed9f2be703aab58f014.tar.gz stable-diffusion-webui-gfx803-0dc74545c0b5510911757ed9f2be703aab58f014.tar.bz2 stable-diffusion-webui-gfx803-0dc74545c0b5510911757ed9f2be703aab58f014.zip |
resolve the issue with loading fp16 checkpoints while using --no-half
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r-- | modules/sd_models.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py index f912fe16..685585b1 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -343,7 +343,10 @@ def load_model_weights(model, checkpoint_info: CheckpointInfo, state_dict, timer model.to(memory_format=torch.channels_last)
timer.record("apply channels_last")
- if not shared.cmd_opts.no_half:
+ if shared.cmd_opts.no_half:
+ model.float()
+ timer.record("apply float()")
+ else:
vae = model.first_stage_model
depth_model = getattr(model, 'depth_model', None)
|