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
bba2ac83
Commit
bba2ac83
authored
Oct 09, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reshuffle the code a bit in launcher to keep functions in one place for #2069
parent
f8197976
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
36 deletions
+41
-36
launch.py
launch.py
+41
-36
No files found.
launch.py
View file @
bba2ac83
...
...
@@ -6,6 +6,10 @@ import importlib.util
import
shlex
import
platform
dir_repos
=
"repositories"
python
=
sys
.
executable
git
=
os
.
environ
.
get
(
'GIT'
,
"git"
)
def
extract_arg
(
args
,
name
):
return
[
x
for
x
in
args
if
x
!=
name
],
name
in
args
...
...
@@ -44,43 +48,23 @@ def is_installed(package):
return
spec
is
not
None
def
prepare_enviroment
():
dir_repos
=
"repositories"
python
=
sys
.
executable
git
=
os
.
environ
.
get
(
'GIT'
,
"git"
)
torch_command
=
os
.
environ
.
get
(
'TORCH_COMMAND'
,
"pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113"
)
requirements_file
=
os
.
environ
.
get
(
'REQS_FILE'
,
"requirements_versions.txt"
)
commandline_args
=
os
.
environ
.
get
(
'COMMANDLINE_ARGS'
,
""
)
gfpgan_package
=
os
.
environ
.
get
(
'GFPGAN_PACKAGE'
,
"git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379"
)
clip_package
=
os
.
environ
.
get
(
'CLIP_PACKAGE'
,
"git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1"
)
stable_diffusion_commit_hash
=
os
.
environ
.
get
(
'STABLE_DIFFUSION_COMMIT_HASH'
,
"69ae4b35e0a0f6ee1af8bb9a5d0016ccb27e36dc"
)
taming_transformers_commit_hash
=
os
.
environ
.
get
(
'TAMING_TRANSFORMERS_COMMIT_HASH'
,
"24268930bf1dce879235a7fddd0b2355b84d7ea6"
)
k_diffusion_commit_hash
=
os
.
environ
.
get
(
'K_DIFFUSION_COMMIT_HASH'
,
"f4e99857772fc3a126ba886aadf795a332774878"
)
codeformer_commit_hash
=
os
.
environ
.
get
(
'CODEFORMER_COMMIT_HASH'
,
"c5b4593074ba6214284d6acd5f1719b6c5d739af"
)
blip_commit_hash
=
os
.
environ
.
get
(
'BLIP_COMMIT_HASH'
,
"48211a1594f1321b00f14c9f7a5b4813144b2fb9"
)
args
=
shlex
.
split
(
commandline_args
)
args
,
skip_torch_cuda_test
=
extract_arg
(
args
,
'--skip-torch-cuda-test'
)
xformers
=
'--xformers'
in
args
deepdanbooru
=
'--deepdanbooru'
in
args
def
repo_dir
(
name
):
def
repo_dir
(
name
):
return
os
.
path
.
join
(
dir_repos
,
name
)
def
run_python
(
code
,
desc
=
None
,
errdesc
=
None
):
def
run_python
(
code
,
desc
=
None
,
errdesc
=
None
):
return
run
(
f
'"{python}" -c "{code}"'
,
desc
,
errdesc
)
def
run_pip
(
args
,
desc
=
None
):
def
run_pip
(
args
,
desc
=
None
):
return
run
(
f
'"{python}" -m pip {args} --prefer-binary'
,
desc
=
f
"Installing {desc}"
,
errdesc
=
f
"Couldn't install {desc}"
)
def
check_run_python
(
code
):
def
check_run_python
(
code
):
return
check_run
(
f
'"{python}" -c "{code}"'
)
def
git_clone
(
url
,
dir
,
name
,
commithash
=
None
):
def
git_clone
(
url
,
dir
,
name
,
commithash
=
None
):
# TODO clone into temporary dir and move if successful
if
os
.
path
.
exists
(
dir
):
...
...
@@ -100,6 +84,27 @@ def prepare_enviroment():
if
commithash
is
not
None
:
run
(
f
'"{git}" -C {dir} checkout {commithash}'
,
None
,
"Couldn't checkout {name}'s hash: {commithash}"
)
def
prepare_enviroment
():
torch_command
=
os
.
environ
.
get
(
'TORCH_COMMAND'
,
"pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113"
)
requirements_file
=
os
.
environ
.
get
(
'REQS_FILE'
,
"requirements_versions.txt"
)
commandline_args
=
os
.
environ
.
get
(
'COMMANDLINE_ARGS'
,
""
)
gfpgan_package
=
os
.
environ
.
get
(
'GFPGAN_PACKAGE'
,
"git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379"
)
clip_package
=
os
.
environ
.
get
(
'CLIP_PACKAGE'
,
"git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1"
)
stable_diffusion_commit_hash
=
os
.
environ
.
get
(
'STABLE_DIFFUSION_COMMIT_HASH'
,
"69ae4b35e0a0f6ee1af8bb9a5d0016ccb27e36dc"
)
taming_transformers_commit_hash
=
os
.
environ
.
get
(
'TAMING_TRANSFORMERS_COMMIT_HASH'
,
"24268930bf1dce879235a7fddd0b2355b84d7ea6"
)
k_diffusion_commit_hash
=
os
.
environ
.
get
(
'K_DIFFUSION_COMMIT_HASH'
,
"f4e99857772fc3a126ba886aadf795a332774878"
)
codeformer_commit_hash
=
os
.
environ
.
get
(
'CODEFORMER_COMMIT_HASH'
,
"c5b4593074ba6214284d6acd5f1719b6c5d739af"
)
blip_commit_hash
=
os
.
environ
.
get
(
'BLIP_COMMIT_HASH'
,
"48211a1594f1321b00f14c9f7a5b4813144b2fb9"
)
args
=
shlex
.
split
(
commandline_args
)
args
,
skip_torch_cuda_test
=
extract_arg
(
args
,
'--skip-torch-cuda-test'
)
xformers
=
'--xformers'
in
args
deepdanbooru
=
'--deepdanbooru'
in
args
try
:
commit
=
run
(
f
"{git} rev-parse HEAD"
)
.
strip
()
except
Exception
:
...
...
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