aboutsummaryrefslogtreecommitdiffstats
path: root/modules/ui.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-10-15 12:44:46 +0000
committerAUTOMATIC <16777216c@gmail.com>2022-10-15 12:44:46 +0000
commit20a1f68c752f8e37492ea00911c97bfc572a6e67 (patch)
treeb963a3d32ce9c65869c1a5ef725e90686e14268b /modules/ui.py
parentd3463bc59a44d62c2de8b357184c49876d84f654 (diff)
downloadstable-diffusion-webui-gfx803-20a1f68c752f8e37492ea00911c97bfc572a6e67.tar.gz
stable-diffusion-webui-gfx803-20a1f68c752f8e37492ea00911c97bfc572a6e67.tar.bz2
stable-diffusion-webui-gfx803-20a1f68c752f8e37492ea00911c97bfc572a6e67.zip
fix gadio issue with sending files between tabs
Diffstat (limited to 'modules/ui.py')
-rw-r--r--modules/ui.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/ui.py b/modules/ui.py
index cab8ab11..c9b53247 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -91,6 +91,14 @@ def plaintext_to_html(text):
def image_from_url_text(filedata):
+ if type(filedata) == dict and filedata["is_file"]:
+ filename = filedata["name"]
+ tempdir = os.path.normpath(tempfile.gettempdir())
+ normfn = os.path.normpath(filename)
+ assert normfn.startswith(tempdir), 'trying to open image file not in temporary directory'
+
+ return Image.open(filename)
+
if type(filedata) == list:
if len(filedata) == 0:
return None