pull/3/head
w-e-w 2022-10-26 16:36:00 +09:00
parent 3a7865d365
commit 6abf3dd318
1 changed files with 4 additions and 6 deletions

View File

@ -8,6 +8,7 @@ import modules.ui
from modules.shared import opts, cmd_opts
from modules import shared, scripts
from modules import script_callbacks
from pathlib import Path
faverate_tab_name = "favorites"
tabs_list = ["txt2img", "img2img", "extras", faverate_tab_name, "others"]
@ -183,16 +184,13 @@ def create_tab(tabname):
path = f.readline().rstrip("\n")
while len(path) > 0:
path_recorder.append(path)
path = f.readline().rstrip("\n")
path = f.readline().rstrip("\n")
if not custom_dir:
d = dir_name.split("/")
dir_name = "/" if dir_name.startswith("/") else d[0]
for p in d[1:]:
dir_name = os.path.join(dir_name, p)
dir_name = str(Path(dir_name))
if not os.path.exists(dir_name):
os.makedirs(dir_name)
with gr.Row(visible= custom_dir):
img_path = gr.Textbox(dir_name, label="Images directory", placeholder="Input images directory", interactive=custom_dir)
img_path_history = gr.Dropdown(path_recorder)