Skip to content

Commit c902cff

Browse files
authored
Merge pull request #26 from Rohan-Pa/main
Typo and consistency fixes
2 parents 51fd743 + c3e21b3 commit c902cff

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

scripts/images_history.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
from modules import script_callbacks
1111
from pathlib import Path
1212

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

4951
def delete_image(delete_num, name, filenames, image_index, visible_num):
5052
if name == "":
@@ -70,7 +72,7 @@ def delete_image(delete_num, name, filenames, image_index, visible_num):
7072
if os.path.exists(txt_file):
7173
os.remove(txt_file)
7274
else:
73-
print(f"Not exists file {name}")
75+
print(f"File does not exist {name}")
7476
else:
7577
new_file_list.append(name)
7678
i += 1
@@ -149,7 +151,7 @@ def change_dir(img_dir, path_recorder, load_switch, img_path_history):
149151
except:
150152
warning = f"'{img_dir} is not a directory"
151153
else:
152-
warning = "The directory is not exist"
154+
warning = "The directory does not exist"
153155
except:
154156
warning = "The format of the directory is incorrect"
155157

@@ -172,7 +174,7 @@ def create_tab(tabname):
172174
dir_name = opts.outdir_txt2img_samples
173175
elif tabname == "img2img":
174176
dir_name = opts.outdir_img2img_samples
175-
elif tabname == "extras":
177+
elif tabname == "Extras":
176178
dir_name = opts.outdir_extras_samples
177179
elif tabname == faverate_tab_name:
178180
dir_name = opts.outdir_save
@@ -224,7 +226,7 @@ def create_tab(tabname):
224226
img_file_time= gr.HTML()
225227
with gr.Row(elem_id=tabname + "_images_history_button_panel") as button_panel:
226228
if tabname != faverate_tab_name:
227-
save_btn = gr.Button('Collect')
229+
save_btn = gr.Button('Move to favorites')
228230
try:
229231
send_to_buttons = modules.generation_parameters_copypaste.create_buttons(["txt2img", "img2img", "inpaint", "extras"])
230232
except:
@@ -320,4 +322,4 @@ def on_ui_settings():
320322
#TODO:
321323
#recycle bin
322324
#move by arrow key
323-
#generate info in txt
325+
#generate info in txt

0 commit comments

Comments
 (0)