make it possible to search checkpoint by its hash
This commit is contained in:
parent
399720dac2
commit
847ceae1f7
|
@ -14,6 +14,7 @@ class ExtraNetworksPageCheckpoints(ui_extra_networks.ExtraNetworksPage):
|
||||||
shared.refresh_checkpoints()
|
shared.refresh_checkpoints()
|
||||||
|
|
||||||
def list_items(self):
|
def list_items(self):
|
||||||
|
checkpoint: sd_models.CheckpointInfo
|
||||||
for name, checkpoint in sd_models.checkpoints_list.items():
|
for name, checkpoint in sd_models.checkpoints_list.items():
|
||||||
path, ext = os.path.splitext(checkpoint.filename)
|
path, ext = os.path.splitext(checkpoint.filename)
|
||||||
previews = [path + ".png", path + ".preview.png"]
|
previews = [path + ".png", path + ".preview.png"]
|
||||||
|
@ -28,7 +29,7 @@ class ExtraNetworksPageCheckpoints(ui_extra_networks.ExtraNetworksPage):
|
||||||
"name": checkpoint.name_for_extra,
|
"name": checkpoint.name_for_extra,
|
||||||
"filename": path,
|
"filename": path,
|
||||||
"preview": preview,
|
"preview": preview,
|
||||||
"search_term": self.search_terms_from_path(checkpoint.filename),
|
"search_term": self.search_terms_from_path(checkpoint.filename) + " " + (checkpoint.sha256 or ""),
|
||||||
"onclick": '"' + html.escape(f"""return selectCheckpoint({json.dumps(name)})""") + '"',
|
"onclick": '"' + html.escape(f"""return selectCheckpoint({json.dumps(name)})""") + '"',
|
||||||
"local_preview": path + ".png",
|
"local_preview": path + ".png",
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue