diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-29 06:11:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-29 06:11:00 +0000 |
commit | 76086f6668bddba82d8b47e0f3c5c6068990cbde (patch) | |
tree | 791d0a85ed84f93188e0220c0ffb90e0347f4059 /modules/sd_models.py | |
parent | 403c5dba86f0faac6746df24d16e4d08aab8c9c5 (diff) | |
parent | 02b547861e11632c5a6dbe15fb0d219aa167d0c1 (diff) | |
download | stable-diffusion-webui-gfx803-76086f6668bddba82d8b47e0f3c5c6068990cbde.tar.gz stable-diffusion-webui-gfx803-76086f6668bddba82d8b47e0f3c5c6068990cbde.tar.bz2 stable-diffusion-webui-gfx803-76086f6668bddba82d8b47e0f3c5c6068990cbde.zip |
Merge branch 'master' into modal-save-button-and-shortcut
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r-- | modules/sd_models.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py index e697bb72..64d5ee0d 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -3,6 +3,7 @@ import os.path import sys
from collections import namedtuple
import torch
+import re
from omegaconf import OmegaConf
from ldm.util import instantiate_from_config
@@ -35,8 +36,10 @@ def setup_model(): list_models()
-def checkpoint_tiles():
- return sorted([x.title for x in checkpoints_list.values()])
+def checkpoint_tiles():
+ convert = lambda name: int(name) if name.isdigit() else name.lower()
+ alphanumeric_key = lambda key: [convert(c) for c in re.split('([0-9]+)', key)]
+ return sorted([x.title for x in checkpoints_list.values()], key = alphanumeric_key)
def list_models():
|