mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-03-07 22:31:50 -08:00
Fix displaying images that haven't already been saved
Still copies already_saved_as images to temp.
This commit is contained in:
parent
945cb97996
commit
83e0eb094f
1 changed files with 3 additions and 2 deletions
|
|
@ -31,7 +31,7 @@ def check_tmp_file(gradio, filename):
|
|||
return False
|
||||
|
||||
|
||||
def save_pil_to_file(pil_image, dir=None, format="png", cache_dir=None):
|
||||
def save_pil_to_file(pil_image, cache_dir=None, format="png"):
|
||||
already_saved_as = getattr(pil_image, 'already_saved_as', None)
|
||||
if already_saved_as and os.path.isfile(already_saved_as):
|
||||
register_tmp_file(shared.demo, already_saved_as)
|
||||
|
|
@ -42,9 +42,10 @@ def save_pil_to_file(pil_image, dir=None, format="png", cache_dir=None):
|
|||
|
||||
return filename
|
||||
|
||||
if shared.opts.temp_dir != "":
|
||||
if shared.opts.temp_dir:
|
||||
dir = shared.opts.temp_dir
|
||||
else:
|
||||
dir = cache_dir
|
||||
os.makedirs(dir, exist_ok=True)
|
||||
|
||||
use_metadata = False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue