Skip to content

Commit 54193c4

Browse files
committed
Ugly workaround to fix gradio tempfile issue
Closes #273
1 parent e20abe9 commit 54193c4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/depthmap.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@
4949
except:
5050
sys.path.append('extensions/stable-diffusion-webui-depthmap-script')
5151

52+
# Ugly workaround to fix gradio tempfile issue
53+
def ensure_gradio_temp_directory():
54+
try:
55+
import tempfile
56+
path = os.path.join(tempfile.gettempdir(), 'gradio')
57+
if not (os.path.exists(path)):
58+
os.mkdir(path)
59+
except Exception as e:
60+
traceback.print_exc()
61+
ensure_gradio_temp_directory()
62+
5263

5364
from scripts.stereoimage_generation import create_stereoimages
5465

0 commit comments

Comments
 (0)