aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorw-e-w <40751091+w-e-w@users.noreply.github.com>2023-12-27 21:52:41 +0000
committerw-e-w <40751091+w-e-w@users.noreply.github.com>2023-12-27 21:52:41 +0000
commit892e703b59b2f867d8a202a52fab1db89882ef86 (patch)
treeea933ef98dfec80747d5592740f986ed8526d1ec
parentaf2951ed53da6d357aea9232538f9ea7e1cdc648 (diff)
downloadstable-diffusion-webui-gfx803-892e703b59b2f867d8a202a52fab1db89882ef86.tar.gz
stable-diffusion-webui-gfx803-892e703b59b2f867d8a202a52fab1db89882ef86.tar.bz2
stable-diffusion-webui-gfx803-892e703b59b2f867d8a202a52fab1db89882ef86.zip
webpath use truncate_path
-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():