This commit is contained in:
Muhammad Rizqi Nur 2022-10-31 15:38:58 +07:00
parent d4790fa6db
commit 36966e3200

View File

@ -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")