mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-04 03:10:21 +00:00
Merge pull request #13957 from h43lb1t0/extra_network_subdirs
dir buttons start with / so only the correct dir will be shown and no…
This commit is contained in:
@@ -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("/"):
|
||||
|
Reference in New Issue
Block a user