presort en

This commit is contained in:
Vladimir Mandic
2023-09-16 17:36:03 -04:00
parent 12d6173b57
commit 2daf61ae7a
3 changed files with 5 additions and 0 deletions
+3
View File
@@ -149,6 +149,7 @@ def checkpoint_tiles(use_short=False): # pylint: disable=unused-argument
def list_models():
t0 = time.time()
global checkpoints_list # pylint: disable=global-statement
checkpoints_list.clear()
checkpoint_aliases.clear()
if shared.opts.sd_disable_ckpt or shared.backend == shared.Backend.DIFFUSERS:
@@ -175,6 +176,7 @@ def list_models():
shared.log.warning(f"Checkpoint not found: {shared.cmd_opts.ckpt}")
shared.log.info(f'Available models: {shared.opts.ckpt_dir} items={len(checkpoints_list)} time={time.time()-t0:.2f}s')
checkpoints_list = dict(sorted(checkpoints_list.items(), key=lambda cp: cp[1].filename))
if len(checkpoints_list) == 0:
if not shared.cmd_opts.no_download:
key = input('Download the default model? (y/N) ')
@@ -193,6 +195,7 @@ def list_models():
if checkpoint_info.name is not None:
checkpoint_info.register()
def update_model_hashes():
txt = []
lst = [ckpt for ckpt in checkpoints_list.values() if ckpt.hash is None]