mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-02-09 12:42:33 +08:00
post rebase fixup
This commit is contained in:
parent
af331778c8
commit
ded2428d8c
@ -677,7 +677,7 @@ class UnifiedManager:
|
|||||||
except:
|
except:
|
||||||
return version.parse("0.0.0")
|
return version.parse("0.0.0")
|
||||||
|
|
||||||
def execute_install_script(self, url, repo_path, lazy_mode=False, instant_execution=False):
|
def execute_install_script(self, url, repo_path, instant_execution=False, lazy_mode=False, no_deps=False):
|
||||||
install_script_path = os.path.join(repo_path, "install.py")
|
install_script_path = os.path.join(repo_path, "install.py")
|
||||||
requirements_path = os.path.join(repo_path, "requirements.txt")
|
requirements_path = os.path.join(repo_path, "requirements.txt")
|
||||||
|
|
||||||
@ -685,7 +685,7 @@ class UnifiedManager:
|
|||||||
install_cmd = ["#LAZY-INSTALL-SCRIPT", sys.executable]
|
install_cmd = ["#LAZY-INSTALL-SCRIPT", sys.executable]
|
||||||
return try_install_script(url, repo_path, install_cmd)
|
return try_install_script(url, repo_path, install_cmd)
|
||||||
else:
|
else:
|
||||||
if os.path.exists(requirements_path):
|
if os.path.exists(requirements_path) and not no_deps:
|
||||||
print("Install: pip packages")
|
print("Install: pip packages")
|
||||||
with open(requirements_path, "r") as requirements_file:
|
with open(requirements_path, "r") as requirements_file:
|
||||||
for line in requirements_file:
|
for line in requirements_file:
|
||||||
@ -704,7 +704,7 @@ class UnifiedManager:
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def unified_fix(self, node_id, version_spec, instant_execution=False):
|
def unified_fix(self, node_id, version_spec, instant_execution=False, no_deps=False):
|
||||||
"""
|
"""
|
||||||
fix dependencies
|
fix dependencies
|
||||||
"""
|
"""
|
||||||
@ -715,11 +715,11 @@ class UnifiedManager:
|
|||||||
if info is None or not os.path.exists(info[1]):
|
if info is None or not os.path.exists(info[1]):
|
||||||
return result.fail(f'not found: {node_id}@{version_spec}')
|
return result.fail(f'not found: {node_id}@{version_spec}')
|
||||||
|
|
||||||
self.execute_install_script(node_id, info[1], instant_execution=instant_execution)
|
self.execute_install_script(node_id, info[1], instant_execution=instant_execution, no_deps=no_deps)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def cnr_switch_version(self, node_id, version_spec=None, instant_execution=False, return_postinstall=False):
|
def cnr_switch_version(self, node_id, version_spec=None, instant_execution=False, no_deps=False, return_postinstall=False):
|
||||||
"""
|
"""
|
||||||
switch between cnr version
|
switch between cnr version
|
||||||
"""
|
"""
|
||||||
@ -783,7 +783,7 @@ class UnifiedManager:
|
|||||||
result.target = version_spec
|
result.target = version_spec
|
||||||
|
|
||||||
def postinstall():
|
def postinstall():
|
||||||
res = self.execute_install_script(f"{node_id}@{version_spec}", new_install_path, instant_execution=instant_execution)
|
res = self.execute_install_script(f"{node_id}@{version_spec}", new_install_path, instant_execution=instant_execution, no_deps=no_deps)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
if return_postinstall:
|
if return_postinstall:
|
||||||
@ -976,7 +976,7 @@ class UnifiedManager:
|
|||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def cnr_install(self, node_id, version_spec=None, instant_execution=False, return_postinstall=False):
|
def cnr_install(self, node_id, version_spec=None, instant_execution=False, no_deps=False, return_postinstall=False):
|
||||||
result = ManagedResult('install-cnr')
|
result = ManagedResult('install-cnr')
|
||||||
|
|
||||||
node_info = cnr_utils.install_node(node_id, version_spec)
|
node_info = cnr_utils.install_node(node_id, version_spec)
|
||||||
@ -1013,7 +1013,7 @@ class UnifiedManager:
|
|||||||
result.target = version_spec
|
result.target = version_spec
|
||||||
|
|
||||||
def postinstall():
|
def postinstall():
|
||||||
return self.execute_install_script(node_id, install_path, instant_execution=instant_execution)
|
return self.execute_install_script(node_id, install_path, instant_execution=instant_execution, no_deps=no_deps)
|
||||||
|
|
||||||
if return_postinstall:
|
if return_postinstall:
|
||||||
return result.with_postinstall(postinstall)
|
return result.with_postinstall(postinstall)
|
||||||
@ -1023,7 +1023,7 @@ class UnifiedManager:
|
|||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def repo_install(self, url, repo_path, instant_execution=False, return_postinstall=False):
|
def repo_install(self, url, repo_path, instant_execution=False, no_deps=False, return_postinstall=False):
|
||||||
result = ManagedResult('install-git')
|
result = ManagedResult('install-git')
|
||||||
result.append(url)
|
result.append(url)
|
||||||
|
|
||||||
@ -1046,7 +1046,7 @@ class UnifiedManager:
|
|||||||
repo.close()
|
repo.close()
|
||||||
|
|
||||||
def postinstall():
|
def postinstall():
|
||||||
return self.execute_install_script(url, repo_path, instant_execution=instant_execution)
|
return self.execute_install_script(url, repo_path, instant_execution=instant_execution, no_deps=no_deps)
|
||||||
|
|
||||||
if return_postinstall:
|
if return_postinstall:
|
||||||
return result.with_postinstall(postinstall)
|
return result.with_postinstall(postinstall)
|
||||||
@ -1060,7 +1060,7 @@ class UnifiedManager:
|
|||||||
print("Installation was successful.")
|
print("Installation was successful.")
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def repo_update(self, repo_path, instant_execution=False, return_postinstall=False):
|
def repo_update(self, repo_path, instant_execution=False, no_deps=False, return_postinstall=False):
|
||||||
result = ManagedResult('update-git')
|
result = ManagedResult('update-git')
|
||||||
|
|
||||||
if not os.path.exists(os.path.join(repo_path, '.git')):
|
if not os.path.exists(os.path.join(repo_path, '.git')):
|
||||||
@ -1109,7 +1109,7 @@ class UnifiedManager:
|
|||||||
url = "unknown repo"
|
url = "unknown repo"
|
||||||
|
|
||||||
def postinstall():
|
def postinstall():
|
||||||
return self.execute_install_script(url, repo_path, instant_execution=instant_execution)
|
return self.execute_install_script(url, repo_path, instant_execution=instant_execution, no_deps=no_deps)
|
||||||
|
|
||||||
if return_postinstall:
|
if return_postinstall:
|
||||||
return result.with_postinstall(postinstall)
|
return result.with_postinstall(postinstall)
|
||||||
@ -1121,7 +1121,7 @@ class UnifiedManager:
|
|||||||
else:
|
else:
|
||||||
return ManagedResult('skip').with_msg('Up to date')
|
return ManagedResult('skip').with_msg('Up to date')
|
||||||
|
|
||||||
def unified_update(self, node_id, version_spec=None, instant_execution=False, return_postinstall=False):
|
def unified_update(self, node_id, version_spec=None, instant_execution=False, no_deps=False, return_postinstall=False):
|
||||||
if version_spec is None:
|
if version_spec is None:
|
||||||
version_spec = self.resolve_unspecified_version(node_id, guess_mode='active')
|
version_spec = self.resolve_unspecified_version(node_id, guess_mode='active')
|
||||||
|
|
||||||
@ -1129,13 +1129,13 @@ class UnifiedManager:
|
|||||||
return ManagedResult('update').fail(f'Update not available: {node_id}@{version_spec}')
|
return ManagedResult('update').fail(f'Update not available: {node_id}@{version_spec}')
|
||||||
|
|
||||||
if version_spec == 'nightly':
|
if version_spec == 'nightly':
|
||||||
return self.repo_update(self.active_nodes[node_id][1], instant_execution=instant_execution, return_postinstall=return_postinstall).with_target('nightly')
|
return self.repo_update(self.active_nodes[node_id][1], instant_execution=instant_execution, no_deps=no_deps, return_postinstall=return_postinstall).with_target('nightly')
|
||||||
elif version_spec == 'unknown':
|
elif version_spec == 'unknown':
|
||||||
return self.repo_update(self.unknown_active_nodes[node_id][1], instant_execution=instant_execution, return_postinstall=return_postinstall).with_target('unknown')
|
return self.repo_update(self.unknown_active_nodes[node_id][1], instant_execution=instant_execution, no_deps=no_deps, return_postinstall=return_postinstall).with_target('unknown')
|
||||||
else:
|
else:
|
||||||
return self.cnr_switch_version(node_id, instant_execution=instant_execution, return_postinstall=return_postinstall)
|
return self.cnr_switch_version(node_id, instant_execution=instant_execution, no_deps=no_deps, return_postinstall=return_postinstall)
|
||||||
|
|
||||||
async def install_by_id(self, node_id, version_spec=None, channel=None, mode=None, instant_execution=False, return_postinstall=False):
|
async def install_by_id(self, node_id, version_spec=None, channel=None, mode=None, instant_execution=False, no_deps=False, return_postinstall=False):
|
||||||
"""
|
"""
|
||||||
priority if version_spec == None
|
priority if version_spec == None
|
||||||
1. CNR latest
|
1. CNR latest
|
||||||
@ -1175,7 +1175,7 @@ class UnifiedManager:
|
|||||||
self.unified_disable(node_id, False)
|
self.unified_disable(node_id, False)
|
||||||
|
|
||||||
to_path = os.path.abspath(os.path.join(custom_nodes_path, f"{node_id}@{version_spec.replace('.', '_')}"))
|
to_path = os.path.abspath(os.path.join(custom_nodes_path, f"{node_id}@{version_spec.replace('.', '_')}"))
|
||||||
res = self.repo_install(repo_url, to_path, instant_execution=instant_execution, return_postinstall=return_postinstall)
|
res = self.repo_install(repo_url, to_path, instant_execution=instant_execution, no_deps=no_deps, return_postinstall=return_postinstall)
|
||||||
if res.result:
|
if res.result:
|
||||||
if version_spec == 'unknown':
|
if version_spec == 'unknown':
|
||||||
self.unknown_active_nodes[node_id] = to_path
|
self.unknown_active_nodes[node_id] = to_path
|
||||||
@ -1195,12 +1195,12 @@ class UnifiedManager:
|
|||||||
if self.is_disabled(node_id, "cnr"):
|
if self.is_disabled(node_id, "cnr"):
|
||||||
# enable and switch version if cnr is disabled (not specified version)
|
# enable and switch version if cnr is disabled (not specified version)
|
||||||
self.unified_enable(node_id, "cnr")
|
self.unified_enable(node_id, "cnr")
|
||||||
return self.cnr_switch_version(node_id, version_spec, return_postinstall=return_postinstall)
|
return self.cnr_switch_version(node_id, version_spec, no_deps=no_deps, return_postinstall=return_postinstall)
|
||||||
|
|
||||||
if self.is_enabled(node_id, "cnr"):
|
if self.is_enabled(node_id, "cnr"):
|
||||||
return self.cnr_switch_version(node_id, version_spec, return_postinstall=return_postinstall)
|
return self.cnr_switch_version(node_id, version_spec, no_deps=no_deps, return_postinstall=return_postinstall)
|
||||||
|
|
||||||
res = self.cnr_install(node_id, version_spec, instant_execution=instant_execution, return_postinstall=return_postinstall)
|
res = self.cnr_install(node_id, version_spec, instant_execution=instant_execution, no_deps=no_deps, return_postinstall=return_postinstall)
|
||||||
if res.result:
|
if res.result:
|
||||||
self.active_nodes[node_id] = version_spec, res.to_path
|
self.active_nodes[node_id] = version_spec, res.to_path
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user