mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-12-06 02:30:30 -08:00
Merge pull request #14947 from AUTOMATIC1111/open-button
option "open image button" open the actual dir
This commit is contained in:
parent
3345218439
commit
cb52279c3e
3 changed files with 51 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