Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
d35bf649
Commit
d35bf649
authored
Nov 01, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make launch.py run installers for extensions that have ones
add some more classes to safety module for an extension
parent
f126986b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
launch.py
launch.py
+20
-2
safe.py
modules/safe.py
+1
-1
No files found.
launch.py
View file @
d35bf649
...
@@ -7,6 +7,7 @@ import shlex
...
@@ -7,6 +7,7 @@ import shlex
import
platform
import
platform
dir_repos
=
"repositories"
dir_repos
=
"repositories"
dir_extensions
=
"extensions"
python
=
sys
.
executable
python
=
sys
.
executable
git
=
os
.
environ
.
get
(
'GIT'
,
"git"
)
git
=
os
.
environ
.
get
(
'GIT'
,
"git"
)
index_url
=
os
.
environ
.
get
(
'INDEX_URL'
,
""
)
index_url
=
os
.
environ
.
get
(
'INDEX_URL'
,
""
)
...
@@ -101,7 +102,22 @@ def version_check(commit):
...
@@ -101,7 +102,22 @@ def version_check(commit):
else
:
else
:
print
(
"Not a git clone, can't perform version check."
)
print
(
"Not a git clone, can't perform version check."
)
except
Exception
as
e
:
except
Exception
as
e
:
print
(
"versipm check failed"
,
e
)
print
(
"version check failed"
,
e
)
def
run_extensions_installers
():
if
not
os
.
path
.
isdir
(
dir_extensions
):
return
for
dirname_extension
in
os
.
listdir
(
dir_extensions
):
path_installer
=
os
.
path
.
join
(
dir_extensions
,
dirname_extension
,
"install.py"
)
if
not
os
.
path
.
isfile
(
path_installer
):
continue
try
:
print
(
run
(
f
'"{python}" "{path_installer}"'
,
errdesc
=
f
"Error running install.py for extension {dirname_extension}"
))
except
Exception
as
e
:
print
(
e
,
file
=
sys
.
stderr
)
def
prepare_enviroment
():
def
prepare_enviroment
():
...
@@ -189,6 +205,8 @@ def prepare_enviroment():
...
@@ -189,6 +205,8 @@ def prepare_enviroment():
run_pip
(
f
"install -r {requirements_file}"
,
"requirements for Web UI"
)
run_pip
(
f
"install -r {requirements_file}"
,
"requirements for Web UI"
)
run_extensions_installers
()
if
update_check
:
if
update_check
:
version_check
(
commit
)
version_check
(
commit
)
...
...
modules/safe.py
View file @
d35bf649
...
@@ -32,7 +32,7 @@ class RestrictedUnpickler(pickle.Unpickler):
...
@@ -32,7 +32,7 @@ class RestrictedUnpickler(pickle.Unpickler):
return
getattr
(
collections
,
name
)
return
getattr
(
collections
,
name
)
if
module
==
'torch._utils'
and
name
in
[
'_rebuild_tensor_v2'
,
'_rebuild_parameter'
]:
if
module
==
'torch._utils'
and
name
in
[
'_rebuild_tensor_v2'
,
'_rebuild_parameter'
]:
return
getattr
(
torch
.
_utils
,
name
)
return
getattr
(
torch
.
_utils
,
name
)
if
module
==
'torch'
and
name
in
[
'FloatStorage'
,
'HalfStorage'
,
'IntStorage'
,
'LongStorage'
,
'DoubleStorage'
]:
if
module
==
'torch'
and
name
in
[
'FloatStorage'
,
'HalfStorage'
,
'IntStorage'
,
'LongStorage'
,
'DoubleStorage'
,
'ByteStorage'
]:
return
getattr
(
torch
,
name
)
return
getattr
(
torch
,
name
)
if
module
==
'torch.nn.modules.container'
and
name
in
[
'ParameterDict'
]:
if
module
==
'torch.nn.modules.container'
and
name
in
[
'ParameterDict'
]:
return
getattr
(
torch
.
nn
.
modules
.
container
,
name
)
return
getattr
(
torch
.
nn
.
modules
.
container
,
name
)
...
...
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