aboutsummaryrefslogtreecommitdiffstats
path: root/modules/ui_tempdir.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-08-28 12:03:46 +0000
committerGitHub <noreply@github.com>2023-08-28 12:03:46 +0000
commit9e14cac3182b53173f1c356f2f13bd1cb0cedc89 (patch)
tree12b4e04a8f17c4275c26bc23870cab0535e053e0 /modules/ui_tempdir.py
parentf898833ea38718e87b39ab090b2a2325638559cb (diff)
parent8632452627e1341bcd447dbec3c1516f319200a0 (diff)
downloadstable-diffusion-webui-gfx803-9e14cac3182b53173f1c356f2f13bd1cb0cedc89.tar.gz
stable-diffusion-webui-gfx803-9e14cac3182b53173f1c356f2f13bd1cb0cedc89.tar.bz2
stable-diffusion-webui-gfx803-9e14cac3182b53173f1c356f2f13bd1cb0cedc89.zip
Merge branch 'dev' into patch-1
Diffstat (limited to 'modules/ui_tempdir.py')
-rw-r--r--modules/ui_tempdir.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/ui_tempdir.py b/modules/ui_tempdir.py
index fb75137e..85015db5 100644
--- a/modules/ui_tempdir.py
+++ b/modules/ui_tempdir.py
@@ -44,6 +44,8 @@ def save_pil_to_file(self, pil_image, dir=None, format="png"):
if shared.opts.temp_dir != "":
dir = shared.opts.temp_dir
+ else:
+ os.makedirs(dir, exist_ok=True)
use_metadata = False
metadata = PngImagePlugin.PngInfo()
@@ -57,8 +59,9 @@ def save_pil_to_file(self, pil_image, dir=None, format="png"):
return file_obj.name
-# override save to file function so that it also writes PNG info
-gradio.components.IOComponent.pil_to_temp_file = save_pil_to_file
+def install_ui_tempdir_override():
+ """override save to file function so that it also writes PNG info"""
+ gradio.components.IOComponent.pil_to_temp_file = save_pil_to_file
def on_tmpdir_changed():