aboutsummaryrefslogtreecommitdiffstats
path: root/modules/ui_extra_networks_checkpoints.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-06-27 06:02:38 +0000
committerGitHub <noreply@github.com>2023-06-27 06:02:38 +0000
commit58a9a261c4feb729717c386fea70f8ea985c6722 (patch)
treeebc822c17a889034672297d7450477f7c945cbb7 /modules/ui_extra_networks_checkpoints.py
parent373ff5a217eca33607abb692b9ebfa38abb7fe33 (diff)
parent2c43dd766da52d2ccaaa78d8f265a6a4aa33b9df (diff)
downloadstable-diffusion-webui-gfx803-58a9a261c4feb729717c386fea70f8ea985c6722.tar.gz
stable-diffusion-webui-gfx803-58a9a261c4feb729717c386fea70f8ea985c6722.tar.bz2
stable-diffusion-webui-gfx803-58a9a261c4feb729717c386fea70f8ea985c6722.zip
Merge branch 'dev' into meta_class
Diffstat (limited to 'modules/ui_extra_networks_checkpoints.py')
-rw-r--r--modules/ui_extra_networks_checkpoints.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/ui_extra_networks_checkpoints.py b/modules/ui_extra_networks_checkpoints.py
index a17aa9c9..8b9ab71b 100644
--- a/modules/ui_extra_networks_checkpoints.py
+++ b/modules/ui_extra_networks_checkpoints.py
@@ -14,7 +14,7 @@ class ExtraNetworksPageCheckpoints(ui_extra_networks.ExtraNetworksPage):
def list_items(self):
checkpoint: sd_models.CheckpointInfo
- for name, checkpoint in sd_models.checkpoints_list.items():
+ for index, (name, checkpoint) in enumerate(sd_models.checkpoints_list.items()):
path, ext = os.path.splitext(checkpoint.filename)
yield {
"name": checkpoint.name_for_extra,
@@ -24,6 +24,8 @@ class ExtraNetworksPageCheckpoints(ui_extra_networks.ExtraNetworksPage):
"search_term": self.search_terms_from_path(checkpoint.filename) + " " + (checkpoint.sha256 or ""),
"onclick": '"' + html.escape(f"""return selectCheckpoint({json.dumps(name)})""") + '"',
"local_preview": f"{path}.{shared.opts.samples_format}",
+ "sort_keys": {'default': index, **self.get_sort_keys(checkpoint.filename)},
+
}
def allowed_directories_for_previews(self):