aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMuhammad Rizqi Nur <rizqinur2010@gmail.com>2022-10-31 15:38:58 +0700
committerMuhammad Rizqi Nur <rizqinur2010@gmail.com>2022-10-31 15:38:58 +0700
commit36966e3200943dbf890b5338cfa939df552d3c47 (patch)
tree0ee8323f966471108c2c327c4f1d4747a889d069 /modules
parentd4790fa6db39e9f5960110326c5597b080d3b8dd (diff)
Fix #4035
Diffstat (limited to 'modules')
-rw-r--r--modules/sd_models.py2
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")