diff options
author | Karun <karun.ellango7@gmail.com> | 2023-03-25 09:12:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-25 09:12:55 +0000 |
commit | 63a2f8d8225228a52b3ca7f19d2ba1fd07a6234b (patch) | |
tree | 9a7c38070d83b409895704125525dfc70cc21215 /modules/ui_extra_networks_checkpoints.py | |
parent | ca2b8faa83076a21dd14c974f03f88eb6da57485 (diff) | |
parent | 70615448b2ef3285dba9bb1992974cb1eaf10995 (diff) | |
download | stable-diffusion-webui-gfx803-63a2f8d8225228a52b3ca7f19d2ba1fd07a6234b.tar.gz stable-diffusion-webui-gfx803-63a2f8d8225228a52b3ca7f19d2ba1fd07a6234b.tar.bz2 stable-diffusion-webui-gfx803-63a2f8d8225228a52b3ca7f19d2ba1fd07a6234b.zip |
Merge branch 'master' into master
Diffstat (limited to 'modules/ui_extra_networks_checkpoints.py')
-rw-r--r-- | modules/ui_extra_networks_checkpoints.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/modules/ui_extra_networks_checkpoints.py b/modules/ui_extra_networks_checkpoints.py index 04097a79..a17aa9c9 100644 --- a/modules/ui_extra_networks_checkpoints.py +++ b/modules/ui_extra_networks_checkpoints.py @@ -1,7 +1,6 @@ import html
import json
import os
-import urllib.parse
from modules import shared, ui_extra_networks, sd_models
@@ -17,21 +16,14 @@ class ExtraNetworksPageCheckpoints(ui_extra_networks.ExtraNetworksPage): checkpoint: sd_models.CheckpointInfo
for name, checkpoint in sd_models.checkpoints_list.items():
path, ext = os.path.splitext(checkpoint.filename)
- previews = [path + ".png", path + ".preview.png"]
-
- preview = None
- for file in previews:
- if os.path.isfile(file):
- preview = self.link_preview(file)
- break
-
yield {
"name": checkpoint.name_for_extra,
"filename": path,
- "preview": preview,
+ "preview": self.find_preview(path),
+ "description": self.find_description(path),
"search_term": self.search_terms_from_path(checkpoint.filename) + " " + (checkpoint.sha256 or ""),
"onclick": '"' + html.escape(f"""return selectCheckpoint({json.dumps(name)})""") + '"',
- "local_preview": path + ".png",
+ "local_preview": f"{path}.{shared.opts.samples_format}",
}
def allowed_directories_for_previews(self):
|