mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-12-15 14:50:55 -08:00
option "open image button" open the actual dir
This commit is contained in:
parent
4ff1fabc86
commit
a18e54ecd7
3 changed files with 54 additions and 17 deletions
|
|
@ -81,3 +81,18 @@ def cleanup_tmpdr():
|
|||
|
||||
filename = os.path.join(root, name)
|
||||
os.remove(filename)
|
||||
|
||||
|
||||
def is_gradio_temp_path(path):
|
||||
"""
|
||||
Check if the path is a temp dir used by gradio
|
||||
"""
|
||||
path = Path(path)
|
||||
if shared.opts.temp_dir and path.is_relative_to(shared.opts.temp_dir):
|
||||
return True
|
||||
if gradio_temp_dir := os.environ.get("GRADIO_TEMP_DIR"):
|
||||
if path.is_relative_to(gradio_temp_dir):
|
||||
return True
|
||||
if path.is_relative_to(Path(tempfile.gettempdir()) / "gradio"):
|
||||
return True
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue