aboutsummaryrefslogtreecommitdiff
path: root/launch.py
diff options
context:
space:
mode:
authorDepFA <35278260+dfaker@users.noreply.github.com>2022-10-16 10:54:09 +0100
committerAUTOMATIC1111 <16777216c@gmail.com>2022-10-18 15:10:09 +0300
commita647cbc618ea13ce2312f0291ebdfc3b9449e5a1 (patch)
treed666a13a883e6e234d7d9a65f555554a3f10b528 /launch.py
parent68e83f40bf143e25639875b27e8ad3e32b382db5 (diff)
move update check to after dep installation
Diffstat (limited to 'launch.py')
-rw-r--r--launch.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/launch.py b/launch.py
index 1b133633..8484d7c1 100644
--- a/launch.py
+++ b/launch.py
@@ -5,7 +5,6 @@ import sys
import importlib.util
import shlex
import platform
-import requests
dir_repos = "repositories"
python = sys.executable
@@ -126,16 +125,6 @@ def prepare_enviroment():
print(f"Python {sys.version}")
print(f"Commit hash: {commit}")
-
- try:
- commits = requests.get('https://api.github.com/repos/AUTOMATIC1111/stable-diffusion-webui/branches/master').json()
- if commit != "<none>" and commits['commit']['sha'] != commit:
- print("--------------------------------------------------------")
- print("| You are not up to date with the most recent release. |")
- print("| Consider running `git pull` to update. |")
- print("--------------------------------------------------------")
- except Exception as e:
- pass
if not is_installed("torch") or not is_installed("torchvision"):
run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch")
@@ -176,6 +165,17 @@ def prepare_enviroment():
sys.argv += args
+ try:
+ import requests
+ commits = requests.get('https://api.github.com/repos/AUTOMATIC1111/stable-diffusion-webui/branches/master').json()
+ if commit != "<none>" and commits['commit']['sha'] != commit:
+ print("--------------------------------------------------------")
+ print("| You are not up to date with the most recent release. |")
+ print("| Consider running `git pull` to update. |")
+ print("--------------------------------------------------------")
+ except Exception as e:
+ pass
+
if "--exit" in args:
print("Exiting because of --exit argument")
exit(0)