aboutsummaryrefslogtreecommitdiffstats
path: root/modules/ui_gradio_extensions.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-12-30 11:45:28 +0000
committerGitHub <noreply@github.com>2023-12-30 11:45:28 +0000
commitc9c105c7dbdca65c0fe62f78cd9c9d41f9a5af1f (patch)
treebb1f0cfec4cc874941f2429d43f68005bf00456f /modules/ui_gradio_extensions.py
parenta79890efd6774098a652887c20238f6c108be172 (diff)
parent892e703b59b2f867d8a202a52fab1db89882ef86 (diff)
downloadstable-diffusion-webui-gfx803-c9c105c7dbdca65c0fe62f78cd9c9d41f9a5af1f.tar.gz
stable-diffusion-webui-gfx803-c9c105c7dbdca65c0fe62f78cd9c9d41f9a5af1f.tar.bz2
stable-diffusion-webui-gfx803-c9c105c7dbdca65c0fe62f78cd9c9d41f9a5af1f.zip
Merge pull request #14446 from AUTOMATIC1111/base-output-path-off-data_path
Base output path off data path
Diffstat (limited to 'modules/ui_gradio_extensions.py')
-rw-r--r--modules/ui_gradio_extensions.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/modules/ui_gradio_extensions.py b/modules/ui_gradio_extensions.py
index 0d368f8b..a86c368e 100644
--- a/modules/ui_gradio_extensions.py
+++ b/modules/ui_gradio_extensions.py
@@ -1,17 +1,12 @@
import os
import gradio as gr
-from modules import localization, shared, scripts
-from modules.paths import script_path, data_path, cwd
+from modules import localization, shared, scripts, util
+from modules.paths import script_path, data_path
def webpath(fn):
- if fn.startswith(cwd):
- web_path = os.path.relpath(fn, cwd)
- else:
- web_path = os.path.abspath(fn)
-
- return f'file={web_path}?{os.path.getmtime(fn)}'
+ return f'file={util.truncate_path(fn)}?{os.path.getmtime(fn)}'
def javascript_html():