Skip to content

Commit

Permalink
sort hypernetworks and checkpoints by name
Browse files Browse the repository at this point in the history
  • Loading branch information
AUTOMATIC1111 committed Mar 28, 2023
1 parent 8c69bd0 commit 1b63afb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/hypernetworks/hypernetwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def shorthash(self):

def list_hypernetworks(path):
res = {}
for filename in sorted(glob.iglob(os.path.join(path, '**/*.pt'), recursive=True)):
for filename in sorted(glob.iglob(os.path.join(path, '**/*.pt'), recursive=True), key=str.lower):
name = os.path.splitext(os.path.basename(filename))[0]
# Prevent a hypothetical "None.pt" from being listed.
if name != "None":
Expand Down
2 changes: 1 addition & 1 deletion modules/sd_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def list_models():
elif cmd_ckpt is not None and cmd_ckpt != shared.default_sd_model_file:
print(f"Checkpoint in --ckpt argument not found (Possible it was moved to {model_path}: {cmd_ckpt}", file=sys.stderr)

for filename in model_list:
for filename in sorted(model_list, key=str.lower):
checkpoint_info = CheckpointInfo(filename)
checkpoint_info.register()

Expand Down

0 comments on commit 1b63afb

Please sign in to comment.