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
333e63c0
Commit
333e63c0
authored
Jun 03, 2023
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a yet another method to restart webui
parent
9d953c0e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
15 deletions
+38
-15
modules/launch_utils.py
modules/launch_utils.py
+6
-0
modules/shared.py
modules/shared.py
+9
-0
modules/ui_extensions.py
modules/ui_extensions.py
+1
-1
webui.bat
webui.bat
+2
-0
webui.sh
webui.sh
+20
-14
No files found.
modules/launch_utils.py
View file @
333e63c0
...
@@ -244,6 +244,12 @@ def prepare_environment():
...
@@ -244,6 +244,12 @@ def prepare_environment():
codeformer_commit_hash
=
os
.
environ
.
get
(
'CODEFORMER_COMMIT_HASH'
,
"c5b4593074ba6214284d6acd5f1719b6c5d739af"
)
codeformer_commit_hash
=
os
.
environ
.
get
(
'CODEFORMER_COMMIT_HASH'
,
"c5b4593074ba6214284d6acd5f1719b6c5d739af"
)
blip_commit_hash
=
os
.
environ
.
get
(
'BLIP_COMMIT_HASH'
,
"48211a1594f1321b00f14c9f7a5b4813144b2fb9"
)
blip_commit_hash
=
os
.
environ
.
get
(
'BLIP_COMMIT_HASH'
,
"48211a1594f1321b00f14c9f7a5b4813144b2fb9"
)
try
:
# the existance of this file is a signal to webui.sh/bat that webui needs to be restarted when it stops execution
os
.
remove
(
os
.
path
.
join
(
script_path
,
"tmp"
,
"restart"
))
except
OSError
:
pass
if
not
args
.
skip_python_version_check
:
if
not
args
.
skip_python_version_check
:
check_python_version
()
check_python_version
()
...
...
modules/shared.py
View file @
333e63c0
...
@@ -841,3 +841,12 @@ def walk_files(path, allowed_extensions=None):
...
@@ -841,3 +841,12 @@ def walk_files(path, allowed_extensions=None):
continue
continue
yield
os
.
path
.
join
(
root
,
filename
)
yield
os
.
path
.
join
(
root
,
filename
)
def
restart_program
():
"""creates file tmp/restart and immediately stops the process, which webui.bat/webui.sh interpret as a command to start webui again"""
with
open
(
os
.
path
.
join
(
script_path
,
"tmp"
,
"restart"
),
"w"
):
pass
os
.
_exit
(
0
)
modules/ui_extensions.py
View file @
333e63c0
...
@@ -49,7 +49,7 @@ def apply_and_restart(disable_list, update_list, disable_all):
...
@@ -49,7 +49,7 @@ def apply_and_restart(disable_list, update_list, disable_all):
shared
.
opts
.
disabled_extensions
=
disabled
shared
.
opts
.
disabled_extensions
=
disabled
shared
.
opts
.
disable_all_extensions
=
disable_all
shared
.
opts
.
disable_all_extensions
=
disable_all
shared
.
opts
.
save
(
shared
.
config_filename
)
shared
.
opts
.
save
(
shared
.
config_filename
)
shared
.
state
.
request_restart
()
shared
.
restart_program
()
def
save_config_state
(
name
):
def
save_config_state
(
name
):
...
...
webui.bat
View file @
333e63c0
...
@@ -51,12 +51,14 @@ if EXIST %ACCELERATE% goto :accelerate_launch
...
@@ -51,12 +51,14 @@ if EXIST %ACCELERATE% goto :accelerate_launch
:launch
:launch
%PYTHON%
launch
.py
%
*
%PYTHON%
launch
.py
%
*
if
EXIST
tmp
/restart
goto
:skip
_venv
pause
pause
exit
/b
exit
/b
:accelerate
_launch
:accelerate
_launch
echo
Accelerating
echo
Accelerating
%ACCELERATE%
launch
-
-num
_cpu_threads_per_process
=
6
launch
.py
%ACCELERATE%
launch
-
-num
_cpu_threads_per_process
=
6
launch
.py
if
EXIST
tmp
/restart
goto
:skip
_venv
pause
pause
exit
/b
exit
/b
...
...
webui.sh
View file @
333e63c0
...
@@ -203,17 +203,23 @@ prepare_tcmalloc() {
...
@@ -203,17 +203,23 @@ prepare_tcmalloc() {
fi
fi
}
}
if
[[
!
-z
"
${
ACCELERATE
}
"
]]
&&
[
${
ACCELERATE
}
=
"True"
]
&&
[
-x
"
$(
command
-v
accelerate
)
"
]
KEEP_GOING
=
1
then
while
[[
"
$KEEP_GOING
"
-eq
"1"
]]
;
do
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
if
[[
!
-z
"
${
ACCELERATE
}
"
]]
&&
[
${
ACCELERATE
}
=
"True"
]
&&
[
-x
"
$(
command
-v
accelerate
)
"
]
;
then
printf
"Accelerating launch.py..."
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"Accelerating launch.py..."
prepare_tcmalloc
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
exec
accelerate launch
--num_cpu_threads_per_process
=
6
"
${
LAUNCH_SCRIPT
}
"
"
$@
"
prepare_tcmalloc
else
accelerate launch
--num_cpu_threads_per_process
=
6
"
${
LAUNCH_SCRIPT
}
"
"
$@
"
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
else
printf
"Launching launch.py..."
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"Launching launch.py..."
prepare_tcmalloc
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
exec
"
${
python_cmd
}
"
"
${
LAUNCH_SCRIPT
}
"
"
$@
"
prepare_tcmalloc
fi
"
${
python_cmd
}
"
"
${
LAUNCH_SCRIPT
}
"
"
$@
"
fi
if
[[
!
-f
tmp/restart
]]
;
then
KEEP_GOING
=
0
fi
done
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