diff options
author | yfszzx <yfszzx@gmail.com> | 2022-10-17 14:28:43 +0000 |
---|---|---|
committer | yfszzx <yfszzx@gmail.com> | 2022-10-17 14:28:43 +0000 |
commit | c408a0b41cfffde184cad35b2d97346342947d83 (patch) | |
tree | 6ed6999778070ce00de4f24d940ee24b32f140f2 /modules/images_history.py | |
parent | 9d702b16f01795c3af900e0ebd70faf4b25200f6 (diff) | |
download | stable-diffusion-webui-gfx803-c408a0b41cfffde184cad35b2d97346342947d83.tar.gz stable-diffusion-webui-gfx803-c408a0b41cfffde184cad35b2d97346342947d83.tar.bz2 stable-diffusion-webui-gfx803-c408a0b41cfffde184cad35b2d97346342947d83.zip |
fix two bug
Diffstat (limited to 'modules/images_history.py')
-rw-r--r-- | modules/images_history.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/images_history.py b/modules/images_history.py index 1ae168ca..10e5b970 100644 --- a/modules/images_history.py +++ b/modules/images_history.py @@ -181,7 +181,8 @@ def delete_image(delete_num, name, filenames, image_index, visible_num): return new_file_list, 1, visible_num def save_image(file_name): - shutil.copy2(file_name, opts.outdir_save) + if file_name is not None and os.path.exists(file_name): + shutil.copy2(file_name, opts.outdir_save) def get_recent_images(page_index, step, filenames): page_index = int(page_index) @@ -327,7 +328,6 @@ def create_history_tabs(gr, sys_opts, run_pnginfo, switch_dict): opts = sys_opts loads_files_num = int(opts.images_history_num_per_page) num_of_imgs_per_page = int(opts.images_history_num_per_page * opts.images_history_pages_num) - backup_flag = opts.images_history_backup with gr.Blocks(analytics_enabled=False) as images_history: with gr.Tabs() as tabs: for tab in ["txt2img", "img2img", "extras", "saved"]: |