aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-09-30 05:55:54 +0000
committerGitHub <noreply@github.com>2023-09-30 05:55:54 +0000
commitcdafbcaad28dbd4517dc7f2c25c6445a1a9f77d7 (patch)
tree42024b1243473b03c914422c8024a11f450ec2a4
parent34055f9d0cf7ec9431c6cb1ed0853a2ac1d5a42e (diff)
parent8e355fbd7552f1a7f5124c4685d6fa36f3d0ede1 (diff)
downloadstable-diffusion-webui-gfx803-cdafbcaad28dbd4517dc7f2c25c6445a1a9f77d7.tar.gz
stable-diffusion-webui-gfx803-cdafbcaad28dbd4517dc7f2c25c6445a1a9f77d7.tar.bz2
stable-diffusion-webui-gfx803-cdafbcaad28dbd4517dc7f2c25c6445a1a9f77d7.zip
Merge pull request #13313 from chu8129/dev
use orderdict as lru cache:opt/bug
-rw-r--r--modules/sd_models.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py
index 930d0bee..eedb38c6 100644
--- a/modules/sd_models.py
+++ b/modules/sd_models.py
@@ -309,6 +309,8 @@ def get_checkpoint_state_dict(checkpoint_info: CheckpointInfo, timer):
if checkpoint_info in checkpoints_loaded:
# use checkpoint cache
print(f"Loading weights [{sd_model_hash}] from cache")
+ # move to end as latest
+ checkpoints_loaded.move_to_end(checkpoint_info)
return checkpoints_loaded[checkpoint_info]
print(f"Loading weights [{sd_model_hash}] from {checkpoint_info.filename}")