mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-21 07:30:02 +08:00
Fix #4035
This commit is contained in:
parent
d4790fa6db
commit
36966e3200
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user