Skip to content

Commit

Permalink
connect with new webui
Browse files Browse the repository at this point in the history
  • Loading branch information
yfszzx committed Oct 27, 2022
2 parents 1817533 + 3d9c93c commit 51fd743
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
path_recorder.txt
10 changes: 4 additions & 6 deletions scripts/images_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
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"]
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 51fd743

Please sign in to comment.