--disable-image-log

This commit is contained in:
lllyasviel 2023-11-15 13:23:27 -08:00
parent 943098f8da
commit 3b97e49dd8
5 changed files with 13 additions and 2 deletions

View File

@ -16,6 +16,8 @@ fcbh_cli.parser.add_argument("--enable-smart-memory", action="store_true",
"Some Mac users may need this.")
fcbh_cli.parser.add_argument("--theme", type=str, help="launches the UI with light or dark theme", default=None)
fcbh_cli.parser.add_argument("--disable-image-log", action='store_true',
help="Prevent writing images and logs to hard drive.")
fcbh_cli.parser.set_defaults(
disable_cuda_malloc=True,

View File

@ -1 +1 @@
version = '2.1.819'
version = '2.1.820'

View File

@ -1,4 +1,5 @@
import os
import args_manager
import modules.config
from PIL import Image
@ -16,6 +17,9 @@ def get_current_html_path():
def log(img, dic, single_line_number=3):
if args_manager.args.disable_image_log:
return
date_string, local_temp_filename, only_name = generate_temp_filename(folder=modules.config.path_outputs, extension='png')
os.makedirs(os.path.dirname(local_temp_filename), exist_ok=True)
Image.fromarray(img).save(local_temp_filename)

View File

@ -1,3 +1,7 @@
# 2.1.820
* support "--disable-image-log" to prevent writing images and logs to hard drive.
# 2.1.819
* Allow disabling preview in dev tools.

View File

@ -222,7 +222,8 @@ with shared.gradio_root:
seed_random.change(random_checked, inputs=[seed_random], outputs=[image_seed], queue=False)
gr.HTML(f'<a href="/file={get_current_html_path()}" target="_blank">\U0001F4DA History Log</a>')
if not args_manager.args.disable_image_log:
gr.HTML(f'<a href="/file={get_current_html_path()}" target="_blank">\U0001F4DA History Log</a>')
with gr.Tab(label='Style'):
style_sorter.try_load_sorted_styles(