Commit eebf4959 authored by cluder's avatar cluder

restore #4035 behavior

- if checkpoint cache is set to 1, keep 2 models in cache (current +1 more)
parent f37cce0e
......@@ -213,7 +213,7 @@ def load_model_weights(model, checkpoint_info, vae_file="auto"):
# clean up cache if limit is reached
if cache_enabled:
while len(checkpoints_loaded) > shared.opts.sd_checkpoint_cache:
while len(checkpoints_loaded) > shared.opts.sd_checkpoint_cache + 1: # we need to count the current model
checkpoints_loaded.popitem(last=False) # LRU
model.sd_model_hash = sd_model_hash
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment