diff options
author | Muhammad Rizqi Nur <rizqinur2010@gmail.com> | 2022-10-31 08:38:58 +0000 |
---|---|---|
committer | Muhammad Rizqi Nur <rizqinur2010@gmail.com> | 2022-10-31 08:38:58 +0000 |
commit | 36966e3200943dbf890b5338cfa939df552d3c47 (patch) | |
tree | 0ee8323f966471108c2c327c4f1d4747a889d069 /modules/sd_models.py | |
parent | d4790fa6db39e9f5960110326c5597b080d3b8dd (diff) | |
download | stable-diffusion-webui-gfx803-36966e3200943dbf890b5338cfa939df552d3c47.tar.gz stable-diffusion-webui-gfx803-36966e3200943dbf890b5338cfa939df552d3c47.tar.bz2 stable-diffusion-webui-gfx803-36966e3200943dbf890b5338cfa939df552d3c47.zip |
Fix #4035
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r-- | modules/sd_models.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py index f86dc3ed..a29c8c1a 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -201,7 +201,7 @@ def load_model_weights(model, checkpoint_info): if shared.opts.sd_checkpoint_cache > 0:
checkpoints_loaded[checkpoint_info] = model.state_dict().copy()
- while len(checkpoints_loaded) > shared.opts.sd_checkpoint_cache:
+ while len(checkpoints_loaded) > shared.opts.sd_checkpoint_cache + 1:
checkpoints_loaded.popitem(last=False) # LRU
else:
print(f"Loading weights [{sd_model_hash}] from cache")
|