Skip to content

Commit

Permalink
🐛 Try fix submodule command not found (#2428)
Browse files Browse the repository at this point in the history
* 🐛 Try fix submodule command not found

* nits
  • Loading branch information
huchenlei authored Jan 6, 2024
1 parent 94c93c6 commit a5b3fa9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions install.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import launch
import subprocess
import git # git is part of A1111 dependency.
import pkg_resources
import os
from pathlib import Path
from typing import Tuple, Optional

Expand All @@ -14,8 +15,8 @@

def sync_submodules():
try:
subprocess.run(["git", "submodule", "init"], check=True, cwd=repo_root)
subprocess.run(["git", "submodule", "update"], check=True, cwd=repo_root)
repo = git.Repo(repo_root)
repo.submodule_update()
except Exception as e:
print(e)
print("Warning: ControlNet failed to sync submodules. Please try run "
Expand Down Expand Up @@ -77,4 +78,5 @@ def install_requirements(req_file):

sync_submodules()
install_requirements(main_req_file)
install_requirements(hand_refiner_req_file)
if os.path.exists(hand_refiner_req_file):
install_requirements(hand_refiner_req_file)

0 comments on commit a5b3fa9

Please sign in to comment.