Merge branch 'ltdrdata:main' into dev

This commit is contained in:
John Qiao 2023-11-19 01:42:09 -07:00 committed by GitHub
commit 9c24979417
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 202 additions and 46 deletions

View File

@ -14,7 +14,7 @@ import concurrent
import ssl
from urllib.parse import urlparse
version = "V1.0.1"
version = "V1.1"
print(f"### Loading: ComfyUI-Manager ({version})")
@ -34,6 +34,10 @@ def handle_stream(stream, prefix):
def run_script(cmd, cwd='.'):
if len(cmd) > 0 and cmd[0].startswith("#"):
print(f"[ComfyUI-Manager] Unexpected behavior: `{cmd}`")
return 0
process = subprocess.Popen(cmd, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, bufsize=1)
stdout_thread = threading.Thread(target=handle_stream, args=(process.stdout, ""))
@ -236,6 +240,8 @@ def try_install_script(url, repo_path, install_cmd):
pass
if code != 0:
if url is None:
url = os.path.dirname(repo_path)
print(f"install script failed: {url}")
return False
@ -328,7 +334,9 @@ def git_repo_has_updates(path, do_fetch=False, do_update=False):
raise ValueError('Not a git repository')
if platform.system() == "Windows":
return __win_check_git_update(path, do_fetch, do_update)
res = __win_check_git_update(path, do_fetch, do_update)
execute_install_script(None, path, lazy_mode=True)
return res
else:
# Fetch the latest commits from the remote repository
repo = git.Repo(path)
@ -352,6 +360,7 @@ def git_repo_has_updates(path, do_fetch=False, do_update=False):
new_commit_hash = repo.head.commit.hexsha
if commit_hash != new_commit_hash:
execute_install_script(None, path)
print(f"\x1b[2K\rUpdated: {path}")
return True
else:
@ -961,24 +970,28 @@ def copy_set_active(files, is_disable, js_path_name='.'):
return True
def execute_install_script(url, repo_path):
def execute_install_script(url, repo_path, lazy_mode=False):
install_script_path = os.path.join(repo_path, "install.py")
requirements_path = os.path.join(repo_path, "requirements.txt")
if os.path.exists(requirements_path):
print("Install: pip packages")
with open(requirements_path, "r") as requirements_file:
for line in requirements_file:
package_name = line.strip()
if package_name:
install_cmd = [sys.executable, "-m", "pip", "install", package_name]
if package_name.strip() != "":
try_install_script(url, repo_path, install_cmd)
if os.path.exists(install_script_path):
print(f"Install: install script")
install_cmd = [sys.executable, "install.py"]
if lazy_mode:
install_cmd = ["#LAZY-INSTALL-SCRIPT", sys.executable]
try_install_script(url, repo_path, install_cmd)
else:
if os.path.exists(requirements_path):
print("Install: pip packages")
with open(requirements_path, "r") as requirements_file:
for line in requirements_file:
package_name = line.strip()
if package_name:
install_cmd = [sys.executable, "-m", "pip", "install", package_name]
if package_name.strip() != "":
try_install_script(url, repo_path, install_cmd)
if os.path.exists(install_script_path):
print(f"Install: install script")
install_cmd = [sys.executable, "install.py"]
try_install_script(url, repo_path, install_cmd)
return True
@ -1166,7 +1179,7 @@ def gitclone_update(files):
repo_path = os.path.join(custom_nodes_path, repo_name)
git_pull(repo_path)
if not execute_install_script(url, repo_path):
if not execute_install_script(url, repo_path, lazy_mode=True):
return False
except Exception as e:

View File

@ -17,6 +17,7 @@
"files": [
"https://github.com/ltdrdata/ComfyUI-Impact-Pack"
],
"pip": ["ultralytics"],
"install_type": "git-clone",
"description": "This extension offers various detector nodes and detailer nodes that allow you to configure a workflow that automatically enhances facial details. And provide iterative upscaler.<BR><p style='background-color: black; color: red;'>NOTE:MMDetDetectorProvider and other legacy nodes are disabled by default. If you want to activate these nodes and use them, please edit the impact-pack.ini file in the ComfyUI-Impact-Pack directory and change 'mmdet_skip = True' to 'mmdet_skip = False.' </p>"
},
@ -2646,6 +2647,36 @@
"install_type": "git-clone",
"description": "Composition nodes like Substance Designer heavily inspired by WAS and MTB Node Suites"
},
{
"author": "Umikaze-job",
"title": "select_folder_path_easy",
"reference": "https://github.com/Umikaze-job/select_folder_path_easy",
"files": [
"https://github.com/Umikaze-job/select_folder_path_easy"
],
"install_type": "git-clone",
"description": "This extension simply connects the nodes and specifies the output path of the generated images to a manageable path."
},
{
"author": "Niutonian",
"title": "ComfyUi-NoodleWebcam",
"reference": "https://github.com/Niutonian/ComfyUi-NoodleWebcam",
"files": [
"https://github.com/Niutonian/ComfyUi-NoodleWebcam"
],
"install_type": "git-clone",
"description": "Nodes:Noodle webcam is a node that records frames and send them to your favourite node."
},
{
"author": "kinfolk0117",
"title": "ComfyUI_GradientDeepShrink",
"reference": "https://github.com/kinfolk0117/ComfyUI_GradientDeepShrink",
"files": [
"https://github.com/kinfolk0117/ComfyUI_GradientDeepShrink"
],
"install_type": "git-clone",
"description": "Nodes:GradientPatchModelAddDownscale (Kohya Deep Shrink)."
},
{
"author": "Off-Live",
"title": "ComfyUI-off-suite",

View File

@ -58,23 +58,22 @@
],
"https://github.com/Amorano/Jovimetrix": [
[
"\u2697\ufe0f Blend Images (jov)",
"\u2697\ufe0f Blend (jov)",
"\u2728 Shape Generator (jov)",
"\ud83c\udf08 HSV Image (jov)",
"\ud83c\udf31 Transform Image (jov)",
"\ud83c\udfad Invert Image (jov)",
"\ud83c\udf08 HSV (jov)",
"\ud83c\udf31 Transform (jov)",
"\ud83c\udf87 Expand (jov)",
"\ud83d\udd06 Pixel Shader (jov)",
"\ud83d\udd06 Pixel Shader Image (jov)",
"\ud83d\udd27 Adjust Image (jov)",
"\ud83d\udd30 Mirror Image (jov)",
"\ud83d\udd33 Tile Image (jov)",
"\ud83d\udd78\ufe0f Filter Image (jov)",
"\ud83d\uddfa\ufe0f Remap Image (jov)",
"\ud83d\udfea Constant Image (jov)",
"\ud83e\udd7b Gradient (jov)"
"\ud83d\udd30 Mirror (jov)",
"\ud83d\udd33 Tile (jov)",
"\ud83d\udd78\ufe0f Adjust (jov)",
"\ud83d\uddfa\ufe0f Projection (jov)",
"\ud83d\udfea Constant (jov)"
],
{
"author": "amorano",
"description": "Shapes and Shaders.",
"description": "",
"nickname": "Jovimetrix",
"title": "Jovimetrix Composition Pack",
"title_aux": "Jovimetrix Composition Nodes"
@ -521,7 +520,8 @@
"BatchStringSchedule",
"BatchValueSchedule",
"BatchValueScheduleLatentInput",
"CalculateLatentInterpFrameNumber",
"CalculateFrameOffset",
"ConcatStringSingle",
"CosWave",
"FizzFrame",
"FizzFrameConcatenate",
@ -539,7 +539,8 @@
"StringConcatenate",
"StringSchedule",
"TriangleWave",
"ValueSchedule"
"ValueSchedule",
"convertKeyframeKeysToBatchKeys"
],
{
"title_aux": "FizzNodes"
@ -873,6 +874,14 @@
"title_aux": "ComfyUI_TravelSuite"
}
],
"https://github.com/Niutonian/ComfyUi-NoodleWebcam": [
[
"WebcamNode"
],
{
"title_aux": "ComfyUi-NoodleWebcam"
}
],
"https://github.com/Nourepide/ComfyUI-Allor": [
[
"AlphaChanelAdd",
@ -1544,6 +1553,14 @@
"title_aux": "ComfyUI Neural network latent upscale custom node"
}
],
"https://github.com/Umikaze-job/select_folder_path_easy": [
[
"SelectFolderPathEasy"
],
{
"title_aux": "select_folder_path_easy"
}
],
"https://github.com/WASasquatch/ASTERR": [
[
"ASTERR",
@ -2987,6 +3004,7 @@
"CreateGradientMask",
"CreateShapeMask",
"CreateTextMask",
"CreateVoronoiMask",
"CrossFadeImages",
"EmptyLatentImagePresets",
"FloatConstant",
@ -3011,6 +3029,14 @@
"title_aux": "KJNodes for ComfyUI"
}
],
"https://github.com/kinfolk0117/ComfyUI_GradientDeepShrink": [
[
"GradientPatchModelAddDownscale"
],
{
"title_aux": "ComfyUI_GradientDeepShrink"
}
],
"https://github.com/kinfolk0117/ComfyUI_SimpleTiles": [
[
"TileCalc",
@ -3277,6 +3303,7 @@
"https://github.com/ltdrdata/ComfyUI-Inspire-Pack": [
[
"AnimeLineArt_Preprocessor_Provider_for_SEGS //Inspire",
"ApplyRegionalIPAdapters //Inspire",
"BindImageListPromptList //Inspire",
"CacheBackendData //Inspire",
"CacheBackendDataList //Inspire",

View File

@ -1,5 +1,35 @@
{
"custom_nodes": [
{
"author": "kinfolk0117",
"title": "ComfyUI_GradientDeepShrink",
"reference": "https://github.com/kinfolk0117/ComfyUI_GradientDeepShrink",
"files": [
"https://github.com/kinfolk0117/ComfyUI_GradientDeepShrink"
],
"install_type": "git-clone",
"description": "Nodes:GradientPatchModelAddDownscale (Kohya Deep Shrink)."
},
{
"author": "Niutonian",
"title": "ComfyUi-NoodleWebcam",
"reference": "https://github.com/Niutonian/ComfyUi-NoodleWebcam",
"files": [
"https://github.com/Niutonian/ComfyUi-NoodleWebcam"
],
"install_type": "git-clone",
"description": "Nodes:Noodle webcam is a node that records frames and send them to your favourite node."
},
{
"author": "Umikaze-job",
"title": "select_folder_path_easy",
"reference": "https://github.com/Umikaze-job/select_folder_path_easy",
"files": [
"https://github.com/Umikaze-job/select_folder_path_easy"
],
"install_type": "git-clone",
"description": "This extension simply connects the nodes and specifies the output path of the generated images to a manageable path."
},
{
"author": "amorano",
"title": "Jovimetrix Composition Nodes",

View File

@ -58,23 +58,22 @@
],
"https://github.com/Amorano/Jovimetrix": [
[
"\u2697\ufe0f Blend Images (jov)",
"\u2697\ufe0f Blend (jov)",
"\u2728 Shape Generator (jov)",
"\ud83c\udf08 HSV Image (jov)",
"\ud83c\udf31 Transform Image (jov)",
"\ud83c\udfad Invert Image (jov)",
"\ud83c\udf08 HSV (jov)",
"\ud83c\udf31 Transform (jov)",
"\ud83c\udf87 Expand (jov)",
"\ud83d\udd06 Pixel Shader (jov)",
"\ud83d\udd06 Pixel Shader Image (jov)",
"\ud83d\udd27 Adjust Image (jov)",
"\ud83d\udd30 Mirror Image (jov)",
"\ud83d\udd33 Tile Image (jov)",
"\ud83d\udd78\ufe0f Filter Image (jov)",
"\ud83d\uddfa\ufe0f Remap Image (jov)",
"\ud83d\udfea Constant Image (jov)",
"\ud83e\udd7b Gradient (jov)"
"\ud83d\udd30 Mirror (jov)",
"\ud83d\udd33 Tile (jov)",
"\ud83d\udd78\ufe0f Adjust (jov)",
"\ud83d\uddfa\ufe0f Projection (jov)",
"\ud83d\udfea Constant (jov)"
],
{
"author": "amorano",
"description": "Shapes and Shaders.",
"description": "",
"nickname": "Jovimetrix",
"title": "Jovimetrix Composition Pack",
"title_aux": "Jovimetrix Composition Nodes"
@ -521,7 +520,8 @@
"BatchStringSchedule",
"BatchValueSchedule",
"BatchValueScheduleLatentInput",
"CalculateLatentInterpFrameNumber",
"CalculateFrameOffset",
"ConcatStringSingle",
"CosWave",
"FizzFrame",
"FizzFrameConcatenate",
@ -539,7 +539,8 @@
"StringConcatenate",
"StringSchedule",
"TriangleWave",
"ValueSchedule"
"ValueSchedule",
"convertKeyframeKeysToBatchKeys"
],
{
"title_aux": "FizzNodes"
@ -873,6 +874,14 @@
"title_aux": "ComfyUI_TravelSuite"
}
],
"https://github.com/Niutonian/ComfyUi-NoodleWebcam": [
[
"WebcamNode"
],
{
"title_aux": "ComfyUi-NoodleWebcam"
}
],
"https://github.com/Nourepide/ComfyUI-Allor": [
[
"AlphaChanelAdd",
@ -1544,6 +1553,14 @@
"title_aux": "ComfyUI Neural network latent upscale custom node"
}
],
"https://github.com/Umikaze-job/select_folder_path_easy": [
[
"SelectFolderPathEasy"
],
{
"title_aux": "select_folder_path_easy"
}
],
"https://github.com/WASasquatch/ASTERR": [
[
"ASTERR",
@ -2987,6 +3004,7 @@
"CreateGradientMask",
"CreateShapeMask",
"CreateTextMask",
"CreateVoronoiMask",
"CrossFadeImages",
"EmptyLatentImagePresets",
"FloatConstant",
@ -3011,6 +3029,14 @@
"title_aux": "KJNodes for ComfyUI"
}
],
"https://github.com/kinfolk0117/ComfyUI_GradientDeepShrink": [
[
"GradientPatchModelAddDownscale"
],
{
"title_aux": "ComfyUI_GradientDeepShrink"
}
],
"https://github.com/kinfolk0117/ComfyUI_SimpleTiles": [
[
"TileCalc",
@ -3277,6 +3303,7 @@
"https://github.com/ltdrdata/ComfyUI-Inspire-Pack": [
[
"AnimeLineArt_Preprocessor_Provider_for_SEGS //Inspire",
"ApplyRegionalIPAdapters //Inspire",
"BindImageListPromptList //Inspire",
"CacheBackendData //Inspire",
"CacheBackendDataList //Inspire",

View File

@ -135,6 +135,9 @@ try:
else:
original_stderr.flush()
def reconfigure(self, *args, **kwargs):
pass
def close_log():
log_file.close()
@ -249,6 +252,26 @@ if os.path.exists(restore_snapshot_path):
# Perform install
script_list_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "startup-scripts", "install-scripts.txt")
def execute_lazy_install_script(repo_path, executable):
install_script_path = os.path.join(repo_path, "install.py")
requirements_path = os.path.join(repo_path, "requirements.txt")
if os.path.exists(requirements_path):
print("Install: pip packages")
with open(requirements_path, "r") as requirements_file:
for line in requirements_file:
package_name = line.strip()
if package_name:
install_cmd = [sys.executable, "-m", "pip", "install", package_name]
process_wrap(install_cmd, repo_path)
if os.path.exists(install_script_path):
print(f"Install: install script")
install_cmd = [sys.executable, "install.py"]
process_wrap(install_cmd, repo_path)
# Check if script_list_path exists
if os.path.exists(script_list_path):
print("\n#######################################################################")
@ -265,7 +288,12 @@ if os.path.exists(script_list_path):
try:
script = eval(line)
if os.path.exists(script[0]):
if script[1].startswith('#'):
if script[1] == "#LAZY-INSTALL-SCRIPT":
execute_lazy_install_script(script[0], script[2])
elif os.path.exists(script[0]):
print(f"\n## ComfyUI-Manager: EXECUTE => {script[1:]}")
print(f"\n## Execute install/(de)activation script for '{script[0]}'")