Skip to content

Commit eebf495

Browse files
committed
restore #4035 behavior
- if checkpoint cache is set to 1, keep 2 models in cache (current +1 more)
1 parent f37cce0 commit eebf495

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/sd_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def load_model_weights(model, checkpoint_info, vae_file="auto"):
213213

214214
# clean up cache if limit is reached
215215
if cache_enabled:
216-
while len(checkpoints_loaded) > shared.opts.sd_checkpoint_cache:
216+
while len(checkpoints_loaded) > shared.opts.sd_checkpoint_cache + 1: # we need to count the current model
217217
checkpoints_loaded.popitem(last=False) # LRU
218218

219219
model.sd_model_hash = sd_model_hash

0 commit comments

Comments
 (0)