mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-02-12 00:22:55 +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:
|
if shared.opts.sd_checkpoint_cache > 0:
|
||||||
checkpoints_loaded[checkpoint_info] = model.state_dict().copy()
|
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
|
checkpoints_loaded.popitem(last=False) # LRU
|
||||||
else:
|
else:
|
||||||
print(f"Loading weights [{sd_model_hash}] from cache")
|
print(f"Loading weights [{sd_model_hash}] from cache")
|
||||||
|
Loading…
Reference in New Issue
Block a user