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
79953e9b
Commit
79953e9b
authored
Dec 01, 2022
by
brkirch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for macOS (Darwin) in launch.py
parent
4b3c5bc2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
launch.py
launch.py
+18
-1
webui-user.sh
webui-user.sh
+1
-1
No files found.
launch.py
View file @
79953e9b
...
...
@@ -193,6 +193,20 @@ def prepare_enviroment():
xformers
=
'--xformers'
in
sys
.
argv
ngrok
=
'--ngrok'
in
sys
.
argv
if
platform
.
system
()
==
'Darwin'
:
os
.
environ
[
"PYTORCH_ENABLE_MPS_FALLBACK"
]
=
"1"
torch_command
=
os
.
environ
.
get
(
'TORCH_COMMAND'
,
"pip install torch==1.12.1 torchvision==0.13.1"
)
k_diffusion_repo
=
os
.
environ
.
get
(
'K_DIFFUSION_REPO'
,
'https://github.com/brkirch/k-diffusion.git'
)
k_diffusion_commit_hash
=
os
.
environ
.
get
(
'K_DIFFUSION_COMMIT_HASH'
,
"51c9778f269cedb55a4d88c79c0246d35bdadb71"
)
if
os
.
environ
.
get
(
'COMMANDLINE_ARGS'
)
==
None
:
if
'--use-cpu'
in
sys
.
argv
:
idx
=
sys
.
argv
.
index
(
'--use-cpu'
)
if
idx
<
len
(
sys
.
argv
)
and
sys
.
argv
[
idx
+
1
][
0
]
!=
'-'
:
sys
.
argv
.
insert
(
idx
+
1
,
'interrogate'
)
else
:
sys
.
argv
+=
[
'--use-cpu'
,
'interrogate'
]
sys
.
argv
.
append
(
'--no-half'
)
try
:
commit
=
run
(
f
"{git} rev-parse HEAD"
)
.
strip
()
except
Exception
:
...
...
@@ -204,7 +218,7 @@ def prepare_enviroment():
if
not
is_installed
(
"torch"
)
or
not
is_installed
(
"torchvision"
):
run
(
f
'"{python}" -m {torch_command}'
,
"Installing torch and torchvision"
,
"Couldn't install torch"
)
if
not
skip_torch_cuda_test
:
if
not
skip_torch_cuda_test
and
platform
.
system
()
!=
'Darwin'
:
run_python
(
"import torch; assert torch.cuda.is_available(), 'Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check'"
)
if
not
is_installed
(
"gfpgan"
):
...
...
@@ -231,6 +245,9 @@ def prepare_enviroment():
if
not
is_installed
(
"pyngrok"
)
and
ngrok
:
run_pip
(
"install pyngrok"
,
"ngrok"
)
if
platform
.
system
()
==
'Darwin'
and
not
is_installed
(
"psutil"
):
run_pip
(
"install psutil"
,
"psutil"
)
os
.
makedirs
(
dir_repos
,
exist_ok
=
True
)
git_clone
(
stable_diffusion_repo
,
repo_dir
(
'stable-diffusion-stability-ai'
),
"Stable Diffusion"
,
stable_diffusion_commit_hash
)
...
...
webui-user.sh
View file @
79953e9b
...
...
@@ -10,7 +10,7 @@
#clone_dir="stable-diffusion-webui"
# Commandline arguments for webui.py, for example: export COMMANDLINE_ARGS="--medvram --opt-split-attention"
export
COMMANDLINE_ARGS
=
""
#
export COMMANDLINE_ARGS=""
# python3 executable
#python_cmd="python3"
...
...
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