mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-15 07:20:31 +08:00
Sort straight out of the glob
This commit is contained in:
parent
fd62727893
commit
08feb4c364
@ -219,12 +219,12 @@ class Hypernetwork:
|
||||
|
||||
def list_hypernetworks(path):
|
||||
res = {}
|
||||
for filename in glob.iglob(os.path.join(path, '**/*.pt'), recursive=True):
|
||||
for filename in sorted(glob.iglob(os.path.join(path, '**/*.pt'), recursive=True)):
|
||||
name = os.path.splitext(os.path.basename(filename))[0]
|
||||
# Prevent a hypothetical "None.pt" from being listed.
|
||||
if name != "None":
|
||||
res[name] = filename
|
||||
return dict(sorted(res.items()))
|
||||
return res
|
||||
|
||||
|
||||
def load_hypernetwork(filename):
|
||||
|
Loading…
Reference in New Issue
Block a user