@@ -24,8 +24,8 @@ def install_manager_dependencies(repo_dir):
24
24
subprocess .run ([sys .executable , '-m' , "pip" , "install" , "-r" , "requirements.txt" ])
25
25
26
26
27
- def execute (url : str , manager_url : str , comfy_workspace : str , restore : bool , skip_manager : bool , torch_mode = None , * args ,
28
- ** kwargs ):
27
+ def execute (url : str , manager_url : str , comfy_workspace : str , restore : bool , skip_manager : bool , torch_mode = None , commit = None ,
28
+ * args , * *kwargs ):
29
29
print (f"Installing from { url } " )
30
30
31
31
# install ComfyUI
@@ -34,7 +34,11 @@ def execute(url: str, manager_url: str, comfy_workspace: str, restore: bool, ski
34
34
repo_dir = os .path .abspath (repo_dir )
35
35
36
36
if os .path .exists (os .path .join (repo_dir , '.git' )):
37
- if restore :
37
+ if restore or commit is not None :
38
+ if commit is not None :
39
+ os .chdir (repo_dir )
40
+ subprocess .run (["git" , "checkout" , commit ])
41
+
38
42
install_comfyui_dependencies (repo_dir , torch_mode )
39
43
else :
40
44
print (
@@ -47,6 +51,11 @@ def execute(url: str, manager_url: str, comfy_workspace: str, restore: bool, ski
47
51
repo_dir = os .path .abspath (repo_dir )
48
52
subprocess .run (["git" , "clone" , url , repo_dir ])
49
53
54
+ # checkout specified commit
55
+ if commit is not None :
56
+ os .chdir (repo_dir )
57
+ subprocess .run (["git" , "checkout" , commit ])
58
+
50
59
install_comfyui_dependencies (repo_dir , torch_mode )
51
60
52
61
print ("" )
0 commit comments