aboutsummaryrefslogtreecommitdiff
path: root/modules/ui_extra_networks.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-07-08 16:45:59 +0300
committerAUTOMATIC1111 <16777216c@gmail.com>2023-07-08 16:45:59 +0300
commitd7d6e8cfc8b85a99a48f82975ee213d487783c28 (patch)
treedce93111020e5ce887be82e3cd904157154186a1 /modules/ui_extra_networks.py
parent7a6abc59ea1ecd8bb311de1719b018fb5960cd80 (diff)
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.py4
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):