diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-12-02 06:59:29 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-02 06:59:29 +0000 |
commit | 0bb6e00ba3c6775b17b3449c454c6efabb1bdad1 (patch) | |
tree | 4a92fb361793b90578e8b2c465a08cbb3df5d57f /modules/ui_extra_networks.py | |
parent | 87d973e389b5a0415430fecc1046415cd575f1d4 (diff) | |
parent | 314ae1535ea172fcdb0f5b3b2eecc5d4ce9112b5 (diff) | |
download | stable-diffusion-webui-gfx803-0bb6e00ba3c6775b17b3449c454c6efabb1bdad1.tar.gz stable-diffusion-webui-gfx803-0bb6e00ba3c6775b17b3449c454c6efabb1bdad1.tar.bz2 stable-diffusion-webui-gfx803-0bb6e00ba3c6775b17b3449c454c6efabb1bdad1.zip |
Merge pull request #13957 from h43lb1t0/extra_network_subdirs
dir buttons start with / so only the correct dir will be shown and no…
Diffstat (limited to 'modules/ui_extra_networks.py')
-rw-r--r-- | modules/ui_extra_networks.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py index f3b23cc9..fe5d3ba3 100644 --- a/modules/ui_extra_networks.py +++ b/modules/ui_extra_networks.py @@ -151,8 +151,13 @@ class ExtraNetworksPage: continue
subdir = os.path.abspath(x)[len(parentdir):].replace("\\", "/")
- while subdir.startswith("/"):
- subdir = subdir[1:]
+
+ if shared.opts.extra_networks_dir_button_function:
+ if not subdir.startswith("/"):
+ subdir = "/" + subdir
+ else:
+ while subdir.startswith("/"):
+ subdir = subdir[1:]
is_empty = len(os.listdir(x)) == 0
if not is_empty and not subdir.endswith("/"):
|