Skip to content

Commit

Permalink
Merge pull request #26 from Rohan-Pa/main
Browse files Browse the repository at this point in the history
Typo and consistency fixes
  • Loading branch information
yfszzx authored Oct 30, 2022
2 parents 51fd743 + c3e21b3 commit c902cff
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions scripts/images_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from modules import script_callbacks
from pathlib import Path

faverate_tab_name = "favorites"
tabs_list = ["txt2img", "img2img", "extras", faverate_tab_name, "others"]
faverate_tab_name = "Favorites"
tabs_list = ["txt2img", "img2img", "Extras", faverate_tab_name, "Others"]
num_of_imgs_per_page = 0
loads_files_num = 0
path_recorder_filename = os.path.join(scripts.basedir(), "path_recorder.txt")
Expand Down Expand Up @@ -44,7 +44,9 @@ def same_name_file(basename, path):
def save_image(file_name):
if file_name is not None and os.path.exists(file_name):
reduplicative_file_move(file_name, opts.outdir_save)
return "<div style='color:#999'>Added to faverites</div>"
return "<div style='color:#999'>Moved to favorites</div>"
else:
return "<div style='color:#999'>Image not found (may have been already moved)</div>"

def delete_image(delete_num, name, filenames, image_index, visible_num):
if name == "":
Expand All @@ -70,7 +72,7 @@ def delete_image(delete_num, name, filenames, image_index, visible_num):
if os.path.exists(txt_file):
os.remove(txt_file)
else:
print(f"Not exists file {name}")
print(f"File does not exist {name}")
else:
new_file_list.append(name)
i += 1
Expand Down Expand Up @@ -149,7 +151,7 @@ def change_dir(img_dir, path_recorder, load_switch, img_path_history):
except:
warning = f"'{img_dir} is not a directory"
else:
warning = "The directory is not exist"
warning = "The directory does not exist"
except:
warning = "The format of the directory is incorrect"

Expand All @@ -172,7 +174,7 @@ def create_tab(tabname):
dir_name = opts.outdir_txt2img_samples
elif tabname == "img2img":
dir_name = opts.outdir_img2img_samples
elif tabname == "extras":
elif tabname == "Extras":
dir_name = opts.outdir_extras_samples
elif tabname == faverate_tab_name:
dir_name = opts.outdir_save
Expand Down Expand Up @@ -224,7 +226,7 @@ def create_tab(tabname):
img_file_time= gr.HTML()
with gr.Row(elem_id=tabname + "_images_history_button_panel") as button_panel:
if tabname != faverate_tab_name:
save_btn = gr.Button('Collect')
save_btn = gr.Button('Move to favorites')
try:
send_to_buttons = modules.generation_parameters_copypaste.create_buttons(["txt2img", "img2img", "inpaint", "extras"])
except:
Expand Down Expand Up @@ -320,4 +322,4 @@ def on_ui_settings():
#TODO:
#recycle bin
#move by arrow key
#generate info in txt
#generate info in txt

0 comments on commit c902cff

Please sign in to comment.