diff options
author | JaredTherriault <noirjt@live.com> | 2023-09-04 17:29:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-04 17:29:33 -0700 |
commit | 5e16914a4e157ab3ed96f8b7841e1290a56f4484 (patch) | |
tree | 655f4582e692f0fc3667b3b668ad365ac3ab92ae /modules/ui_tempdir.py | |
parent | 8f3b02f09535f55d3673aa9ea589396b8614f799 (diff) | |
parent | 5ef669de080814067961f28357256e8fe27544f4 (diff) |
Merge branch 'AUTOMATIC1111:master' into master
Diffstat (limited to 'modules/ui_tempdir.py')
-rw-r--r-- | modules/ui_tempdir.py | 7 |
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():
|