From 5b761b49ade392eb8ff4c54ab1841b63475b5dd0 Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Wed, 13 Sep 2023 16:05:55 +0900 Subject: correct webpath when webui_dir is not work_dir --- modules/ui_gradio_extensions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/ui_gradio_extensions.py') diff --git a/modules/ui_gradio_extensions.py b/modules/ui_gradio_extensions.py index b824b113..0d368f8b 100644 --- a/modules/ui_gradio_extensions.py +++ b/modules/ui_gradio_extensions.py @@ -2,12 +2,12 @@ import os import gradio as gr from modules import localization, shared, scripts -from modules.paths import script_path, data_path +from modules.paths import script_path, data_path, cwd def webpath(fn): - if fn.startswith(script_path): - web_path = os.path.relpath(fn, script_path).replace('\\', '/') + if fn.startswith(cwd): + web_path = os.path.relpath(fn, cwd) else: web_path = os.path.abspath(fn) -- cgit v1.2.1