MCPcopy Create free account
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / open_folder_action

Function open_folder_action

src/common_ui.py:225–242  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

223 return inp
224
225def open_folder_action():
226 # Adapted from stable-diffusion-webui
227 f = backbone.get_outpath()
228 if backbone.get_cmd_opt('hide_ui_dir_config', False):
229 return
230 if not os.path.exists(f) or not os.path.isdir(f):
231 raise Exception("Couldn't open output folder") # .isdir is security-related, do not remove!
232 import platform
233 import subprocess as sp
234 path = os.path.normpath(f)
235 if platform.system() == "Windows":
236 os.startfile(path)
237 elif platform.system() == "Darwin":
238 sp.Popen(["open", path])
239 elif "microsoft-standard-WSL2" in platform.uname().release:
240 sp.Popen(["wsl-open", path])
241 else:
242 sp.Popen(["xdg-open", path])
243
244
245def depthmap_mode_video(inp):

Callers 1

on_ui_tabsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected