Skip to content

Commit

Permalink
move update check to after dep installation
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaker authored and AUTOMATIC1111 committed Oct 18, 2022
1 parent 68e83f4 commit a647cbc
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import importlib.util
import shlex
import platform
import requests

dir_repos = "repositories"
python = sys.executable
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a647cbc

Please sign in to comment.