| 223 | return inp |
| 224 | |
| 225 | def 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 | |
| 245 | def depthmap_mode_video(inp): |