diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-08 13:45:59 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-08 13:45:59 +0000 |
commit | d7d6e8cfc8b85a99a48f82975ee213d487783c28 (patch) | |
tree | dce93111020e5ce887be82e3cd904157154186a1 /modules/ui_extra_networks.py | |
parent | 7a6abc59ea1ecd8bb311de1719b018fb5960cd80 (diff) | |
download | stable-diffusion-webui-gfx803-d7d6e8cfc8b85a99a48f82975ee213d487783c28.tar.gz stable-diffusion-webui-gfx803-d7d6e8cfc8b85a99a48f82975ee213d487783c28.tar.bz2 stable-diffusion-webui-gfx803-d7d6e8cfc8b85a99a48f82975ee213d487783c28.zip |
use natural sort for shared.walk_files and shared.listfiles, as well as for dirs in extra networks
Diffstat (limited to 'modules/ui_extra_networks.py')
-rw-r--r-- | modules/ui_extra_networks.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py index 1efd00b0..693cafb6 100644 --- a/modules/ui_extra_networks.py +++ b/modules/ui_extra_networks.py @@ -90,8 +90,8 @@ class ExtraNetworksPage: subdirs = {}
for parentdir in [os.path.abspath(x) for x in self.allowed_directories_for_previews()]:
- for root, dirs, _ in os.walk(parentdir, followlinks=True):
- for dirname in dirs:
+ for root, dirs, _ in sorted(os.walk(parentdir, followlinks=True), key=lambda x: shared.natural_sort_key(x[0])):
+ for dirname in sorted(dirs, key=shared.natural_sort_key):
x = os.path.join(root, dirname)
if not os.path.isdir(x):
|