Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
b20cd352
Commit
b20cd352
authored
Sep 30, 2023
by
AUTOMATIC1111
Committed by
GitHub
Sep 30, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13210 from AUTOMATIC1111/fetch-version-info-when-webui_dir-is-not-work_dir-
fix issues when webui_dir is not work_dir
parents
3a4290f8
5b761b49
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
6 deletions
+7
-6
modules/launch_utils.py
modules/launch_utils.py
+2
-2
modules/paths.py
modules/paths.py
+1
-1
modules/paths_internal.py
modules/paths_internal.py
+1
-0
modules/ui_gradio_extensions.py
modules/ui_gradio_extensions.py
+3
-3
No files found.
modules/launch_utils.py
View file @
b20cd352
...
...
@@ -64,7 +64,7 @@ Use --skip-python-version-check to suppress this warning.
@
lru_cache
()
def
commit_hash
():
try
:
return
subprocess
.
check_output
([
git
,
"rev-parse"
,
"HEAD"
],
shell
=
False
,
encoding
=
'utf8'
)
.
strip
()
return
subprocess
.
check_output
([
git
,
"
-C"
,
script_path
,
"
rev-parse"
,
"HEAD"
],
shell
=
False
,
encoding
=
'utf8'
)
.
strip
()
except
Exception
:
return
"<none>"
...
...
@@ -72,7 +72,7 @@ def commit_hash():
@
lru_cache
()
def
git_tag
():
try
:
return
subprocess
.
check_output
([
git
,
"describe"
,
"--tags"
],
shell
=
False
,
encoding
=
'utf8'
)
.
strip
()
return
subprocess
.
check_output
([
git
,
"
-C"
,
script_path
,
"
describe"
,
"--tags"
],
shell
=
False
,
encoding
=
'utf8'
)
.
strip
()
except
Exception
:
try
:
...
...
modules/paths.py
View file @
b20cd352
import
os
import
sys
from
modules.paths_internal
import
models_path
,
script_path
,
data_path
,
extensions_dir
,
extensions_builtin_dir
# noqa: F401
from
modules.paths_internal
import
models_path
,
script_path
,
data_path
,
extensions_dir
,
extensions_builtin_dir
,
cwd
# noqa: F401
import
modules.safe
# noqa: F401
...
...
modules/paths_internal.py
View file @
b20cd352
...
...
@@ -8,6 +8,7 @@ import shlex
commandline_args
=
os
.
environ
.
get
(
'COMMANDLINE_ARGS'
,
""
)
sys
.
argv
+=
shlex
.
split
(
commandline_args
)
cwd
=
os
.
getcwd
()
modules_path
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
script_path
=
os
.
path
.
dirname
(
modules_path
)
...
...
modules/ui_gradio_extensions.py
View file @
b20cd352
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment