Skip to content

Commit cdafbca

Browse files
Merge pull request AUTOMATIC1111#13313 from chu8129/dev
use orderdict as lru cache:opt/bug
2 parents 34055f9 + 8e355fb commit cdafbca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/sd_models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ def get_checkpoint_state_dict(checkpoint_info: CheckpointInfo, timer):
309309
if checkpoint_info in checkpoints_loaded:
310310
# use checkpoint cache
311311
print(f"Loading weights [{sd_model_hash}] from cache")
312+
# move to end as latest
313+
checkpoints_loaded.move_to_end(checkpoint_info)
312314
return checkpoints_loaded[checkpoint_info]
313315

314316
print(f"Loading weights [{sd_model_hash}] from {checkpoint_info.filename}")

0 commit comments

Comments
 (0)