aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-08-17 07:54:07 +0300
committerAUTOMATIC1111 <16777216c@gmail.com>2023-08-17 07:54:07 +0300
commit0dc74545c0b5510911757ed9f2be703aab58f014 (patch)
tree7bd5a4b7826465e6c9e4005fe746f294705dd316 /modules
parenteaba3d7349c6f0e151be66ade3fdc848d693a10d (diff)
resolve the issue with loading fp16 checkpoints while using --no-half
Diffstat (limited to 'modules')
-rw-r--r--modules/sd_models.py5
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)