mirror of
https://github.com/vladmandic/automatic
synced 2026-09-08 05:48:42 +02:00
presort en
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -74,6 +74,7 @@ class StyleDatabase:
|
||||
list_folder(fn)
|
||||
|
||||
list_folder(self.path)
|
||||
self.styles = dict(sorted(self.styles.items(), key=lambda style: style[1].filename))
|
||||
log.debug(f'Loaded styles: folder={self.path} items={len(self.styles.keys())}')
|
||||
|
||||
def get_style_prompts(self, styles):
|
||||
|
||||
@@ -39,6 +39,7 @@ class ExtraNetworksPageTextualInversion(ui_extra_networks.ExtraNetworksPage):
|
||||
embeddings = list(sd_models.model_data.sd_model.embedding_db.word_embeddings.values())
|
||||
else:
|
||||
embeddings = []
|
||||
embeddings = list(sorted(embeddings, key=lambda emb: emb.filename))
|
||||
for embedding in embeddings:
|
||||
path, _ext = os.path.splitext(embedding.filename)
|
||||
tags = {}
|
||||
|
||||
Reference in New Issue
Block a user