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
ff73841c
Commit
ff73841c
authored
Jul 13, 2023
by
AUTOMATIC1111
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mute SDXL imports in the place there SDXL is imported for the first time instead of launch.py
parent
e16ebc91
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
18 deletions
+17
-18
modules/launch_utils.py
modules/launch_utils.py
+0
-18
modules/paths.py
modules/paths.py
+17
-0
No files found.
modules/launch_utils.py
View file @
ff73841c
...
@@ -224,22 +224,6 @@ def run_extensions_installers(settings_file):
...
@@ -224,22 +224,6 @@ def run_extensions_installers(settings_file):
run_extension_installer
(
os
.
path
.
join
(
extensions_dir
,
dirname_extension
))
run_extension_installer
(
os
.
path
.
join
(
extensions_dir
,
dirname_extension
))
def
mute_sdxl_imports
():
"""create fake modules that SDXL wants to import but doesn't actually use for our purposes"""
class
Dummy
:
pass
module
=
Dummy
()
module
.
LPIPS
=
None
sys
.
modules
[
'taming.modules.losses.lpips'
]
=
module
module
=
Dummy
()
module
.
StableDataModuleFromConfig
=
None
sys
.
modules
[
'sgm.data'
]
=
module
def
prepare_environment
():
def
prepare_environment
():
torch_index_url
=
os
.
environ
.
get
(
'TORCH_INDEX_URL'
,
"https://download.pytorch.org/whl/cu118"
)
torch_index_url
=
os
.
environ
.
get
(
'TORCH_INDEX_URL'
,
"https://download.pytorch.org/whl/cu118"
)
torch_command
=
os
.
environ
.
get
(
'TORCH_COMMAND'
,
f
"pip install torch==2.0.1 torchvision==0.15.2 --extra-index-url {torch_index_url}"
)
torch_command
=
os
.
environ
.
get
(
'TORCH_COMMAND'
,
f
"pip install torch==2.0.1 torchvision==0.15.2 --extra-index-url {torch_index_url}"
)
...
@@ -356,8 +340,6 @@ def configure_for_tests():
...
@@ -356,8 +340,6 @@ def configure_for_tests():
def
start
():
def
start
():
mute_sdxl_imports
()
print
(
f
"Launching {'API server' if '--nowebui' in sys.argv else 'Web UI'} with arguments: {' '.join(sys.argv[1:])}"
)
print
(
f
"Launching {'API server' if '--nowebui' in sys.argv else 'Web UI'} with arguments: {' '.join(sys.argv[1:])}"
)
import
webui
import
webui
if
'--nowebui'
in
sys
.
argv
:
if
'--nowebui'
in
sys
.
argv
:
...
...
modules/paths.py
View file @
ff73841c
...
@@ -5,6 +5,21 @@ from modules.paths_internal import models_path, script_path, data_path, extensio
...
@@ -5,6 +5,21 @@ from modules.paths_internal import models_path, script_path, data_path, extensio
import
modules.safe
# noqa: F401
import
modules.safe
# noqa: F401
def
mute_sdxl_imports
():
"""create fake modules that SDXL wants to import but doesn't actually use for our purposes"""
class
Dummy
:
pass
module
=
Dummy
()
module
.
LPIPS
=
None
sys
.
modules
[
'taming.modules.losses.lpips'
]
=
module
module
=
Dummy
()
module
.
StableDataModuleFromConfig
=
None
sys
.
modules
[
'sgm.data'
]
=
module
# data_path = cmd_opts_pre.data
# data_path = cmd_opts_pre.data
sys
.
path
.
insert
(
0
,
script_path
)
sys
.
path
.
insert
(
0
,
script_path
)
...
@@ -18,6 +33,8 @@ for possible_sd_path in possible_sd_paths:
...
@@ -18,6 +33,8 @@ for possible_sd_path in possible_sd_paths:
assert
sd_path
is
not
None
,
f
"Couldn't find Stable Diffusion in any of: {possible_sd_paths}"
assert
sd_path
is
not
None
,
f
"Couldn't find Stable Diffusion in any of: {possible_sd_paths}"
mute_sdxl_imports
()
path_dirs
=
[
path_dirs
=
[
(
sd_path
,
'ldm'
,
'Stable Diffusion'
,
[]),
(
sd_path
,
'ldm'
,
'Stable Diffusion'
,
[]),
(
os
.
path
.
join
(
sd_path
,
'../generative-models'
),
'sgm'
,
'Stable Diffusion XL'
,
[
"sgm"
]),
(
os
.
path
.
join
(
sd_path
,
'../generative-models'
),
'sgm'
,
'Stable Diffusion XL'
,
[
"sgm"
]),
...
...
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