aboutsummaryrefslogtreecommitdiff
path: root/launch.py
diff options
context:
space:
mode:
authoryfszzx <yfszzx@gmail.com>2022-10-16 12:34:05 +0800
committeryfszzx <yfszzx@gmail.com>2022-10-16 12:34:05 +0800
commit5d8c59eee505cf15ec6994d05bb941440d90e44e (patch)
treea87f6e38d4dc33e3f293f10f9cdd1760af93114c /launch.py
parent763b893f319cee280b86e63025eb55e7c16b02e7 (diff)
parentd41ac174e24e1e7cdcf7b42f2a03cbc6394eb5e5 (diff)
Merge branch 'master' of https://github.com/yfszzx/stable-diffusion-webui-plus
Diffstat (limited to 'launch.py')
-rw-r--r--launch.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/launch.py b/launch.py
index a7c5807b..2e6b3369 100644
--- a/launch.py
+++ b/launch.py
@@ -9,6 +9,7 @@ import platform
dir_repos = "repositories"
python = sys.executable
git = os.environ.get('GIT', "git")
+index_url = os.environ.get('INDEX_URL', "")
def extract_arg(args, name):
@@ -57,7 +58,8 @@ def run_python(code, desc=None, errdesc=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}")
+ index_url_line = f' --index-url {index_url}' if index_url != '' else ''
+ return run(f'"{python}" -m pip {args} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}")
def check_run_python(code):
@@ -102,6 +104,7 @@ def prepare_enviroment():
args = shlex.split(commandline_args)
args, skip_torch_cuda_test = extract_arg(args, '--skip-torch-cuda-test')
+ args, reinstall_xformers = extract_arg(args, '--reinstall-xformers')
xformers = '--xformers' in args
deepdanbooru = '--deepdanbooru' in args
ngrok = '--ngrok' in args
@@ -126,9 +129,9 @@ def prepare_enviroment():
if not is_installed("clip"):
run_pip(f"install {clip_package}", "clip")
- if not is_installed("xformers") and xformers and platform.python_version().startswith("3.10"):
+ if (not is_installed("xformers") or reinstall_xformers) and xformers and platform.python_version().startswith("3.10"):
if platform.system() == "Windows":
- run_pip("install https://github.com/C43H66N12O12S2/stable-diffusion-webui/releases/download/c/xformers-0.0.14.dev0-cp310-cp310-win_amd64.whl", "xformers")
+ run_pip("install -U -I --no-deps https://github.com/C43H66N12O12S2/stable-diffusion-webui/releases/download/f/xformers-0.0.14.dev0-cp310-cp310-win_amd64.whl", "xformers")
elif platform.system() == "Linux":
run_pip("install xformers", "xformers")