diff --git a/calliope-backend/scripts/audit_reference_conversion.py b/calliope-backend/scripts/audit_reference_conversion.py
index 8f8dd6bb..c8092e47 100644
--- a/calliope-backend/scripts/audit_reference_conversion.py
+++ b/calliope-backend/scripts/audit_reference_conversion.py
@@ -31,6 +31,7 @@ from calliope.comfyui.serialization_reference import (
PRIMITIVE_PROFILE,
PROFILE,
REEL_PROFILE,
+ SEPARATION_PROFILE,
resolve_reference_link,
serialize_case04_node,
serialize_promoted_node,
@@ -287,6 +288,7 @@ REFERENCE_PROFILES = (
CASE04_PROFILE,
ASR_PROFILE,
*MEDIA_PROFILES,
+ SEPARATION_PROFILE,
)
@@ -376,6 +378,8 @@ def media_field_evidence(source, prompt, profile):
layouts = {
"LoadAudio": ("audio",),
"SaveAudioMP3": ("filename_prefix", "quality"),
+ "PreviewAudio": (),
+ "AudioSeparation": ("chunk_fade_shape", "chunk_length", "chunk_overlap"),
"LoadImage": ("image",),
"PreviewImage": (),
"LayerUtility: ImageReel": (
@@ -428,7 +432,9 @@ def media_field_evidence(source, prompt, profile):
"source_pointer": pointer,
"rule": rule,
"profile": profile,
- "contract_manifest": "media-reference/contract.json",
+ "contract_manifest": "separation-reference/contract.json"
+ if profile == SEPARATION_PROFILE
+ else "media-reference/contract.json",
}
)
return fields
@@ -472,12 +478,28 @@ def profile_attempt(source, profile):
"case04-reference/sources.json",
],
}
+ if profile == SEPARATION_PROFILE:
+ assumptions["separation_reference"] = {
+ "LoadAudio_and_PreviewAudio": "0.3.68@265adad858e1f31b66cd3523a02b16f5d34ced52",
+ "SaveAudioMP3": "0.3.71@c55fd7481626d8bee8044ea7512ea996d13a1b90",
+ "AudioSeparation": "1.4.0@5291831d7c321ab7a5192374482f9848dffee75b",
+ "registry_source_bytes_match": True,
+ "registry_commit_binding": "unknown; API exposes no commit",
+ "plugin_license": "unknown; LICENSE referenced but absent at pinned version",
+ "numeric_policy": (
+ "finite int/float within frontend UI [0,2048]; saved values unchanged"
+ ),
+ }
+ assumptions["reference_sources"] = [
+ "separation-reference/sources.json",
+ *assumptions["reference_sources"],
+ ]
base = {"profile": profile, "assumptions": assumptions}
declared_frontend = (source.get("extra") or {}).get("frontendVersion")
assumptions["source_frontend_declaration"] = declared_frontend
assumptions["missing_frontend_policy"] = (
"explicit_media_reference_assumption"
- if profile in MEDIA_PROFILES
+ if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE)
else "explicit_legacy_reference_assumption"
if profile in (PROFILE, AUX_PROFILE, PRIMITIVE_PROFILE)
else "requires_explicit_declaration"
@@ -490,7 +512,8 @@ def profile_attempt(source, profile):
]
if declared_frontend != expected and not (
declared_frontend is None
- and profile in (PROFILE, AUX_PROFILE, PRIMITIVE_PROFILE, *MEDIA_PROFILES)
+ and profile
+ in (PROFILE, AUX_PROFILE, PRIMITIVE_PROFILE, *MEDIA_PROFILES, SEPARATION_PROFILE)
):
return {
**base,
@@ -527,13 +550,13 @@ def profile_attempt(source, profile):
{"field_evidence": asr_field_evidence(source, result.prompt)}
if profile == ASR_PROFILE
else {"field_evidence": media_field_evidence(source, result.prompt, profile)}
- if profile in MEDIA_PROFILES
+ if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE)
else {}
),
}
-def audit_library(repo: Path, profiles=REFERENCE_PROFILES):
+def audit_library(repo: Path, profiles=REFERENCE_PROFILES, *, baseline_profiles=None):
"""Actually invoke every version-applicable profile; never choose first success.
The immutable manifest/SHA binding and delivery_scope define the partition.
@@ -625,11 +648,13 @@ def audit_library(repo: Path, profiles=REFERENCE_PROFILES):
cohort: dict(Counter(r["status"] for r in rows if r["cohort"] == cohort))
for cohort in ("without_companion", "with_companion")
}
+ if baseline_profiles is None:
+ baseline_profiles = tuple(p for p in profiles if p != SEPARATION_PROFILE)
old_complete = {
row["source_path"]
for row in rows
if any(
- a["status"] == "complete_reference_candidate" and a["profile"] not in MEDIA_PROFILES
+ a["status"] == "complete_reference_candidate" and a["profile"] in baseline_profiles
for a in row["attempts"]
)
}
@@ -639,7 +664,8 @@ def audit_library(repo: Path, profiles=REFERENCE_PROFILES):
"source_total": len(manifest),
"target_total": len(rows) + len(api_paths),
"coverage_delta": {
- "baseline": "previous eleven profiles excluding MEDIA_PROFILES; applied this run",
+ "baseline": "explicit baseline profile subset; applied this run",
+ "baseline_profiles": list(baseline_profiles),
"previous_complete_paths": sorted(old_complete),
"current_complete_paths": sorted(now_complete),
"new_complete_paths": sorted(now_complete - old_complete),
@@ -677,6 +703,7 @@ def main():
choices=(
ASR_PROFILE,
*MEDIA_PROFILES,
+ SEPARATION_PROFILE,
PROFILE,
AUX_PROFILE,
PRIMITIVE_PROFILE,
diff --git a/calliope-backend/src/calliope/comfyui/serialization_reference.py b/calliope-backend/src/calliope/comfyui/serialization_reference.py
index b33d651c..eae18dce 100644
--- a/calliope-backend/src/calliope/comfyui/serialization_reference.py
+++ b/calliope-backend/src/calliope/comfyui/serialization_reference.py
@@ -10,11 +10,13 @@ installation is inferred.
from __future__ import annotations
+import math
from typing import Any
MP3_PROFILE = "comfy-frontend-1.37.11-mp3-core-0.11.0-reference"
REEL_PROFILE = "comfy-frontend-1.37.11-layerstyle-mixed-core-0.4.0-reference"
MEDIA_PROFILES = (MP3_PROFILE, REEL_PROFILE)
+SEPARATION_PROFILE = "comfy-frontend-1.37.11-audio-separation-1.4.0-core-mixed-reference"
ASR_PROFILE = "comfy-frontend-1.37.11-asr-b037d7be-reference"
PROFILE = "comfy-frontend-1.37.11-core-reference"
@@ -86,7 +88,7 @@ def reference_definitions(profile: str = PROFILE) -> dict[str, Any]:
"output": outputs,
}
- if profile in MEDIA_PROFILES:
+ if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE):
return media_definitions(profile)
if profile == ASR_PROFILE:
definitions = reference_definitions(PREVIEW_PROFILE)
@@ -160,7 +162,7 @@ def reference_definitions(profile: str = PROFILE) -> dict[str, Any]:
def serialize_reference_widgets(node: dict[str, Any], profile: str = PROFILE) -> dict[str, Any]:
"""Apply only the pinned identity serializers; reject any extra/missing value."""
- if profile in MEDIA_PROFILES:
+ if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE):
return serialize_media_node(node, profile)
if profile == ASR_PROFILE:
if any(k in node for k in ("widgets", "widgets_values_named", "serializeValue")):
@@ -1036,6 +1038,12 @@ _COMPOSIT_VERSION = "42ccdd8f75ab312285eaa77073a5cc20bdba484c"
_MEDIA_LAYOUTS = {
"LoadAudio": (("audio", str),),
"SaveAudioMP3": (("filename_prefix", str), ("quality", str)),
+ "PreviewAudio": (),
+ "AudioSeparation": (
+ ("chunk_fade_shape", str),
+ ("chunk_length", float),
+ ("chunk_overlap", float),
+ ),
"LoadImage": (("image", str),),
"PreviewImage": (),
"LayerUtility: ImageReel": (
@@ -1065,6 +1073,15 @@ def media_definitions(profile):
"output": outputs,
}
+ if profile == SEPARATION_PROFILE:
+ definitions = media_definitions(MP3_PROFILE)
+ definitions["PreviewAudio"] = spec({"audio": "AUDIO"}, [], {"audioUI": "AUDIO_UI"})
+ definitions["AudioSeparation"] = spec(
+ {"audio": "AUDIO"},
+ ["AUDIO"] * 4,
+ {"chunk_fade_shape": "COMBO", "chunk_length": "FLOAT", "chunk_overlap": "FLOAT"},
+ )
+ return definitions
if profile == MP3_PROFILE:
return {
"LoadAudio": spec({"audio": "COMBO"}, ["AUDIO"], {"audioUI": "AUDIO_UI"}),
@@ -1115,9 +1132,33 @@ def serialize_media_node(node, profile):
raise ValueError("节点类型/模式不在媒体固定参考契约内")
if any(k in node for k in ("widgets", "widgets_values_named", "serializeValue")):
raise ValueError("媒体参考不支持自定义控件/serializer覆盖")
- provider = "comfyui_layerstyle" if ct.startswith("LayerUtility:") else "comfy-core"
+ if profile == SEPARATION_PROFILE:
+ if type(node.get("mode", 0)) is not int:
+ raise ValueError("音频分离参考模式必须为整数0")
+ ue = props.get("ue_properties") or {}
+ if any(ue.get(k) for k in ("widget_ue_connectable", "input_ue_unconnectable")) or any(
+ k in props for k in ("widgets", "widgets_values_named", "serializeValue")
+ ):
+ raise ValueError("音频分离参考不覆盖自定义/UE控件改写")
+ for slot, output in enumerate(node.get("outputs", [])):
+ if "slot_index" in output and (
+ type(output["slot_index"]) is not int or output["slot_index"] != slot
+ ):
+ raise ValueError("音频分离输出槽索引冲突")
+ provider = (
+ "audio-separation-nodes-comfyui"
+ if ct == "AudioSeparation"
+ else ("comfyui_layerstyle" if ct.startswith("LayerUtility:") else "comfy-core")
+ )
version = (
- _REEL_VERSION
+ {
+ "LoadAudio": "0.3.68",
+ "PreviewAudio": "0.3.68",
+ "SaveAudioMP3": "0.3.71",
+ "AudioSeparation": "1.4.0",
+ }[ct]
+ if profile == SEPARATION_PROFILE
+ else _REEL_VERSION
if ct == "LayerUtility: ImageReel"
else _COMPOSIT_VERSION
if ct == "LayerUtility: ImageReelComposit"
@@ -1142,11 +1183,25 @@ def serialize_media_node(node, profile):
raise ValueError("LoadImage上传按钮占位不符")
result = {}
for (name, kind), value in zip(layout, values):
- if type(value) is not kind:
+ if (kind is float and type(value) not in (int, float)) or (
+ kind is not float and type(value) is not kind
+ ):
raise ValueError(f"媒体字段{name}类型不符")
+ if kind is float and (not 0 <= value <= 2048 or not math.isfinite(value)):
+ # Plugin has no min/max. This bounded profile accepts only the
+ # pinned frontend constructor's default UI range, not server bounds.
+ # Saved-state restore assigns directly; do not invoke onChange round.
+ raise ValueError(f"媒体字段{name}超出固定前端参考范围[0,2048]")
if kind is str and ("{" in value or "}" in value or "%" in value):
raise ValueError(f"媒体字段{name}含未覆盖动态表达式")
result[name] = value
+ if ct == "AudioSeparation" and result["chunk_fade_shape"] not in (
+ "linear",
+ "half_sine",
+ "logarithmic",
+ "exponential",
+ ):
+ raise ValueError("AudioSeparation chunk_fade_shape静态枚举不符")
if ct == "SaveAudioMP3" and result["quality"] not in ("V0", "128k", "320k"):
raise ValueError("MP3 quality静态枚举不符")
if ct == "LayerUtility: ImageReelComposit" and result["color_theme"] not in ("light", "dark"):
@@ -1164,7 +1219,7 @@ def serialize_media_node(node, profile):
spec = definitions[ct]["input"]
slots = {k: v[0] for k, v in {**spec["required"], **spec["optional"]}.items()}
widgets = {name for name, _ in layout}
- if ct in ("LoadAudio", "SaveAudioMP3"):
+ if ct in ("LoadAudio", "SaveAudioMP3", "PreviewAudio"):
widgets.add("audioUI")
if ct in ("LoadAudio", "LoadImage"):
slots["upload"] = "AUDIOUPLOAD" if ct == "LoadAudio" else "IMAGEUPLOAD"
@@ -1172,6 +1227,8 @@ def serialize_media_node(node, profile):
sockets = node.get("inputs", [])
if len(sockets) != len(slots) or {s.get("name") for s in sockets} != set(slots):
raise ValueError("媒体输入槽缺失/重复/额外")
+ if profile == SEPARATION_PROFILE and [s.get("name") for s in sockets] != list(slots):
+ raise ValueError("音频分离参考输入/控件构造顺序不符")
for socket in sockets:
name = socket["name"]
if socket.get("type") != slots[name] or socket.get("widget") != (
@@ -1181,6 +1238,6 @@ def serialize_media_node(node, profile):
# Do not infer widget-to-link coercions, converted widgets, or UI links.
if name in widgets and socket.get("link") is not None:
raise ValueError("媒体控件连线转换未证明")
- if ct in ("LoadAudio", "SaveAudioMP3"):
+ if ct in ("LoadAudio", "SaveAudioMP3", "PreviewAudio"):
result["audioUI"] = ""
return result
diff --git a/calliope-backend/src/calliope/comfyui/ui2api.py b/calliope-backend/src/calliope/comfyui/ui2api.py
index 4d7d17f0..93b421a2 100644
--- a/calliope-backend/src/calliope/comfyui/ui2api.py
+++ b/calliope-backend/src/calliope/comfyui/ui2api.py
@@ -21,6 +21,7 @@ from .serialization_reference import (
PREVIEW_PROFILE,
PRIMITIVE_PROFILE,
PROFILE,
+ SEPARATION_PROFILE,
case04_definitions,
fold_reference_primitives,
promoted_definitions,
@@ -61,6 +62,7 @@ def convert_reference(source: Any, profile: str = PROFILE) -> Conversion:
PROFILE,
ASR_PROFILE,
*MEDIA_PROFILES,
+ SEPARATION_PROFILE,
AUX_PROFILE,
PRIMITIVE_PROFILE,
PREVIEW_PROFILE,
@@ -124,10 +126,14 @@ def convert_reference(source: Any, profile: str = PROFILE) -> Conversion:
and (source.get("extra") or {}).get("frontendVersion") != "1.37.11"
):
raise ValueError("PreviewAny 需要显式1.37.11前端声明")
- if profile in MEDIA_PROFILES and any(
+ if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE) and any(
node.get("type") == "Reroute" for node in source.get("nodes", [])
):
raise ValueError("媒体最小参考仅覆盖直接连线,不扩展虚拟节点")
+ if profile == SEPARATION_PROFILE and any(
+ (source.get("extra") or {}).get(k) for k in ("ue_links", "links_added_by_ue")
+ ):
+ raise ValueError("音频分离参考不覆盖UE附加连线")
original = source
if profile in (PRIMITIVE_PROFILE, PREVIEW_PROFILE):
source = fold_reference_primitives(source, profile)
@@ -139,7 +145,7 @@ def convert_reference(source: Any, profile: str = PROFILE) -> Conversion:
except (ValueError, TypeError, KeyError, AttributeError, IndexError) as exc:
return Conversion(None, [{"code": "invalid_reference_contract", "message": str(exc)}], True)
result.reference_only = True
- if profile in (ASR_PROFILE, *MEDIA_PROFILES):
+ if profile in (ASR_PROFILE, *MEDIA_PROFILES, SEPARATION_PROFILE):
result.serialization_stage = "restored_saved_state_before_queue_hooks"
return result
@@ -220,7 +226,7 @@ def _convert(
for lid in links:
try:
resolve_reference_link(nodes, links, lid)
- if reference_profile in MEDIA_PROFILES:
+ if reference_profile in (*MEDIA_PROFILES, SEPARATION_PROFILE):
link = links[lid]
upstream = nodes[str(link[1])]["outputs"][link[2]]
downstream = nodes[str(link[3])]["inputs"][link[4]]
@@ -272,7 +278,13 @@ def _convert(
allowed = set(declared) | ({"upload"} if ct == "LoadImage" else set())
if (
reference_profile
- in (PRIMITIVE_PROFILE, PREVIEW_PROFILE, ASR_PROFILE, *MEDIA_PROFILES)
+ in (
+ PRIMITIVE_PROFILE,
+ PREVIEW_PROFILE,
+ ASR_PROFILE,
+ *MEDIA_PROFILES,
+ SEPARATION_PROFILE,
+ )
and ct == "LoadAudio"
):
allowed |= {"upload", "audioUI"}
diff --git a/calliope-backend/tests/test_audio_separation_reference.py b/calliope-backend/tests/test_audio_separation_reference.py
new file mode 100644
index 00000000..f912c239
--- /dev/null
+++ b/calliope-backend/tests/test_audio_separation_reference.py
@@ -0,0 +1,414 @@
+"""Pinned source AST, actual saved graph, synthetic mutations; no upstream execution."""
+
+from __future__ import annotations
+
+import ast
+import copy
+import hashlib
+import json
+from pathlib import Path
+
+import pytest
+from scripts import audit_reference_conversion as audit
+
+from calliope.comfyui.serialization_reference import MP3_PROFILE, SEPARATION_PROFILE
+from calliope.comfyui.ui2api import convert, convert_reference
+
+REPO = Path(__file__).resolve().parents[2]
+SOURCE = (
+ "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/"
+ "视频-音频分离.json"
+)
+SOURCES = REPO / "docs/hel-892/separation-reference"
+
+
+def graph():
+ return json.loads((REPO / SOURCE).read_bytes())
+
+
+def node(source, nid):
+ return next(n for n in source["nodes"] if n["id"] == nid)
+
+
+def converted(source):
+ result = convert_reference(source, SEPARATION_PROFILE)
+ assert result.reference_only
+ return result
+
+
+def test_original_plugin_schema_registration_and_artifact_bytes_without_import():
+ raw = (SOURCES / "plugin-5291831d__src__separation.py").read_bytes()
+ assert raw == (SOURCES / "registry__src__separation.py").read_bytes()
+ tree = ast.parse(raw)
+ cls = next(n for n in tree.body if isinstance(n, ast.ClassDef) and n.name == "AudioSeparation")
+ method = next(n for n in cls.body if isinstance(n, ast.FunctionDef) and n.name == "INPUT_TYPES")
+ schema = ast.literal_eval(next(n.value for n in ast.walk(method) if isinstance(n, ast.Return)))
+ assert list(schema["required"]) == ["audio"]
+ assert list(schema["optional"]) == ["chunk_fade_shape", "chunk_length", "chunk_overlap"]
+ assert schema["optional"]["chunk_fade_shape"][0] == [
+ "linear",
+ "half_sine",
+ "logarithmic",
+ "exponential",
+ ]
+ for field in ("chunk_length", "chunk_overlap"):
+ assert schema["optional"][field][0] == "FLOAT"
+ assert not {"min", "max"}.intersection(schema["optional"][field][1])
+ attrs = {
+ n.targets[0].id: ast.literal_eval(n.value)
+ for n in cls.body
+ if isinstance(n, ast.Assign) and isinstance(n.targets[0], ast.Name)
+ }
+ assert attrs["RETURN_TYPES"] == ("AUDIO",) * 4
+ assert attrs["RETURN_NAMES"] == ("Bass", "Drums", "Other", "Vocals")
+ output_method = next(
+ n for n in cls.body if isinstance(n, ast.FunctionDef) and n.name == "sources_to_tuple"
+ )
+ order = next(
+ n
+ for n in ast.walk(output_method)
+ if isinstance(n, ast.Assign)
+ and any(isinstance(t, ast.Name) and t.id == "output_order" for t in n.targets)
+ )
+ assert ast.literal_eval(order.value) == ["bass", "drums", "other", "vocals"]
+ tree = ast.parse((SOURCES / "plugin-5291831d____init__.py").read_text())
+ mapping = next(n.value for n in tree.body if isinstance(n, ast.Assign))
+ assert ("AudioSeparation", "AudioSeparation") in [
+ (k.value, v.id) for k, v in zip(mapping.keys, mapping.values)
+ ]
+
+
+@pytest.mark.parametrize(
+ "version,classes", [("0.3.68", ["LoadAudio", "PreviewAudio"]), ("0.3.71", ["SaveAudioMP3"])]
+)
+def test_each_pinned_core_definition_and_registration_has_its_own_identity(version, classes):
+ tree = ast.parse((SOURCES / f"core-{version}__comfy_extras__nodes_audio.py").read_text())
+ mapping = next(
+ n.value
+ for n in tree.body
+ if isinstance(n, ast.Assign)
+ and any(isinstance(t, ast.Name) and t.id == "NODE_CLASS_MAPPINGS" for t in n.targets)
+ )
+ names = {k.value: v.id for k, v in zip(mapping.keys, mapping.values)}
+ expected = {
+ "LoadAudio": ["audio"],
+ "PreviewAudio": ["audio"],
+ "SaveAudioMP3": ["audio", "filename_prefix", "quality"],
+ }
+ for name in classes:
+ assert names[name] == name
+ cls = next(n for n in tree.body if isinstance(n, ast.ClassDef) and n.name == name)
+ method = next(
+ n for n in cls.body if isinstance(n, ast.FunctionDef) and n.name == "INPUT_TYPES"
+ )
+ schema = next(n.value for n in ast.walk(method) if isinstance(n, ast.Return))
+ required = next(v for k, v in zip(schema.keys, schema.values) if k.value == "required")
+ assert [k.value for k in required.keys] == expected[name]
+ if name == "SaveAudioMP3":
+ assert ast.literal_eval(required.values[2])[0] == ["V0", "128k", "320k"]
+ if name == "PreviewAudio":
+ assert cls.bases[0].id == "SaveAudio"
+
+
+def test_real_graph_complete_candidate_independently_checks_every_field_and_pointer():
+ source = graph()
+ original = copy.deepcopy(source)
+ result = converted(source)
+ assert source == original and convert(source).prompt is None
+ assert (
+ not result.issues
+ and result.serialization_stage == "restored_saved_state_before_queue_hooks"
+ )
+ prompt = result.prompt
+ assert prompt is not None and len(prompt) == 7
+ layouts = {
+ "SaveAudioMP3": ["filename_prefix", "quality"],
+ "LoadAudio": ["audio"],
+ "PreviewAudio": [],
+ "AudioSeparation": ["chunk_fade_shape", "chunk_length", "chunk_overlap"],
+ }
+ for n in source["nodes"]:
+ actual = prompt[str(n["id"])]
+ assert actual["class_type"] == n["type"] and actual["_meta"] == {"title": n["type"]}
+ expected = dict(zip(layouts[n["type"]], n["widgets_values"]))
+ if n["type"] != "AudioSeparation":
+ expected["audioUI"] = ""
+ for socket in n["inputs"]:
+ if socket["link"] is not None:
+ link = next(link for link in source["links"] if link[0] == socket["link"])
+ expected[socket["name"]] = [str(link[1]), link[2]]
+ assert actual["inputs"] == expected
+ assert {k: type(v) for k, v in actual["inputs"].items()} == {
+ k: type(v) for k, v in expected.items()
+ }
+ assert prompt["17"]["inputs"]["audio"] == ["10", 0] # original audio, NOT a separated stem
+ assert {nid: prompt[nid]["inputs"]["audio"] for nid in ("18", "19", "20", "15")} == {
+ "18": ["11", 0],
+ "19": ["11", 1],
+ "20": ["11", 2],
+ "15": ["11", 3],
+ }
+ assert type(prompt["11"]["inputs"]["chunk_length"]) is int
+ assert prompt["11"]["inputs"]["chunk_overlap"] == 0.2
+ attempt = audit.profile_attempt(source, SEPARATION_PROFILE)
+ assert attempt["candidate_prompt"] == prompt
+ assert attempt["candidate_sha256"] == audit.canonical_sha(prompt)
+ assert attempt["assumptions"]["source_frontend_declaration"] is None
+ assert attempt["assumptions"]["missing_node_declarations"] == []
+ assert attempt["assumptions"]["target_version_match"] == "unknown"
+ fields = attempt["field_evidence"]
+ assert len(fields) == 18
+ for field in fields:
+ if field["source_pointer"] is None:
+ assert field["field"] == "audioUI" and field["value"] == ""
+ continue
+ value = source
+ for part in field["source_pointer"].split("/")[1:]:
+ value = value[int(part)] if isinstance(value, list) else value[part]
+ expected = (
+ [str(value[1]), value[2]] if field["source_pointer"].startswith("/links/") else value
+ )
+ assert type(expected) is type(field["value"]) and expected == field["value"]
+
+
+@pytest.mark.parametrize("shape", ["linear", "half_sine", "logarithmic", "exponential"])
+@pytest.mark.parametrize(
+ "length,overlap", [(20, 0.2), (20.0, 1), (0, 0.0), (2048, 2048.0), (1.25, 0.123456)]
+)
+def test_changed_float_values_and_enums_preserve_exact_saved_numeric_form(shape, length, overlap):
+ source = graph()
+ node(source, 11)["widgets_values"] = [shape, length, overlap]
+ actual = converted(source).prompt["11"]["inputs"]
+ assert actual["chunk_fade_shape"] == shape
+ assert type(actual["chunk_length"]) is type(length) and actual["chunk_length"] == length
+ assert type(actual["chunk_overlap"]) is type(overlap) and actual["chunk_overlap"] == overlap
+
+
+@pytest.mark.parametrize("quality", ["V0", "128k", "320k"])
+def test_prefix_and_quality_and_audio_name_propagate(quality):
+ source = graph()
+ node(source, 17)["widgets_values"] = ["新目录/前缀", quality]
+ node(source, 10)["widgets_values"][0] = "第二段 音频.mp4"
+ prompt = converted(source).prompt
+ assert prompt["17"]["inputs"]["quality"] == quality
+ assert prompt["17"]["inputs"]["filename_prefix"] == "新目录/前缀"
+ assert prompt["10"]["inputs"]["audio"] == "第二段 音频.mp4"
+
+
+@pytest.mark.parametrize("index", [1, 2])
+@pytest.mark.parametrize(
+ "bad", [True, False, None, "20", [], -0.1, 2048.01, float("nan"), float("inf"), 10**1000]
+)
+def test_invalid_numeric_type_or_frontend_bound_closes_whole_graph(index, bad):
+ source = graph()
+ node(source, 11)["widgets_values"][index] = bad
+ result = converted(source)
+ assert result.prompt is None and result.issues
+
+
+@pytest.mark.parametrize(
+ "mutation",
+ [
+ "enum",
+ "null_enum",
+ "extra_widget",
+ "missing_widget",
+ "preview_widget",
+ "load_dom",
+ "quality",
+ "version",
+ "plugin_version",
+ "provider",
+ "missing_version",
+ "swap_core",
+ "frontend",
+ "serializer",
+ "named_override",
+ "ue_override",
+ "ue_link",
+ "bad_widget",
+ "socket_type",
+ "missing_socket",
+ "socket_order",
+ "extra_output",
+ "output_index",
+ "bad_slot",
+ "bool_slot",
+ "link_type",
+ "dangling",
+ "unused_bad_link",
+ "muted",
+ "bool_mode",
+ "unknown_node",
+ "dynamic_prefix",
+ "preview_audio_ui_link",
+ ],
+)
+def test_unsupported_layout_version_override_and_structure_fail_closed(mutation):
+ source = graph()
+ separation = node(source, 11)
+ if mutation == "enum":
+ separation["widgets_values"][0] = "cosine"
+ elif mutation == "null_enum":
+ separation["widgets_values"][0] = None
+ elif mutation == "extra_widget":
+ separation["widgets_values"].append(1)
+ elif mutation == "missing_widget":
+ separation["widgets_values"].pop()
+ elif mutation == "preview_widget":
+ node(source, 15)["widgets_values"] = [None]
+ elif mutation == "load_dom":
+ node(source, 10)["widgets_values"][1] = "audio/server.wav"
+ elif mutation == "quality":
+ node(source, 17)["widgets_values"][1] = "invalid"
+ elif mutation == "version":
+ node(source, 10)["properties"]["ver"] = "0.11.0"
+ elif mutation == "plugin_version":
+ separation["properties"]["ver"] = "1.5.0"
+ elif mutation == "provider":
+ separation["properties"]["cnr_id"] = "other"
+ elif mutation == "missing_version":
+ separation["properties"].pop("ver")
+ elif mutation == "swap_core":
+ node(source, 17)["properties"]["ver"] = "0.3.68"
+ elif mutation == "frontend":
+ source["extra"]["frontendVersion"] = "1.53.6"
+ elif mutation == "serializer":
+ separation["serializeValue"] = "custom"
+ elif mutation == "named_override":
+ separation["widgets_values_named"] = {"chunk_length": 1}
+ elif mutation == "ue_override":
+ separation["properties"]["ue_properties"]["widget_ue_connectable"] = {"chunk_length": True}
+ elif mutation == "ue_link":
+ source["extra"]["ue_links"] = [[1, 2]]
+ elif mutation == "bad_widget":
+ separation["inputs"][1]["widget"] = {"name": "wrong"}
+ elif mutation == "socket_type":
+ separation["inputs"][2]["type"] = "INT"
+ elif mutation == "missing_socket":
+ separation["inputs"].pop()
+ elif mutation == "socket_order":
+ separation["inputs"][1:3] = reversed(separation["inputs"][1:3])
+ elif mutation == "extra_output":
+ separation["outputs"].append({"name": "other", "type": "AUDIO", "links": []})
+ elif mutation == "output_index":
+ separation["outputs"][3]["slot_index"] = 0
+ elif mutation == "bad_slot":
+ source["links"][1][2] = 4
+ elif mutation == "bool_slot":
+ source["links"][1][2] = True
+ elif mutation == "link_type":
+ source["links"][1][5] = "IMAGE"
+ elif mutation == "dangling":
+ source["links"][1][1] = 99
+ elif mutation == "unused_bad_link":
+ source["links"].append([999, 11, 0, 15, 0, "AUDIO"])
+ elif mutation == "muted":
+ node(source, 15)["mode"] = 2
+ elif mutation == "bool_mode":
+ node(source, 15)["mode"] = False
+ elif mutation == "unknown_node":
+ node(source, 15)["type"] = "UnknownPreview"
+ elif mutation == "dynamic_prefix":
+ node(source, 17)["widgets_values"][0] = "%date%/audio"
+ elif mutation == "preview_audio_ui_link":
+ node(source, 15)["inputs"][1]["link"] = 15
+ result = converted(source)
+ assert result.prompt is None and result.issues
+
+
+def test_two_independent_graph_instances_keep_all_four_nonzero_slots_and_scalars():
+ source = graph()
+ other = graph()
+ for n in other["nodes"]:
+ n["id"] += 100
+ for socket in n["inputs"]:
+ if socket.get("link") is not None:
+ socket["link"] += 1000
+ for socket in n["outputs"]:
+ socket["links"] = [lid + 1000 for lid in socket.get("links", [])]
+ for link in other["links"]:
+ link[0] += 1000
+ link[1] += 100
+ link[3] += 100
+ node(other, 111)["widgets_values"] = ["exponential", 7.5, 0.375]
+ node(other, 117)["widgets_values"] = ["第二路/音频", "128k"]
+ node(other, 110)["widgets_values"][0] = "second.wav"
+ source["nodes"].extend(other["nodes"])
+ source["links"].extend(other["links"])
+ prompt = converted(source).prompt
+ assert len(prompt) == 14
+ for out, slot in [(18, 0), (19, 1), (20, 2), (15, 3)]:
+ assert prompt[str(out)]["inputs"]["audio"] == ["11", slot]
+ assert prompt[str(out + 100)]["inputs"]["audio"] == ["111", slot]
+ assert prompt["11"]["inputs"]["chunk_length"] == 20
+ assert prompt["111"]["inputs"]["chunk_length"] == 7.5
+ assert prompt["117"]["inputs"]["audio"] == ["110", 0]
+ assert prompt["17"]["inputs"]["audio"] == ["10", 0]
+ assert prompt["117"]["inputs"]["filename_prefix"] == "第二路/音频"
+
+
+def test_old_mp3_profile_rejects_real_graph_and_new_profile_rejects_old_core():
+ source = graph()
+ assert convert_reference(source, MP3_PROFILE).prompt is None
+ for n in source["nodes"]:
+ if n["properties"]["cnr_id"] == "comfy-core":
+ n["properties"]["ver"] = "0.11.0"
+ assert converted(source).prompt is None
+
+
+def test_library_actual_delta_keeps_every_old_attempt_and_all_six_golden_comparisons():
+ previous = json.loads((REPO / "docs/hel-892/media-evidence/library.json").read_bytes())
+ baseline = tuple(p for p in audit.REFERENCE_PROFILES if p != SEPARATION_PROFILE)
+ old = audit.audit_library(REPO, baseline)
+ current = audit.audit_library(REPO)
+ for historical, before, after in zip(previous["cases"], old["cases"], current["cases"]):
+ assert historical["source_path"] == before["source_path"] == after["source_path"]
+ assert historical["attempts"] == before["attempts"] == after["attempts"][:-1]
+ assert historical.get("comparisons") == before.get("comparisons")
+ old_comparisons = [c for c in after.get("comparisons", []) if c["profile"] in baseline]
+ assert old_comparisons == before.get("comparisons", [])
+ assert current["coverage_delta"]["baseline_profiles"] == list(baseline)
+ assert current["coverage_delta"]["new_complete_paths"] == [SOURCE]
+ assert current["ui_total"] == 145
+ row = next(r for r in current["cases"] if r["source_path"] == SOURCE)
+ assert row["source_sha256"] == hashlib.sha256((REPO / SOURCE).read_bytes()).hexdigest()
+ assert row["comparison_status"] == "comparison_unavailable" and "comparisons" not in row
+ assert not row["production_prompt_available"] and not row["execution_verified"]
+ assert all(
+ "candidate_prompt" not in a
+ for r in current["cases"]
+ for a in r["attempts"]
+ if a["status"] != "complete_reference_candidate"
+ )
+
+ # Other frontends remain out of scope: all-not-applicable set is identical.
+ def unavailable(report):
+ return {
+ r["source_path"]
+ for r in report["cases"]
+ if all(a["status"] == "not_applicable" for a in r["attempts"])
+ }
+
+ assert unavailable(previous) == unavailable(current)
+
+
+async def test_synthetic_preview_and_mp3_history_only_accept_file_descriptors():
+ from calliope.comfyui.client import ComfyUIClient
+
+ client = ComfyUIClient("http://unused.invalid")
+ # Synthetic protocol fixture, not real encoding, history, or separation.
+ fixture = {
+ "outputs": {
+ nid: {
+ "audio": [
+ {"filename": f"synthetic_{nid}.{ext}", "subfolder": "audio", "type": kind}
+ ]
+ }
+ for nid, ext, kind in [("15", "flac", "temp"), ("17", "mp3", "output")]
+ }
+ }
+ assert len(client.extract_outputs(fixture, {"15": "audio", "17": "audio"})) == 2
+ for bad in ["/server/audio.mp3", "https://example.invalid/a.mp3", "", {"audioUI": ""}]:
+ assert client.extract_outputs({"outputs": {"15": {"audio": [bad]}}}, {"15": "audio"}) == []
+ await client.close()
diff --git a/calliope-backend/tests/test_media_reference.py b/calliope-backend/tests/test_media_reference.py
index 0cc0b040..c90efb3d 100644
--- a/calliope-backend/tests/test_media_reference.py
+++ b/calliope-backend/tests/test_media_reference.py
@@ -251,9 +251,22 @@ def test_mixed_plugin_commits_cannot_be_interchanged():
def test_library_actual_delta_keeps_old_candidates_and_no_golden_claim():
previous = audit.audit_library(
- REPO, tuple(p for p in audit.REFERENCE_PROFILES if p not in MEDIA_PROFILES)
+ REPO,
+ tuple(
+ p
+ for p in audit.REFERENCE_PROFILES
+ if p not in MEDIA_PROFILES and p != audit.SEPARATION_PROFILE
+ ),
+ )
+ current = audit.audit_library(
+ REPO,
+ tuple(p for p in audit.REFERENCE_PROFILES if p != audit.SEPARATION_PROFILE),
+ baseline_profiles=tuple(
+ p
+ for p in audit.REFERENCE_PROFILES
+ if p not in MEDIA_PROFILES and p != audit.SEPARATION_PROFILE
+ ),
)
- current = audit.audit_library(REPO)
assert (
current["coverage_delta"]["previous_complete_paths"]
== previous["coverage_delta"]["current_complete_paths"]
diff --git a/docs/hel-892/separation-reference/contract.json b/docs/hel-892/separation-reference/contract.json
new file mode 100644
index 00000000..2e1b142b
--- /dev/null
+++ b/docs/hel-892/separation-reference/contract.json
@@ -0,0 +1,438 @@
+{
+ "authority": "public_reference_only_not_object_info",
+ "serialization_stage": "restored_saved_state_before_queue_hooks",
+ "source_path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/视频-音频分离.json",
+ "source_sha256": "4861e3e33291ed962d2215b1d8cc976a4706d19719e3541e9cbb2c636683afc3",
+ "frontend": {
+ "source_declaration": null,
+ "selected_tag": "1.37.11",
+ "selected_commit": "4bf6a1960028cc5cda57d48f9fb01a74dfaade43",
+ "selection": "explicit reference assumption only, not inferred source/target match",
+ "unmodified_frontend_and_widgets_assumed": true,
+ "ue_serializer_match": "unknown"
+ },
+ "node_versions": {
+ "17": {
+ "type": "SaveAudioMP3",
+ "provider": "comfy-core",
+ "version": "0.3.71",
+ "ue_version": "7.5.2",
+ "source_pointer": "/nodes/0/properties",
+ "target_installation_match": "unknown"
+ },
+ "10": {
+ "type": "LoadAudio",
+ "provider": "comfy-core",
+ "version": "0.3.68",
+ "ue_version": "7.4.1",
+ "source_pointer": "/nodes/1/properties",
+ "target_installation_match": "unknown"
+ },
+ "20": {
+ "type": "PreviewAudio",
+ "provider": "comfy-core",
+ "version": "0.3.68",
+ "ue_version": "7.4.1",
+ "source_pointer": "/nodes/2/properties",
+ "target_installation_match": "unknown"
+ },
+ "15": {
+ "type": "PreviewAudio",
+ "provider": "comfy-core",
+ "version": "0.3.68",
+ "ue_version": "7.4.1",
+ "source_pointer": "/nodes/3/properties",
+ "target_installation_match": "unknown"
+ },
+ "19": {
+ "type": "PreviewAudio",
+ "provider": "comfy-core",
+ "version": "0.3.68",
+ "ue_version": "7.4.1",
+ "source_pointer": "/nodes/4/properties",
+ "target_installation_match": "unknown"
+ },
+ "18": {
+ "type": "PreviewAudio",
+ "provider": "comfy-core",
+ "version": "0.3.68",
+ "ue_version": "7.4.1",
+ "source_pointer": "/nodes/5/properties",
+ "target_installation_match": "unknown"
+ },
+ "11": {
+ "type": "AudioSeparation",
+ "provider": "audio-separation-nodes-comfyui",
+ "version": "1.4.0",
+ "ue_version": "7.4.1",
+ "source_pointer": "/nodes/6/properties",
+ "target_installation_match": "unknown"
+ }
+ },
+ "core_versions": {
+ "0.3.68": {
+ "commit": "265adad858e1f31b66cd3523a02b16f5d34ced52",
+ "classes": [
+ "LoadAudio",
+ "PreviewAudio"
+ ],
+ "schema": "comfy_extras/nodes_audio.py",
+ "registrations": {
+ "LoadAudio": [
+ 586,
+ 586
+ ],
+ "PreviewAudio": [
+ 587,
+ 587
+ ]
+ },
+ "license": "GPL-3.0",
+ "exact_rule_locations": {
+ "SaveAudio definition": [
+ 196,
+ 218
+ ],
+ "SaveAudioMP3 definition": [
+ 220,
+ 243
+ ],
+ "PreviewAudio definition": [
+ 270,
+ 281
+ ],
+ "LoadAudio definition": [
+ 319,
+ 349
+ ],
+ "SaveAudioMP3 registration": [
+ 584,
+ 584
+ ],
+ "LoadAudio registration": [
+ 586,
+ 586
+ ],
+ "PreviewAudio registration": [
+ 587,
+ 587
+ ],
+ "save_audio UI descriptors": [
+ 187,
+ 194
+ ],
+ "MP3 codec options": [
+ 158,
+ 173
+ ]
+ },
+ "definitions": {
+ "LoadAudio": [
+ 319,
+ 349
+ ],
+ "PreviewAudio": [
+ 270,
+ 281
+ ]
+ }
+ },
+ "0.3.71": {
+ "commit": "c55fd7481626d8bee8044ea7512ea996d13a1b90",
+ "classes": [
+ "SaveAudioMP3"
+ ],
+ "license": "GPL-3.0",
+ "exact_rule_locations": {
+ "SaveAudio definition": [
+ 196,
+ 218
+ ],
+ "SaveAudioMP3 definition": [
+ 220,
+ 243
+ ],
+ "PreviewAudio definition": [
+ 270,
+ 281
+ ],
+ "LoadAudio definition": [
+ 319,
+ 349
+ ],
+ "SaveAudioMP3 registration": [
+ 584,
+ 584
+ ],
+ "LoadAudio registration": [
+ 586,
+ 586
+ ],
+ "PreviewAudio registration": [
+ 587,
+ 587
+ ],
+ "save_audio UI descriptors": [
+ 187,
+ 194
+ ],
+ "MP3 codec options": [
+ 158,
+ 173
+ ]
+ },
+ "definitions": {
+ "SaveAudioMP3": [
+ 220,
+ 243
+ ]
+ },
+ "registrations": {
+ "SaveAudioMP3": [
+ 584,
+ 584
+ ]
+ }
+ }
+ },
+ "plugin": {
+ "repository": "https://github.com/christian-byrne/audio-separation-nodes-comfyui",
+ "reference_commit": "5291831d7c321ab7a5192374482f9848dffee75b",
+ "declared_version": "1.4.0",
+ "version_definition": "pyproject.toml:4",
+ "class_definition": "src/separation.py:14",
+ "registration": "__init__.py:11",
+ "registry_source_match": "selected source, registration, project metadata, publish workflow and README match 1.4.0 artifact bytes exactly; see discovery.json",
+ "registry_commit_binding": "unknown; API supplies no commit, source-byte agreement is not a signed release mapping",
+ "license": "unknown; pyproject names LICENSE but pinned tree/package contain no license file. Do not copy later MIT declaration onto 1.4.0",
+ "no_plugin_js_at_reference_commit": true,
+ "target_installation_match": "unknown"
+ },
+ "widget_layouts": {
+ "LoadAudio": [
+ "audio COMBO",
+ "audioUI DOM hole (serialize=false)",
+ "upload button (options.serialize=false)"
+ ],
+ "SaveAudioMP3": [
+ "filename_prefix STRING",
+ "quality COMBO",
+ "audioUI nonpersisted tail DOM"
+ ],
+ "PreviewAudio": [
+ "audioUI nonpersisted tail DOM"
+ ],
+ "AudioSeparation": [
+ "chunk_fade_shape COMBO",
+ "chunk_length FLOAT",
+ "chunk_overlap FLOAT"
+ ]
+ },
+ "saved_shapes": {
+ "LoadAudio": [
+ "file string",
+ null,
+ null
+ ],
+ "SaveAudioMP3": [
+ "audio/ComfyUI",
+ "320k"
+ ],
+ "PreviewAudio": [],
+ "AudioSeparation": [
+ "half_sine",
+ 20,
+ 0.2
+ ]
+ },
+ "numeric_contract": {
+ "plugin_min_max": "not declared for either FLOAT",
+ "frontend_constructor_range": [
+ 0,
+ 2048
+ ],
+ "range_policy": "bounded reference profile restricts finite int/float to pinned frontend default UI limits; not a server/model-valid range claim",
+ "restore_policy": "LGraphNode.configure assigns widget.value directly, without float callback; do not round or replace source values with defaults",
+ "bool_policy": "reject; Python bool is not accepted as numeric",
+ "source_values": {
+ "chunk_length": {
+ "value": 20,
+ "parsed_type": "int"
+ },
+ "chunk_overlap": {
+ "value": 0.2,
+ "parsed_type": "float"
+ }
+ },
+ "units_reference": "source tooltip says seconds; target meaning/effect unverified. separate_sources uses sample_rate*segment*(1+overlap) and overlap*sample_rate; do not assert alternative units, safe cross-parameter ranges, or performance"
+ },
+ "enums": {
+ "chunk_fade_shape": [
+ "linear",
+ "half_sine",
+ "logarithmic",
+ "exponential"
+ ],
+ "quality": [
+ "V0",
+ "128k",
+ "320k"
+ ]
+ },
+ "output_order": {
+ "types": [
+ "AUDIO",
+ "AUDIO",
+ "AUDIO",
+ "AUDIO"
+ ],
+ "reference_names": [
+ "Bass",
+ "Drums",
+ "Other",
+ "Vocals"
+ ],
+ "actual_return_order": [
+ "bass",
+ "drums",
+ "other",
+ "vocals"
+ ],
+ "source_labels": [
+ "低音",
+ "鼓",
+ "其他",
+ "人声"
+ ],
+ "source_slot_to_preview": {
+ "0": "18",
+ "1": "19",
+ "2": "20",
+ "3": "15"
+ },
+ "mp3_source": [
+ "10",
+ 0
+ ],
+ "mp3_is_separated_stem": false
+ },
+ "protocol": {
+ "PreviewAudio": "inherits SaveAudio.save_flac, temp directory/type, random prefix; save_audio returns ui.audio file descriptors",
+ "SaveAudioMP3": "calls save_audio(format=mp3), output type; saved quality320k overrides function default128k; no actual codec run",
+ "descriptor_keys": [
+ "filename",
+ "subfolder",
+ "type"
+ ],
+ "history_chain": "save_audio ui.audio -> get_output_from_returns UI merge -> UI cache -> history_result.outputs -> PromptQueue.task_done.history",
+ "audioUI": "frontend DOM getter returns empty string without getValue; not a file descriptor",
+ "downloads": "existing ComfyUIClient.extract_outputs and /view chain, synthetic protocol fixture only; strings/URLs/paths rejected",
+ "production_output_registration": "unchanged; reference profile never registers or auto-trusts PreviewAudio/unknown names"
+ },
+ "reused_frontend_rules": [
+ {
+ "manifest": "../serialization-evidence/sources.json",
+ "file": "src/services/litegraphService.ts",
+ "lines": [
+ [
+ 305,
+ 406
+ ]
+ ],
+ "purpose": "required then optional input constructor order"
+ },
+ {
+ "manifest": "../serialization-evidence/sources.json",
+ "file": "src/lib/litegraph/src/LGraphNode.ts",
+ "lines": [
+ [
+ 867,
+ 878
+ ],
+ [
+ 914,
+ 921
+ ]
+ ],
+ "purpose": "restore skips widget.serialize=false; persist retains original widget indices"
+ },
+ {
+ "manifest": "../serialization-evidence/sources.json",
+ "file": "src/renderer/extensions/vueNodes/widgets/composables/useFloatWidget.ts",
+ "lines": [
+ [
+ 12,
+ 27
+ ],
+ [
+ 59,
+ 85
+ ]
+ ],
+ "purpose": "constructor UI defaults and callback; no save-time callback"
+ },
+ {
+ "manifest": "../serialization-evidence/sources.json",
+ "file": "src/utils/executionUtil.ts",
+ "lines": [
+ [
+ 85,
+ 104
+ ]
+ ],
+ "purpose": "graphToPrompt tests options.serialize, then serializeValue or value"
+ },
+ {
+ "manifest": "../structure-reference/sources.json",
+ "file": "src/extensions/core/uploadAudio.ts",
+ "lines": [
+ [
+ 76,
+ 110
+ ],
+ [
+ 116,
+ 138
+ ],
+ [
+ 161,
+ 259
+ ]
+ ],
+ "purpose": "register nodes audioUI and load upload; two different serialize markers"
+ },
+ {
+ "manifest": "../structure-reference/sources.json",
+ "file": "src/scripts/domWidget.ts",
+ "lines": [
+ [
+ 142,
+ 148
+ ]
+ ],
+ "purpose": "getter empty string when getValue absent"
+ }
+ ],
+ "fail_closed": [
+ "wrong provider or missing/conflicting node version",
+ "unsupported frontend version",
+ "missing/extra widgets or named overrides",
+ "wrong scalar type/bool-as-number/nonfinite/outside frontend range",
+ "unknown enum/dynamic prefix",
+ "duplicate/missing/extra/reordered sockets, changed widget binding",
+ "bad links, type/slot/reciprocal records, muted/bypass or unknown nodes",
+ "nonempty UE link/connectability overrides or custom serializer"
+ ],
+ "unknowns": [
+ "source frontend version; explicit selected reference not source claim",
+ "UE7.4.1/7.5.2 behavior and actual modifications",
+ "registry commit binding/license at1.4.0",
+ "mixed core versions installed together",
+ "target core/plugin/frontend versions",
+ "input file availability/decoding; node package/model weights existence",
+ "real history, encoding, quality/effect/performance",
+ "no supplied true API: comparison_unavailable"
+ ],
+ "execution_verified": false,
+ "production_state_changed": false
+}
diff --git a/docs/hel-892/separation-reference/core-0.3.68__LICENSE b/docs/hel-892/separation-reference/core-0.3.68__LICENSE
new file mode 100644
index 00000000..f288702d
--- /dev/null
+++ b/docs/hel-892/separation-reference/core-0.3.68__LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
diff --git a/docs/hel-892/separation-reference/core-0.3.68__comfy_extras__nodes_audio.py b/docs/hel-892/separation-reference/core-0.3.68__comfy_extras__nodes_audio.py
new file mode 100644
index 00000000..2ed7e0b2
--- /dev/null
+++ b/docs/hel-892/separation-reference/core-0.3.68__comfy_extras__nodes_audio.py
@@ -0,0 +1,614 @@
+from __future__ import annotations
+
+import av
+import torchaudio
+import torch
+import comfy.model_management
+import folder_paths
+import os
+import io
+import json
+import random
+import hashlib
+import node_helpers
+import logging
+from comfy.cli_args import args
+from comfy.comfy_types import FileLocator
+
+class EmptyLatentAudio:
+ def __init__(self):
+ self.device = comfy.model_management.intermediate_device()
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"seconds": ("FLOAT", {"default": 47.6, "min": 1.0, "max": 1000.0, "step": 0.1}),
+ "batch_size": ("INT", {"default": 1, "min": 1, "max": 4096, "tooltip": "The number of latent images in the batch."}),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "generate"
+
+ CATEGORY = "latent/audio"
+
+ def generate(self, seconds, batch_size):
+ length = round((seconds * 44100 / 2048) / 2) * 2
+ latent = torch.zeros([batch_size, 64, length], device=self.device)
+ return ({"samples":latent, "type": "audio"}, )
+
+class ConditioningStableAudio:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"positive": ("CONDITIONING", ),
+ "negative": ("CONDITIONING", ),
+ "seconds_start": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 1000.0, "step": 0.1}),
+ "seconds_total": ("FLOAT", {"default": 47.0, "min": 0.0, "max": 1000.0, "step": 0.1}),
+ }}
+
+ RETURN_TYPES = ("CONDITIONING","CONDITIONING")
+ RETURN_NAMES = ("positive", "negative")
+
+ FUNCTION = "append"
+
+ CATEGORY = "conditioning"
+
+ def append(self, positive, negative, seconds_start, seconds_total):
+ positive = node_helpers.conditioning_set_values(positive, {"seconds_start": seconds_start, "seconds_total": seconds_total})
+ negative = node_helpers.conditioning_set_values(negative, {"seconds_start": seconds_start, "seconds_total": seconds_total})
+ return (positive, negative)
+
+class VAEEncodeAudio:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "audio": ("AUDIO", ), "vae": ("VAE", )}}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "encode"
+
+ CATEGORY = "latent/audio"
+
+ def encode(self, vae, audio):
+ sample_rate = audio["sample_rate"]
+ if 44100 != sample_rate:
+ waveform = torchaudio.functional.resample(audio["waveform"], sample_rate, 44100)
+ else:
+ waveform = audio["waveform"]
+
+ t = vae.encode(waveform.movedim(1, -1))
+ return ({"samples":t}, )
+
+class VAEDecodeAudio:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT", ), "vae": ("VAE", )}}
+ RETURN_TYPES = ("AUDIO",)
+ FUNCTION = "decode"
+
+ CATEGORY = "latent/audio"
+
+ def decode(self, vae, samples):
+ audio = vae.decode(samples["samples"]).movedim(-1, 1)
+ std = torch.std(audio, dim=[1,2], keepdim=True) * 5.0
+ std[std < 1.0] = 1.0
+ audio /= std
+ return ({"waveform": audio, "sample_rate": 44100}, )
+
+
+def save_audio(self, audio, filename_prefix="ComfyUI", format="flac", prompt=None, extra_pnginfo=None, quality="128k"):
+
+ filename_prefix += self.prefix_append
+ full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(filename_prefix, self.output_dir)
+ results: list[FileLocator] = []
+
+ # Prepare metadata dictionary
+ metadata = {}
+ if not args.disable_metadata:
+ if prompt is not None:
+ metadata["prompt"] = json.dumps(prompt)
+ if extra_pnginfo is not None:
+ for x in extra_pnginfo:
+ metadata[x] = json.dumps(extra_pnginfo[x])
+
+ # Opus supported sample rates
+ OPUS_RATES = [8000, 12000, 16000, 24000, 48000]
+
+ for (batch_number, waveform) in enumerate(audio["waveform"].cpu()):
+ filename_with_batch_num = filename.replace("%batch_num%", str(batch_number))
+ file = f"{filename_with_batch_num}_{counter:05}_.{format}"
+ output_path = os.path.join(full_output_folder, file)
+
+ # Use original sample rate initially
+ sample_rate = audio["sample_rate"]
+
+ # Handle Opus sample rate requirements
+ if format == "opus":
+ if sample_rate > 48000:
+ sample_rate = 48000
+ elif sample_rate not in OPUS_RATES:
+ # Find the next highest supported rate
+ for rate in sorted(OPUS_RATES):
+ if rate > sample_rate:
+ sample_rate = rate
+ break
+ if sample_rate not in OPUS_RATES: # Fallback if still not supported
+ sample_rate = 48000
+
+ # Resample if necessary
+ if sample_rate != audio["sample_rate"]:
+ waveform = torchaudio.functional.resample(waveform, audio["sample_rate"], sample_rate)
+
+ # Create output with specified format
+ output_buffer = io.BytesIO()
+ output_container = av.open(output_buffer, mode='w', format=format)
+
+ # Set metadata on the container
+ for key, value in metadata.items():
+ output_container.metadata[key] = value
+
+ layout = 'mono' if waveform.shape[0] == 1 else 'stereo'
+ # Set up the output stream with appropriate properties
+ if format == "opus":
+ out_stream = output_container.add_stream("libopus", rate=sample_rate, layout=layout)
+ if quality == "64k":
+ out_stream.bit_rate = 64000
+ elif quality == "96k":
+ out_stream.bit_rate = 96000
+ elif quality == "128k":
+ out_stream.bit_rate = 128000
+ elif quality == "192k":
+ out_stream.bit_rate = 192000
+ elif quality == "320k":
+ out_stream.bit_rate = 320000
+ elif format == "mp3":
+ out_stream = output_container.add_stream("libmp3lame", rate=sample_rate, layout=layout)
+ if quality == "V0":
+ #TODO i would really love to support V3 and V5 but there doesn't seem to be a way to set the qscale level, the property below is a bool
+ out_stream.codec_context.qscale = 1
+ elif quality == "128k":
+ out_stream.bit_rate = 128000
+ elif quality == "320k":
+ out_stream.bit_rate = 320000
+ else: #format == "flac":
+ out_stream = output_container.add_stream("flac", rate=sample_rate, layout=layout)
+
+ frame = av.AudioFrame.from_ndarray(waveform.movedim(0, 1).reshape(1, -1).float().numpy(), format='flt', layout=layout)
+ frame.sample_rate = sample_rate
+ frame.pts = 0
+ output_container.mux(out_stream.encode(frame))
+
+ # Flush encoder
+ output_container.mux(out_stream.encode(None))
+
+ # Close containers
+ output_container.close()
+
+ # Write the output to file
+ output_buffer.seek(0)
+ with open(output_path, 'wb') as f:
+ f.write(output_buffer.getbuffer())
+
+ results.append({
+ "filename": file,
+ "subfolder": subfolder,
+ "type": self.type
+ })
+ counter += 1
+
+ return { "ui": { "audio": results } }
+
+class SaveAudio:
+ def __init__(self):
+ self.output_dir = folder_paths.get_output_directory()
+ self.type = "output"
+ self.prefix_append = ""
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "audio": ("AUDIO", ),
+ "filename_prefix": ("STRING", {"default": "audio/ComfyUI"}),
+ },
+ "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
+ }
+
+ RETURN_TYPES = ()
+ FUNCTION = "save_flac"
+
+ OUTPUT_NODE = True
+
+ CATEGORY = "audio"
+
+ def save_flac(self, audio, filename_prefix="ComfyUI", format="flac", prompt=None, extra_pnginfo=None):
+ return save_audio(self, audio, filename_prefix, format, prompt, extra_pnginfo)
+
+class SaveAudioMP3:
+ def __init__(self):
+ self.output_dir = folder_paths.get_output_directory()
+ self.type = "output"
+ self.prefix_append = ""
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "audio": ("AUDIO", ),
+ "filename_prefix": ("STRING", {"default": "audio/ComfyUI"}),
+ "quality": (["V0", "128k", "320k"], {"default": "V0"}),
+ },
+ "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
+ }
+
+ RETURN_TYPES = ()
+ FUNCTION = "save_mp3"
+
+ OUTPUT_NODE = True
+
+ CATEGORY = "audio"
+
+ def save_mp3(self, audio, filename_prefix="ComfyUI", format="mp3", prompt=None, extra_pnginfo=None, quality="128k"):
+ return save_audio(self, audio, filename_prefix, format, prompt, extra_pnginfo, quality)
+
+class SaveAudioOpus:
+ def __init__(self):
+ self.output_dir = folder_paths.get_output_directory()
+ self.type = "output"
+ self.prefix_append = ""
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "audio": ("AUDIO", ),
+ "filename_prefix": ("STRING", {"default": "audio/ComfyUI"}),
+ "quality": (["64k", "96k", "128k", "192k", "320k"], {"default": "128k"}),
+ },
+ "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
+ }
+
+ RETURN_TYPES = ()
+ FUNCTION = "save_opus"
+
+ OUTPUT_NODE = True
+
+ CATEGORY = "audio"
+
+ def save_opus(self, audio, filename_prefix="ComfyUI", format="opus", prompt=None, extra_pnginfo=None, quality="V3"):
+ return save_audio(self, audio, filename_prefix, format, prompt, extra_pnginfo, quality)
+
+class PreviewAudio(SaveAudio):
+ def __init__(self):
+ self.output_dir = folder_paths.get_temp_directory()
+ self.type = "temp"
+ self.prefix_append = "_temp_" + ''.join(random.choice("abcdefghijklmnopqrstupvxyz") for x in range(5))
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required":
+ {"audio": ("AUDIO", ), },
+ "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
+ }
+
+def f32_pcm(wav: torch.Tensor) -> torch.Tensor:
+ """Convert audio to float 32 bits PCM format."""
+ if wav.dtype.is_floating_point:
+ return wav
+ elif wav.dtype == torch.int16:
+ return wav.float() / (2 ** 15)
+ elif wav.dtype == torch.int32:
+ return wav.float() / (2 ** 31)
+ raise ValueError(f"Unsupported wav dtype: {wav.dtype}")
+
+def load(filepath: str) -> tuple[torch.Tensor, int]:
+ with av.open(filepath) as af:
+ if not af.streams.audio:
+ raise ValueError("No audio stream found in the file.")
+
+ stream = af.streams.audio[0]
+ sr = stream.codec_context.sample_rate
+ n_channels = stream.channels
+
+ frames = []
+ length = 0
+ for frame in af.decode(streams=stream.index):
+ buf = torch.from_numpy(frame.to_ndarray())
+ if buf.shape[0] != n_channels:
+ buf = buf.view(-1, n_channels).t()
+
+ frames.append(buf)
+ length += buf.shape[1]
+
+ if not frames:
+ raise ValueError("No audio frames decoded.")
+
+ wav = torch.cat(frames, dim=1)
+ wav = f32_pcm(wav)
+ return wav, sr
+
+class LoadAudio:
+ @classmethod
+ def INPUT_TYPES(s):
+ input_dir = folder_paths.get_input_directory()
+ files = folder_paths.filter_files_content_types(os.listdir(input_dir), ["audio", "video"])
+ return {"required": {"audio": (sorted(files), {"audio_upload": True})}}
+
+ CATEGORY = "audio"
+
+ RETURN_TYPES = ("AUDIO", )
+ FUNCTION = "load"
+
+ def load(self, audio):
+ audio_path = folder_paths.get_annotated_filepath(audio)
+ waveform, sample_rate = load(audio_path)
+ audio = {"waveform": waveform.unsqueeze(0), "sample_rate": sample_rate}
+ return (audio, )
+
+ @classmethod
+ def IS_CHANGED(s, audio):
+ image_path = folder_paths.get_annotated_filepath(audio)
+ m = hashlib.sha256()
+ with open(image_path, 'rb') as f:
+ m.update(f.read())
+ return m.digest().hex()
+
+ @classmethod
+ def VALIDATE_INPUTS(s, audio):
+ if not folder_paths.exists_annotated_filepath(audio):
+ return "Invalid audio file: {}".format(audio)
+ return True
+
+class RecordAudio:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"audio": ("AUDIO_RECORD", {})}}
+
+ CATEGORY = "audio"
+
+ RETURN_TYPES = ("AUDIO", )
+ FUNCTION = "load"
+
+ def load(self, audio):
+ audio_path = folder_paths.get_annotated_filepath(audio)
+
+ waveform, sample_rate = load(audio_path)
+ audio = {"waveform": waveform.unsqueeze(0), "sample_rate": sample_rate}
+ return (audio, )
+
+
+class TrimAudioDuration:
+ @classmethod
+ def INPUT_TYPES(cls):
+ return {
+ "required": {
+ "audio": ("AUDIO",),
+ "start_index": ("FLOAT", {"default": 0.0, "min": -0xffffffffffffffff, "max": 0xffffffffffffffff, "step": 0.01, "tooltip": "Start time in seconds, can be negative to count from the end (supports sub-seconds)."}),
+ "duration": ("FLOAT", {"default": 60.0, "min": 0.0, "step": 0.01, "tooltip": "Duration in seconds"}),
+ },
+ }
+
+ FUNCTION = "trim"
+ RETURN_TYPES = ("AUDIO",)
+ CATEGORY = "audio"
+ DESCRIPTION = "Trim audio tensor into chosen time range."
+
+ def trim(self, audio, start_index, duration):
+ waveform = audio["waveform"]
+ sample_rate = audio["sample_rate"]
+ audio_length = waveform.shape[-1]
+
+ if start_index < 0:
+ start_frame = audio_length + int(round(start_index * sample_rate))
+ else:
+ start_frame = int(round(start_index * sample_rate))
+ start_frame = max(0, min(start_frame, audio_length - 1))
+
+ end_frame = start_frame + int(round(duration * sample_rate))
+ end_frame = max(0, min(end_frame, audio_length))
+
+ if start_frame >= end_frame:
+ raise ValueError("AudioTrim: Start time must be less than end time and be within the audio length.")
+
+ return ({"waveform": waveform[..., start_frame:end_frame], "sample_rate": sample_rate},)
+
+
+class SplitAudioChannels:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {
+ "audio": ("AUDIO",),
+ }}
+
+ RETURN_TYPES = ("AUDIO", "AUDIO")
+ RETURN_NAMES = ("left", "right")
+ FUNCTION = "separate"
+ CATEGORY = "audio"
+ DESCRIPTION = "Separates the audio into left and right channels."
+
+ def separate(self, audio):
+ waveform = audio["waveform"]
+ sample_rate = audio["sample_rate"]
+
+ if waveform.shape[1] != 2:
+ raise ValueError("AudioSplit: Input audio has only one channel.")
+
+ left_channel = waveform[..., 0:1, :]
+ right_channel = waveform[..., 1:2, :]
+
+ return ({"waveform": left_channel, "sample_rate": sample_rate}, {"waveform": right_channel, "sample_rate": sample_rate})
+
+
+def match_audio_sample_rates(waveform_1, sample_rate_1, waveform_2, sample_rate_2):
+ if sample_rate_1 != sample_rate_2:
+ if sample_rate_1 > sample_rate_2:
+ waveform_2 = torchaudio.functional.resample(waveform_2, sample_rate_2, sample_rate_1)
+ output_sample_rate = sample_rate_1
+ logging.info(f"Resampling audio2 from {sample_rate_2}Hz to {sample_rate_1}Hz for merging.")
+ else:
+ waveform_1 = torchaudio.functional.resample(waveform_1, sample_rate_1, sample_rate_2)
+ output_sample_rate = sample_rate_2
+ logging.info(f"Resampling audio1 from {sample_rate_1}Hz to {sample_rate_2}Hz for merging.")
+ else:
+ output_sample_rate = sample_rate_1
+ return waveform_1, waveform_2, output_sample_rate
+
+
+class AudioConcat:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {
+ "audio1": ("AUDIO",),
+ "audio2": ("AUDIO",),
+ "direction": (['after', 'before'], {"default": 'after', "tooltip": "Whether to append audio2 after or before audio1."}),
+ }}
+
+ RETURN_TYPES = ("AUDIO",)
+ FUNCTION = "concat"
+ CATEGORY = "audio"
+ DESCRIPTION = "Concatenates the audio1 to audio2 in the specified direction."
+
+ def concat(self, audio1, audio2, direction):
+ waveform_1 = audio1["waveform"]
+ waveform_2 = audio2["waveform"]
+ sample_rate_1 = audio1["sample_rate"]
+ sample_rate_2 = audio2["sample_rate"]
+
+ if waveform_1.shape[1] == 1:
+ waveform_1 = waveform_1.repeat(1, 2, 1)
+ logging.info("AudioConcat: Converted mono audio1 to stereo by duplicating the channel.")
+ if waveform_2.shape[1] == 1:
+ waveform_2 = waveform_2.repeat(1, 2, 1)
+ logging.info("AudioConcat: Converted mono audio2 to stereo by duplicating the channel.")
+
+ waveform_1, waveform_2, output_sample_rate = match_audio_sample_rates(waveform_1, sample_rate_1, waveform_2, sample_rate_2)
+
+ if direction == 'after':
+ concatenated_audio = torch.cat((waveform_1, waveform_2), dim=2)
+ elif direction == 'before':
+ concatenated_audio = torch.cat((waveform_2, waveform_1), dim=2)
+
+ return ({"waveform": concatenated_audio, "sample_rate": output_sample_rate},)
+
+
+class AudioMerge:
+ @classmethod
+ def INPUT_TYPES(cls):
+ return {
+ "required": {
+ "audio1": ("AUDIO",),
+ "audio2": ("AUDIO",),
+ "merge_method": (["add", "mean", "subtract", "multiply"], {"tooltip": "The method used to combine the audio waveforms."}),
+ },
+ }
+
+ FUNCTION = "merge"
+ RETURN_TYPES = ("AUDIO",)
+ CATEGORY = "audio"
+ DESCRIPTION = "Combine two audio tracks by overlaying their waveforms."
+
+ def merge(self, audio1, audio2, merge_method):
+ waveform_1 = audio1["waveform"]
+ waveform_2 = audio2["waveform"]
+ sample_rate_1 = audio1["sample_rate"]
+ sample_rate_2 = audio2["sample_rate"]
+
+ waveform_1, waveform_2, output_sample_rate = match_audio_sample_rates(waveform_1, sample_rate_1, waveform_2, sample_rate_2)
+
+ length_1 = waveform_1.shape[-1]
+ length_2 = waveform_2.shape[-1]
+
+ if length_2 > length_1:
+ logging.info(f"AudioMerge: Trimming audio2 from {length_2} to {length_1} samples to match audio1 length.")
+ waveform_2 = waveform_2[..., :length_1]
+ elif length_2 < length_1:
+ logging.info(f"AudioMerge: Padding audio2 from {length_2} to {length_1} samples to match audio1 length.")
+ pad_shape = list(waveform_2.shape)
+ pad_shape[-1] = length_1 - length_2
+ pad_tensor = torch.zeros(pad_shape, dtype=waveform_2.dtype, device=waveform_2.device)
+ waveform_2 = torch.cat((waveform_2, pad_tensor), dim=-1)
+
+ if merge_method == "add":
+ waveform = waveform_1 + waveform_2
+ elif merge_method == "subtract":
+ waveform = waveform_1 - waveform_2
+ elif merge_method == "multiply":
+ waveform = waveform_1 * waveform_2
+ elif merge_method == "mean":
+ waveform = (waveform_1 + waveform_2) / 2
+
+ max_val = waveform.abs().max()
+ if max_val > 1.0:
+ waveform = waveform / max_val
+
+ return ({"waveform": waveform, "sample_rate": output_sample_rate},)
+
+
+class AudioAdjustVolume:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {
+ "audio": ("AUDIO",),
+ "volume": ("INT", {"default": 1.0, "min": -100, "max": 100, "tooltip": "Volume adjustment in decibels (dB). 0 = no change, +6 = double, -6 = half, etc"}),
+ }}
+
+ RETURN_TYPES = ("AUDIO",)
+ FUNCTION = "adjust_volume"
+ CATEGORY = "audio"
+
+ def adjust_volume(self, audio, volume):
+ if volume == 0:
+ return (audio,)
+ waveform = audio["waveform"]
+ sample_rate = audio["sample_rate"]
+
+ gain = 10 ** (volume / 20)
+ waveform = waveform * gain
+
+ return ({"waveform": waveform, "sample_rate": sample_rate},)
+
+
+class EmptyAudio:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {
+ "duration": ("FLOAT", {"default": 60.0, "min": 0.0, "max": 0xffffffffffffffff, "step": 0.01, "tooltip": "Duration of the empty audio clip in seconds"}),
+ "sample_rate": ("INT", {"default": 44100, "tooltip": "Sample rate of the empty audio clip."}),
+ "channels": ("INT", {"default": 2, "min": 1, "max": 2, "tooltip": "Number of audio channels (1 for mono, 2 for stereo)."}),
+ }}
+
+ RETURN_TYPES = ("AUDIO",)
+ FUNCTION = "create_empty_audio"
+ CATEGORY = "audio"
+
+ def create_empty_audio(self, duration, sample_rate, channels):
+ num_samples = int(round(duration * sample_rate))
+ waveform = torch.zeros((1, channels, num_samples), dtype=torch.float32)
+ return ({"waveform": waveform, "sample_rate": sample_rate},)
+
+
+NODE_CLASS_MAPPINGS = {
+ "EmptyLatentAudio": EmptyLatentAudio,
+ "VAEEncodeAudio": VAEEncodeAudio,
+ "VAEDecodeAudio": VAEDecodeAudio,
+ "SaveAudio": SaveAudio,
+ "SaveAudioMP3": SaveAudioMP3,
+ "SaveAudioOpus": SaveAudioOpus,
+ "LoadAudio": LoadAudio,
+ "PreviewAudio": PreviewAudio,
+ "ConditioningStableAudio": ConditioningStableAudio,
+ "RecordAudio": RecordAudio,
+ "TrimAudioDuration": TrimAudioDuration,
+ "SplitAudioChannels": SplitAudioChannels,
+ "AudioConcat": AudioConcat,
+ "AudioMerge": AudioMerge,
+ "AudioAdjustVolume": AudioAdjustVolume,
+ "EmptyAudio": EmptyAudio,
+}
+
+NODE_DISPLAY_NAME_MAPPINGS = {
+ "EmptyLatentAudio": "Empty Latent Audio",
+ "VAEEncodeAudio": "VAE Encode Audio",
+ "VAEDecodeAudio": "VAE Decode Audio",
+ "PreviewAudio": "Preview Audio",
+ "LoadAudio": "Load Audio",
+ "SaveAudio": "Save Audio (FLAC)",
+ "SaveAudioMP3": "Save Audio (MP3)",
+ "SaveAudioOpus": "Save Audio (Opus)",
+ "RecordAudio": "Record Audio",
+ "TrimAudioDuration": "Trim Audio Duration",
+ "SplitAudioChannels": "Split Audio Channels",
+ "AudioConcat": "Audio Concat",
+ "AudioMerge": "Audio Merge",
+ "AudioAdjustVolume": "Audio Adjust Volume",
+ "EmptyAudio": "Empty Audio",
+}
diff --git a/docs/hel-892/separation-reference/core-0.3.68__execution.py b/docs/hel-892/separation-reference/core-0.3.68__execution.py
new file mode 100644
index 00000000..17c77bea
--- /dev/null
+++ b/docs/hel-892/separation-reference/core-0.3.68__execution.py
@@ -0,0 +1,1232 @@
+import copy
+import heapq
+import inspect
+import logging
+import sys
+import threading
+import time
+import traceback
+from enum import Enum
+from typing import List, Literal, NamedTuple, Optional, Union
+import asyncio
+
+import torch
+
+import comfy.model_management
+import nodes
+from comfy_execution.caching import (
+ BasicCache,
+ CacheKeySetID,
+ CacheKeySetInputSignature,
+ NullCache,
+ HierarchicalCache,
+ LRUCache,
+ RAMPressureCache,
+)
+from comfy_execution.graph import (
+ DynamicPrompt,
+ ExecutionBlocker,
+ ExecutionList,
+ get_input_info,
+)
+from comfy_execution.graph_utils import GraphBuilder, is_link
+from comfy_execution.validation import validate_node_input
+from comfy_execution.progress import get_progress_state, reset_progress_state, add_progress_handler, WebUIProgressHandler
+from comfy_execution.utils import CurrentNodeContext
+from comfy_api.internal import _ComfyNodeInternal, _NodeOutputInternal, first_real_override, is_class, make_locked_method_func
+from comfy_api.latest import io
+
+
+class ExecutionResult(Enum):
+ SUCCESS = 0
+ FAILURE = 1
+ PENDING = 2
+
+class DuplicateNodeError(Exception):
+ pass
+
+class IsChangedCache:
+ def __init__(self, prompt_id: str, dynprompt: DynamicPrompt, outputs_cache: BasicCache):
+ self.prompt_id = prompt_id
+ self.dynprompt = dynprompt
+ self.outputs_cache = outputs_cache
+ self.is_changed = {}
+
+ async def get(self, node_id):
+ if node_id in self.is_changed:
+ return self.is_changed[node_id]
+
+ node = self.dynprompt.get_node(node_id)
+ class_type = node["class_type"]
+ class_def = nodes.NODE_CLASS_MAPPINGS[class_type]
+ has_is_changed = False
+ is_changed_name = None
+ if issubclass(class_def, _ComfyNodeInternal) and first_real_override(class_def, "fingerprint_inputs") is not None:
+ has_is_changed = True
+ is_changed_name = "fingerprint_inputs"
+ elif hasattr(class_def, "IS_CHANGED"):
+ has_is_changed = True
+ is_changed_name = "IS_CHANGED"
+ if not has_is_changed:
+ self.is_changed[node_id] = False
+ return self.is_changed[node_id]
+
+ if "is_changed" in node:
+ self.is_changed[node_id] = node["is_changed"]
+ return self.is_changed[node_id]
+
+ # Intentionally do not use cached outputs here. We only want constants in IS_CHANGED
+ input_data_all, _, hidden_inputs = get_input_data(node["inputs"], class_def, node_id, None)
+ try:
+ is_changed = await _async_map_node_over_list(self.prompt_id, node_id, class_def, input_data_all, is_changed_name)
+ is_changed = await resolve_map_node_over_list_results(is_changed)
+ node["is_changed"] = [None if isinstance(x, ExecutionBlocker) else x for x in is_changed]
+ except Exception as e:
+ logging.warning("WARNING: {}".format(e))
+ node["is_changed"] = float("NaN")
+ finally:
+ self.is_changed[node_id] = node["is_changed"]
+ return self.is_changed[node_id]
+
+
+class CacheEntry(NamedTuple):
+ ui: dict
+ outputs: list
+
+
+class CacheType(Enum):
+ CLASSIC = 0
+ LRU = 1
+ NONE = 2
+ RAM_PRESSURE = 3
+
+
+class CacheSet:
+ def __init__(self, cache_type=None, cache_args={}):
+ if cache_type == CacheType.NONE:
+ self.init_null_cache()
+ logging.info("Disabling intermediate node cache.")
+ elif cache_type == CacheType.RAM_PRESSURE:
+ cache_ram = cache_args.get("ram", 16.0)
+ self.init_ram_cache(cache_ram)
+ logging.info("Using RAM pressure cache.")
+ elif cache_type == CacheType.LRU:
+ cache_size = cache_args.get("lru", 0)
+ self.init_lru_cache(cache_size)
+ logging.info("Using LRU cache")
+ else:
+ self.init_classic_cache()
+
+ self.all = [self.outputs, self.objects]
+
+ # Performs like the old cache -- dump data ASAP
+ def init_classic_cache(self):
+ self.outputs = HierarchicalCache(CacheKeySetInputSignature)
+ self.objects = HierarchicalCache(CacheKeySetID)
+
+ def init_lru_cache(self, cache_size):
+ self.outputs = LRUCache(CacheKeySetInputSignature, max_size=cache_size)
+ self.objects = HierarchicalCache(CacheKeySetID)
+
+ def init_ram_cache(self, min_headroom):
+ self.outputs = RAMPressureCache(CacheKeySetInputSignature)
+ self.objects = HierarchicalCache(CacheKeySetID)
+
+ def init_null_cache(self):
+ self.outputs = NullCache()
+ self.objects = NullCache()
+
+ def recursive_debug_dump(self):
+ result = {
+ "outputs": self.outputs.recursive_debug_dump(),
+ }
+ return result
+
+SENSITIVE_EXTRA_DATA_KEYS = ("auth_token_comfy_org", "api_key_comfy_org")
+
+def get_input_data(inputs, class_def, unique_id, execution_list=None, dynprompt=None, extra_data={}):
+ is_v3 = issubclass(class_def, _ComfyNodeInternal)
+ if is_v3:
+ valid_inputs, schema = class_def.INPUT_TYPES(include_hidden=False, return_schema=True)
+ else:
+ valid_inputs = class_def.INPUT_TYPES()
+ input_data_all = {}
+ missing_keys = {}
+ hidden_inputs_v3 = {}
+ for x in inputs:
+ input_data = inputs[x]
+ _, input_category, input_info = get_input_info(class_def, x, valid_inputs)
+ def mark_missing():
+ missing_keys[x] = True
+ input_data_all[x] = (None,)
+ if is_link(input_data) and (not input_info or not input_info.get("rawLink", False)):
+ input_unique_id = input_data[0]
+ output_index = input_data[1]
+ if execution_list is None:
+ mark_missing()
+ continue # This might be a lazily-evaluated input
+ cached = execution_list.get_cache(input_unique_id, unique_id)
+ if cached is None or cached.outputs is None:
+ mark_missing()
+ continue
+ if output_index >= len(cached.outputs):
+ mark_missing()
+ continue
+ obj = cached.outputs[output_index]
+ input_data_all[x] = obj
+ elif input_category is not None:
+ input_data_all[x] = [input_data]
+
+ if is_v3:
+ if schema.hidden:
+ if io.Hidden.prompt in schema.hidden:
+ hidden_inputs_v3[io.Hidden.prompt] = dynprompt.get_original_prompt() if dynprompt is not None else {}
+ if io.Hidden.dynprompt in schema.hidden:
+ hidden_inputs_v3[io.Hidden.dynprompt] = dynprompt
+ if io.Hidden.extra_pnginfo in schema.hidden:
+ hidden_inputs_v3[io.Hidden.extra_pnginfo] = extra_data.get('extra_pnginfo', None)
+ if io.Hidden.unique_id in schema.hidden:
+ hidden_inputs_v3[io.Hidden.unique_id] = unique_id
+ if io.Hidden.auth_token_comfy_org in schema.hidden:
+ hidden_inputs_v3[io.Hidden.auth_token_comfy_org] = extra_data.get("auth_token_comfy_org", None)
+ if io.Hidden.api_key_comfy_org in schema.hidden:
+ hidden_inputs_v3[io.Hidden.api_key_comfy_org] = extra_data.get("api_key_comfy_org", None)
+ else:
+ if "hidden" in valid_inputs:
+ h = valid_inputs["hidden"]
+ for x in h:
+ if h[x] == "PROMPT":
+ input_data_all[x] = [dynprompt.get_original_prompt() if dynprompt is not None else {}]
+ if h[x] == "DYNPROMPT":
+ input_data_all[x] = [dynprompt]
+ if h[x] == "EXTRA_PNGINFO":
+ input_data_all[x] = [extra_data.get('extra_pnginfo', None)]
+ if h[x] == "UNIQUE_ID":
+ input_data_all[x] = [unique_id]
+ if h[x] == "AUTH_TOKEN_COMFY_ORG":
+ input_data_all[x] = [extra_data.get("auth_token_comfy_org", None)]
+ if h[x] == "API_KEY_COMFY_ORG":
+ input_data_all[x] = [extra_data.get("api_key_comfy_org", None)]
+ return input_data_all, missing_keys, hidden_inputs_v3
+
+map_node_over_list = None #Don't hook this please
+
+async def resolve_map_node_over_list_results(results):
+ remaining = [x for x in results if isinstance(x, asyncio.Task) and not x.done()]
+ if len(remaining) == 0:
+ return [x.result() if isinstance(x, asyncio.Task) else x for x in results]
+ else:
+ done, pending = await asyncio.wait(remaining)
+ for task in done:
+ exc = task.exception()
+ if exc is not None:
+ raise exc
+ return [x.result() if isinstance(x, asyncio.Task) else x for x in results]
+
+async def _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, func, allow_interrupt=False, execution_block_cb=None, pre_execute_cb=None, hidden_inputs=None):
+ # check if node wants the lists
+ input_is_list = getattr(obj, "INPUT_IS_LIST", False)
+
+ if len(input_data_all) == 0:
+ max_len_input = 0
+ else:
+ max_len_input = max(len(x) for x in input_data_all.values())
+
+ # get a slice of inputs, repeat last input when list isn't long enough
+ def slice_dict(d, i):
+ return {k: v[i if len(v) > i else -1] for k, v in d.items()}
+
+ results = []
+ async def process_inputs(inputs, index=None, input_is_list=False):
+ if allow_interrupt:
+ nodes.before_node_execution()
+ execution_block = None
+ for k, v in inputs.items():
+ if input_is_list:
+ for e in v:
+ if isinstance(e, ExecutionBlocker):
+ v = e
+ break
+ if isinstance(v, ExecutionBlocker):
+ execution_block = execution_block_cb(v) if execution_block_cb else v
+ break
+ if execution_block is None:
+ if pre_execute_cb is not None and index is not None:
+ pre_execute_cb(index)
+ # V3
+ if isinstance(obj, _ComfyNodeInternal) or (is_class(obj) and issubclass(obj, _ComfyNodeInternal)):
+ # if is just a class, then assign no resources or state, just create clone
+ if is_class(obj):
+ type_obj = obj
+ obj.VALIDATE_CLASS()
+ class_clone = obj.PREPARE_CLASS_CLONE(hidden_inputs)
+ # otherwise, use class instance to populate/reuse some fields
+ else:
+ type_obj = type(obj)
+ type_obj.VALIDATE_CLASS()
+ class_clone = type_obj.PREPARE_CLASS_CLONE(hidden_inputs)
+ f = make_locked_method_func(type_obj, func, class_clone)
+ # V1
+ else:
+ f = getattr(obj, func)
+ if inspect.iscoroutinefunction(f):
+ async def async_wrapper(f, prompt_id, unique_id, list_index, args):
+ with CurrentNodeContext(prompt_id, unique_id, list_index):
+ return await f(**args)
+ task = asyncio.create_task(async_wrapper(f, prompt_id, unique_id, index, args=inputs))
+ # Give the task a chance to execute without yielding
+ await asyncio.sleep(0)
+ if task.done():
+ result = task.result()
+ results.append(result)
+ else:
+ results.append(task)
+ else:
+ with CurrentNodeContext(prompt_id, unique_id, index):
+ result = f(**inputs)
+ results.append(result)
+ else:
+ results.append(execution_block)
+
+ if input_is_list:
+ await process_inputs(input_data_all, 0, input_is_list=input_is_list)
+ elif max_len_input == 0:
+ await process_inputs({})
+ else:
+ for i in range(max_len_input):
+ input_dict = slice_dict(input_data_all, i)
+ await process_inputs(input_dict, i)
+ return results
+
+
+def merge_result_data(results, obj):
+ # check which outputs need concatenating
+ output = []
+ output_is_list = [False] * len(results[0])
+ if hasattr(obj, "OUTPUT_IS_LIST"):
+ output_is_list = obj.OUTPUT_IS_LIST
+
+ # merge node execution results
+ for i, is_list in zip(range(len(results[0])), output_is_list):
+ if is_list:
+ value = []
+ for o in results:
+ if isinstance(o[i], ExecutionBlocker):
+ value.append(o[i])
+ else:
+ value.extend(o[i])
+ output.append(value)
+ else:
+ output.append([o[i] for o in results])
+ return output
+
+async def get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=None, pre_execute_cb=None, hidden_inputs=None):
+ return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
+ has_pending_task = any(isinstance(r, asyncio.Task) and not r.done() for r in return_values)
+ if has_pending_task:
+ return return_values, {}, False, has_pending_task
+ output, ui, has_subgraph = get_output_from_returns(return_values, obj)
+ return output, ui, has_subgraph, False
+
+def get_output_from_returns(return_values, obj):
+ results = []
+ uis = []
+ subgraph_results = []
+ has_subgraph = False
+ for i in range(len(return_values)):
+ r = return_values[i]
+ if isinstance(r, dict):
+ if 'ui' in r:
+ uis.append(r['ui'])
+ if 'expand' in r:
+ # Perform an expansion, but do not append results
+ has_subgraph = True
+ new_graph = r['expand']
+ result = r.get("result", None)
+ if isinstance(result, ExecutionBlocker):
+ result = tuple([result] * len(obj.RETURN_TYPES))
+ subgraph_results.append((new_graph, result))
+ elif 'result' in r:
+ result = r.get("result", None)
+ if isinstance(result, ExecutionBlocker):
+ result = tuple([result] * len(obj.RETURN_TYPES))
+ results.append(result)
+ subgraph_results.append((None, result))
+ elif isinstance(r, _NodeOutputInternal):
+ # V3
+ if r.ui is not None:
+ if isinstance(r.ui, dict):
+ uis.append(r.ui)
+ else:
+ uis.append(r.ui.as_dict())
+ if r.expand is not None:
+ has_subgraph = True
+ new_graph = r.expand
+ result = r.result
+ if r.block_execution is not None:
+ result = tuple([ExecutionBlocker(r.block_execution)] * len(obj.RETURN_TYPES))
+ subgraph_results.append((new_graph, result))
+ elif r.result is not None:
+ result = r.result
+ if r.block_execution is not None:
+ result = tuple([ExecutionBlocker(r.block_execution)] * len(obj.RETURN_TYPES))
+ results.append(result)
+ subgraph_results.append((None, result))
+ else:
+ if isinstance(r, ExecutionBlocker):
+ r = tuple([r] * len(obj.RETURN_TYPES))
+ results.append(r)
+ subgraph_results.append((None, r))
+
+ if has_subgraph:
+ output = subgraph_results
+ elif len(results) > 0:
+ output = merge_result_data(results, obj)
+ else:
+ output = []
+ ui = dict()
+ # TODO: Think there's an existing bug here
+ # If we're performing a subgraph expansion, we probably shouldn't be returning UI values yet.
+ # They'll get cached without the completed subgraphs. It's an edge case and I'm not aware of
+ # any nodes that use both subgraph expansion and custom UI outputs, but might be a problem in the future.
+ if len(uis) > 0:
+ ui = {k: [y for x in uis for y in x[k]] for k in uis[0].keys()}
+ return output, ui, has_subgraph
+
+def format_value(x):
+ if x is None:
+ return None
+ elif isinstance(x, (int, float, bool, str)):
+ return x
+ else:
+ return str(x)
+
+async def execute(server, dynprompt, caches, current_item, extra_data, executed, prompt_id, execution_list, pending_subgraph_results, pending_async_nodes, ui_outputs):
+ unique_id = current_item
+ real_node_id = dynprompt.get_real_node_id(unique_id)
+ display_node_id = dynprompt.get_display_node_id(unique_id)
+ parent_node_id = dynprompt.get_parent_node_id(unique_id)
+ inputs = dynprompt.get_node(unique_id)['inputs']
+ class_type = dynprompt.get_node(unique_id)['class_type']
+ class_def = nodes.NODE_CLASS_MAPPINGS[class_type]
+ cached = caches.outputs.get(unique_id)
+ if cached is not None:
+ if server.client_id is not None:
+ cached_ui = cached.ui or {}
+ server.send_sync("executed", { "node": unique_id, "display_node": display_node_id, "output": cached_ui.get("output",None), "prompt_id": prompt_id }, server.client_id)
+ if cached.ui is not None:
+ ui_outputs[unique_id] = cached.ui
+ get_progress_state().finish_progress(unique_id)
+ execution_list.cache_update(unique_id, cached)
+ return (ExecutionResult.SUCCESS, None, None)
+
+ input_data_all = None
+ try:
+ if unique_id in pending_async_nodes:
+ results = []
+ for r in pending_async_nodes[unique_id]:
+ if isinstance(r, asyncio.Task):
+ try:
+ results.append(r.result())
+ except Exception as ex:
+ # An async task failed - propagate the exception up
+ del pending_async_nodes[unique_id]
+ raise ex
+ else:
+ results.append(r)
+ del pending_async_nodes[unique_id]
+ output_data, output_ui, has_subgraph = get_output_from_returns(results, class_def)
+ elif unique_id in pending_subgraph_results:
+ cached_results = pending_subgraph_results[unique_id]
+ resolved_outputs = []
+ for is_subgraph, result in cached_results:
+ if not is_subgraph:
+ resolved_outputs.append(result)
+ else:
+ resolved_output = []
+ for r in result:
+ if is_link(r):
+ source_node, source_output = r[0], r[1]
+ node_cached = execution_list.get_cache(source_node, unique_id)
+ for o in node_cached.outputs[source_output]:
+ resolved_output.append(o)
+
+ else:
+ resolved_output.append(r)
+ resolved_outputs.append(tuple(resolved_output))
+ output_data = merge_result_data(resolved_outputs, class_def)
+ output_ui = []
+ del pending_subgraph_results[unique_id]
+ has_subgraph = False
+ else:
+ get_progress_state().start_progress(unique_id)
+ input_data_all, missing_keys, hidden_inputs = get_input_data(inputs, class_def, unique_id, execution_list, dynprompt, extra_data)
+ if server.client_id is not None:
+ server.last_node_id = display_node_id
+ server.send_sync("executing", { "node": unique_id, "display_node": display_node_id, "prompt_id": prompt_id }, server.client_id)
+
+ obj = caches.objects.get(unique_id)
+ if obj is None:
+ obj = class_def()
+ caches.objects.set(unique_id, obj)
+
+ if issubclass(class_def, _ComfyNodeInternal):
+ lazy_status_present = first_real_override(class_def, "check_lazy_status") is not None
+ else:
+ lazy_status_present = getattr(obj, "check_lazy_status", None) is not None
+ if lazy_status_present:
+ required_inputs = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, "check_lazy_status", allow_interrupt=True, hidden_inputs=hidden_inputs)
+ required_inputs = await resolve_map_node_over_list_results(required_inputs)
+ required_inputs = set(sum([r for r in required_inputs if isinstance(r,list)], []))
+ required_inputs = [x for x in required_inputs if isinstance(x,str) and (
+ x not in input_data_all or x in missing_keys
+ )]
+ if len(required_inputs) > 0:
+ for i in required_inputs:
+ execution_list.make_input_strong_link(unique_id, i)
+ return (ExecutionResult.PENDING, None, None)
+
+ def execution_block_cb(block):
+ if block.message is not None:
+ mes = {
+ "prompt_id": prompt_id,
+ "node_id": unique_id,
+ "node_type": class_type,
+ "executed": list(executed),
+
+ "exception_message": f"Execution Blocked: {block.message}",
+ "exception_type": "ExecutionBlocked",
+ "traceback": [],
+ "current_inputs": [],
+ "current_outputs": [],
+ }
+ server.send_sync("execution_error", mes, server.client_id)
+ return ExecutionBlocker(None)
+ else:
+ return block
+ def pre_execute_cb(call_index):
+ # TODO - How to handle this with async functions without contextvars (which requires Python 3.12)?
+ GraphBuilder.set_default_prefix(unique_id, call_index, 0)
+ output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
+ if has_pending_tasks:
+ pending_async_nodes[unique_id] = output_data
+ unblock = execution_list.add_external_block(unique_id)
+ async def await_completion():
+ tasks = [x for x in output_data if isinstance(x, asyncio.Task)]
+ await asyncio.gather(*tasks, return_exceptions=True)
+ unblock()
+ asyncio.create_task(await_completion())
+ return (ExecutionResult.PENDING, None, None)
+ if len(output_ui) > 0:
+ ui_outputs[unique_id] = {
+ "meta": {
+ "node_id": unique_id,
+ "display_node": display_node_id,
+ "parent_node": parent_node_id,
+ "real_node_id": real_node_id,
+ },
+ "output": output_ui
+ }
+ if server.client_id is not None:
+ server.send_sync("executed", { "node": unique_id, "display_node": display_node_id, "output": output_ui, "prompt_id": prompt_id }, server.client_id)
+ if has_subgraph:
+ cached_outputs = []
+ new_node_ids = []
+ new_output_ids = []
+ new_output_links = []
+ for i in range(len(output_data)):
+ new_graph, node_outputs = output_data[i]
+ if new_graph is None:
+ cached_outputs.append((False, node_outputs))
+ else:
+ for node_id, node_info in new_graph.items():
+ new_node_ids.append(node_id)
+ display_id = node_info.get("override_display_id", unique_id)
+ dynprompt.add_ephemeral_node(node_id, node_info, unique_id, display_id)
+ # Figure out if the newly created node is an output node
+ class_type = node_info["class_type"]
+ class_def = nodes.NODE_CLASS_MAPPINGS[class_type]
+ if hasattr(class_def, 'OUTPUT_NODE') and class_def.OUTPUT_NODE == True:
+ new_output_ids.append(node_id)
+ for i in range(len(node_outputs)):
+ if is_link(node_outputs[i]):
+ from_node_id, from_socket = node_outputs[i][0], node_outputs[i][1]
+ new_output_links.append((from_node_id, from_socket))
+ cached_outputs.append((True, node_outputs))
+ new_node_ids = set(new_node_ids)
+ for cache in caches.all:
+ subcache = await cache.ensure_subcache_for(unique_id, new_node_ids)
+ subcache.clean_unused()
+ for node_id in new_output_ids:
+ execution_list.add_node(node_id)
+ execution_list.cache_link(node_id, unique_id)
+ for link in new_output_links:
+ execution_list.add_strong_link(link[0], link[1], unique_id)
+ pending_subgraph_results[unique_id] = cached_outputs
+ return (ExecutionResult.PENDING, None, None)
+
+ cache_entry = CacheEntry(ui=ui_outputs.get(unique_id), outputs=output_data)
+ execution_list.cache_update(unique_id, cache_entry)
+ caches.outputs.set(unique_id, cache_entry)
+
+ except comfy.model_management.InterruptProcessingException as iex:
+ logging.info("Processing interrupted")
+
+ # skip formatting inputs/outputs
+ error_details = {
+ "node_id": real_node_id,
+ }
+
+ return (ExecutionResult.FAILURE, error_details, iex)
+ except Exception as ex:
+ typ, _, tb = sys.exc_info()
+ exception_type = full_type_name(typ)
+ input_data_formatted = {}
+ if input_data_all is not None:
+ input_data_formatted = {}
+ for name, inputs in input_data_all.items():
+ input_data_formatted[name] = [format_value(x) for x in inputs]
+
+ logging.error(f"!!! Exception during processing !!! {ex}")
+ logging.error(traceback.format_exc())
+ tips = ""
+
+ if isinstance(ex, comfy.model_management.OOM_EXCEPTION):
+ tips = "This error means you ran out of memory on your GPU.\n\nTIPS: If the workflow worked before you might have accidentally set the batch_size to a large number."
+ logging.error("Got an OOM, unloading all loaded models.")
+ comfy.model_management.unload_all_models()
+
+ error_details = {
+ "node_id": real_node_id,
+ "exception_message": "{}\n{}".format(ex, tips),
+ "exception_type": exception_type,
+ "traceback": traceback.format_tb(tb),
+ "current_inputs": input_data_formatted
+ }
+
+ return (ExecutionResult.FAILURE, error_details, ex)
+
+ get_progress_state().finish_progress(unique_id)
+ executed.add(unique_id)
+
+ return (ExecutionResult.SUCCESS, None, None)
+
+class PromptExecutor:
+ def __init__(self, server, cache_type=False, cache_args=None):
+ self.cache_args = cache_args
+ self.cache_type = cache_type
+ self.server = server
+ self.reset()
+
+ def reset(self):
+ self.caches = CacheSet(cache_type=self.cache_type, cache_args=self.cache_args)
+ self.status_messages = []
+ self.success = True
+
+ def add_message(self, event, data: dict, broadcast: bool):
+ data = {
+ **data,
+ "timestamp": int(time.time() * 1000),
+ }
+ self.status_messages.append((event, data))
+ if self.server.client_id is not None or broadcast:
+ self.server.send_sync(event, data, self.server.client_id)
+
+ def handle_execution_error(self, prompt_id, prompt, current_outputs, executed, error, ex):
+ node_id = error["node_id"]
+ class_type = prompt[node_id]["class_type"]
+
+ # First, send back the status to the frontend depending
+ # on the exception type
+ if isinstance(ex, comfy.model_management.InterruptProcessingException):
+ mes = {
+ "prompt_id": prompt_id,
+ "node_id": node_id,
+ "node_type": class_type,
+ "executed": list(executed),
+ }
+ self.add_message("execution_interrupted", mes, broadcast=True)
+ else:
+ mes = {
+ "prompt_id": prompt_id,
+ "node_id": node_id,
+ "node_type": class_type,
+ "executed": list(executed),
+ "exception_message": error["exception_message"],
+ "exception_type": error["exception_type"],
+ "traceback": error["traceback"],
+ "current_inputs": error["current_inputs"],
+ "current_outputs": list(current_outputs),
+ }
+ self.add_message("execution_error", mes, broadcast=False)
+
+ def execute(self, prompt, prompt_id, extra_data={}, execute_outputs=[]):
+ asyncio.run(self.execute_async(prompt, prompt_id, extra_data, execute_outputs))
+
+ async def execute_async(self, prompt, prompt_id, extra_data={}, execute_outputs=[]):
+ nodes.interrupt_processing(False)
+
+ if "client_id" in extra_data:
+ self.server.client_id = extra_data["client_id"]
+ else:
+ self.server.client_id = None
+
+ self.status_messages = []
+ self.add_message("execution_start", { "prompt_id": prompt_id}, broadcast=False)
+
+ with torch.inference_mode():
+ dynamic_prompt = DynamicPrompt(prompt)
+ reset_progress_state(prompt_id, dynamic_prompt)
+ add_progress_handler(WebUIProgressHandler(self.server))
+ is_changed_cache = IsChangedCache(prompt_id, dynamic_prompt, self.caches.outputs)
+ for cache in self.caches.all:
+ await cache.set_prompt(dynamic_prompt, prompt.keys(), is_changed_cache)
+ cache.clean_unused()
+
+ cached_nodes = []
+ for node_id in prompt:
+ if self.caches.outputs.get(node_id) is not None:
+ cached_nodes.append(node_id)
+
+ comfy.model_management.cleanup_models_gc()
+ self.add_message("execution_cached",
+ { "nodes": cached_nodes, "prompt_id": prompt_id},
+ broadcast=False)
+ pending_subgraph_results = {}
+ pending_async_nodes = {} # TODO - Unify this with pending_subgraph_results
+ ui_node_outputs = {}
+ executed = set()
+ execution_list = ExecutionList(dynamic_prompt, self.caches.outputs)
+ current_outputs = self.caches.outputs.all_node_ids()
+ for node_id in list(execute_outputs):
+ execution_list.add_node(node_id)
+
+ while not execution_list.is_empty():
+ node_id, error, ex = await execution_list.stage_node_execution()
+ if error is not None:
+ self.handle_execution_error(prompt_id, dynamic_prompt.original_prompt, current_outputs, executed, error, ex)
+ break
+
+ assert node_id is not None, "Node ID should not be None at this point"
+ result, error, ex = await execute(self.server, dynamic_prompt, self.caches, node_id, extra_data, executed, prompt_id, execution_list, pending_subgraph_results, pending_async_nodes, ui_node_outputs)
+ self.success = result != ExecutionResult.FAILURE
+ if result == ExecutionResult.FAILURE:
+ self.handle_execution_error(prompt_id, dynamic_prompt.original_prompt, current_outputs, executed, error, ex)
+ break
+ elif result == ExecutionResult.PENDING:
+ execution_list.unstage_node_execution()
+ else: # result == ExecutionResult.SUCCESS:
+ execution_list.complete_node_execution()
+ self.caches.outputs.poll(ram_headroom=self.cache_args["ram"])
+ else:
+ # Only execute when the while-loop ends without break
+ self.add_message("execution_success", { "prompt_id": prompt_id }, broadcast=False)
+
+ ui_outputs = {}
+ meta_outputs = {}
+ for node_id, ui_info in ui_node_outputs.items():
+ ui_outputs[node_id] = ui_info["output"]
+ meta_outputs[node_id] = ui_info["meta"]
+ self.history_result = {
+ "outputs": ui_outputs,
+ "meta": meta_outputs,
+ }
+ self.server.last_node_id = None
+ if comfy.model_management.DISABLE_SMART_MEMORY:
+ comfy.model_management.unload_all_models()
+
+
+async def validate_inputs(prompt_id, prompt, item, validated):
+ unique_id = item
+ if unique_id in validated:
+ return validated[unique_id]
+
+ inputs = prompt[unique_id]['inputs']
+ class_type = prompt[unique_id]['class_type']
+ obj_class = nodes.NODE_CLASS_MAPPINGS[class_type]
+
+ class_inputs = obj_class.INPUT_TYPES()
+ valid_inputs = set(class_inputs.get('required',{})).union(set(class_inputs.get('optional',{})))
+
+ errors = []
+ valid = True
+
+ validate_function_inputs = []
+ validate_has_kwargs = False
+ if issubclass(obj_class, _ComfyNodeInternal):
+ validate_function_name = "validate_inputs"
+ validate_function = first_real_override(obj_class, validate_function_name)
+ else:
+ validate_function_name = "VALIDATE_INPUTS"
+ validate_function = getattr(obj_class, validate_function_name, None)
+ if validate_function is not None:
+ argspec = inspect.getfullargspec(validate_function)
+ validate_function_inputs = argspec.args
+ validate_has_kwargs = argspec.varkw is not None
+ received_types = {}
+
+ for x in valid_inputs:
+ input_type, input_category, extra_info = get_input_info(obj_class, x, class_inputs)
+ assert extra_info is not None
+ if x not in inputs:
+ if input_category == "required":
+ error = {
+ "type": "required_input_missing",
+ "message": "Required input is missing",
+ "details": f"{x}",
+ "extra_info": {
+ "input_name": x
+ }
+ }
+ errors.append(error)
+ continue
+
+ val = inputs[x]
+ info = (input_type, extra_info)
+ if isinstance(val, list):
+ if len(val) != 2:
+ error = {
+ "type": "bad_linked_input",
+ "message": "Bad linked input, must be a length-2 list of [node_id, slot_index]",
+ "details": f"{x}",
+ "extra_info": {
+ "input_name": x,
+ "input_config": info,
+ "received_value": val
+ }
+ }
+ errors.append(error)
+ continue
+
+ o_id = val[0]
+ o_class_type = prompt[o_id]['class_type']
+ r = nodes.NODE_CLASS_MAPPINGS[o_class_type].RETURN_TYPES
+ received_type = r[val[1]]
+ received_types[x] = received_type
+ if 'input_types' not in validate_function_inputs and not validate_node_input(received_type, input_type):
+ details = f"{x}, received_type({received_type}) mismatch input_type({input_type})"
+ error = {
+ "type": "return_type_mismatch",
+ "message": "Return type mismatch between linked nodes",
+ "details": details,
+ "extra_info": {
+ "input_name": x,
+ "input_config": info,
+ "received_type": received_type,
+ "linked_node": val
+ }
+ }
+ errors.append(error)
+ continue
+ try:
+ r = await validate_inputs(prompt_id, prompt, o_id, validated)
+ if r[0] is False:
+ # `r` will be set in `validated[o_id]` already
+ valid = False
+ continue
+ except Exception as ex:
+ typ, _, tb = sys.exc_info()
+ valid = False
+ exception_type = full_type_name(typ)
+ reasons = [{
+ "type": "exception_during_inner_validation",
+ "message": "Exception when validating inner node",
+ "details": str(ex),
+ "extra_info": {
+ "input_name": x,
+ "input_config": info,
+ "exception_message": str(ex),
+ "exception_type": exception_type,
+ "traceback": traceback.format_tb(tb),
+ "linked_node": val
+ }
+ }]
+ validated[o_id] = (False, reasons, o_id)
+ continue
+ else:
+ try:
+ # Unwraps values wrapped in __value__ key. This is used to pass
+ # list widget value to execution, as by default list value is
+ # reserved to represent the connection between nodes.
+ if isinstance(val, dict) and "__value__" in val:
+ val = val["__value__"]
+ inputs[x] = val
+
+ if input_type == "INT":
+ val = int(val)
+ inputs[x] = val
+ if input_type == "FLOAT":
+ val = float(val)
+ inputs[x] = val
+ if input_type == "STRING":
+ val = str(val)
+ inputs[x] = val
+ if input_type == "BOOLEAN":
+ val = bool(val)
+ inputs[x] = val
+ except Exception as ex:
+ error = {
+ "type": "invalid_input_type",
+ "message": f"Failed to convert an input value to a {input_type} value",
+ "details": f"{x}, {val}, {ex}",
+ "extra_info": {
+ "input_name": x,
+ "input_config": info,
+ "received_value": val,
+ "exception_message": str(ex)
+ }
+ }
+ errors.append(error)
+ continue
+
+ if x not in validate_function_inputs and not validate_has_kwargs:
+ if "min" in extra_info and val < extra_info["min"]:
+ error = {
+ "type": "value_smaller_than_min",
+ "message": "Value {} smaller than min of {}".format(val, extra_info["min"]),
+ "details": f"{x}",
+ "extra_info": {
+ "input_name": x,
+ "input_config": info,
+ "received_value": val,
+ }
+ }
+ errors.append(error)
+ continue
+ if "max" in extra_info and val > extra_info["max"]:
+ error = {
+ "type": "value_bigger_than_max",
+ "message": "Value {} bigger than max of {}".format(val, extra_info["max"]),
+ "details": f"{x}",
+ "extra_info": {
+ "input_name": x,
+ "input_config": info,
+ "received_value": val,
+ }
+ }
+ errors.append(error)
+ continue
+
+ if isinstance(input_type, list):
+ combo_options = input_type
+ if val not in combo_options:
+ input_config = info
+ list_info = ""
+
+ # Don't send back gigantic lists like if they're lots of
+ # scanned model filepaths
+ if len(combo_options) > 20:
+ list_info = f"(list of length {len(combo_options)})"
+ input_config = None
+ else:
+ list_info = str(combo_options)
+
+ error = {
+ "type": "value_not_in_list",
+ "message": "Value not in list",
+ "details": f"{x}: '{val}' not in {list_info}",
+ "extra_info": {
+ "input_name": x,
+ "input_config": input_config,
+ "received_value": val,
+ }
+ }
+ errors.append(error)
+ continue
+
+ if len(validate_function_inputs) > 0 or validate_has_kwargs:
+ input_data_all, _, hidden_inputs = get_input_data(inputs, obj_class, unique_id)
+ input_filtered = {}
+ for x in input_data_all:
+ if x in validate_function_inputs or validate_has_kwargs:
+ input_filtered[x] = input_data_all[x]
+ if 'input_types' in validate_function_inputs:
+ input_filtered['input_types'] = [received_types]
+
+ ret = await _async_map_node_over_list(prompt_id, unique_id, obj_class, input_filtered, validate_function_name, hidden_inputs=hidden_inputs)
+ ret = await resolve_map_node_over_list_results(ret)
+ for x in input_filtered:
+ for i, r in enumerate(ret):
+ if r is not True and not isinstance(r, ExecutionBlocker):
+ details = f"{x}"
+ if r is not False:
+ details += f" - {str(r)}"
+
+ error = {
+ "type": "custom_validation_failed",
+ "message": "Custom validation failed for node",
+ "details": details,
+ "extra_info": {
+ "input_name": x,
+ }
+ }
+ errors.append(error)
+ continue
+
+ if len(errors) > 0 or valid is not True:
+ ret = (False, errors, unique_id)
+ else:
+ ret = (True, [], unique_id)
+
+ validated[unique_id] = ret
+ return ret
+
+def full_type_name(klass):
+ module = klass.__module__
+ if module == 'builtins':
+ return klass.__qualname__
+ return module + '.' + klass.__qualname__
+
+async def validate_prompt(prompt_id, prompt, partial_execution_list: Union[list[str], None]):
+ outputs = set()
+ for x in prompt:
+ if 'class_type' not in prompt[x]:
+ error = {
+ "type": "invalid_prompt",
+ "message": "Cannot execute because a node is missing the class_type property.",
+ "details": f"Node ID '#{x}'",
+ "extra_info": {}
+ }
+ return (False, error, [], {})
+
+ class_type = prompt[x]['class_type']
+ class_ = nodes.NODE_CLASS_MAPPINGS.get(class_type, None)
+ if class_ is None:
+ error = {
+ "type": "invalid_prompt",
+ "message": f"Cannot execute because node {class_type} does not exist.",
+ "details": f"Node ID '#{x}'",
+ "extra_info": {}
+ }
+ return (False, error, [], {})
+
+ if hasattr(class_, 'OUTPUT_NODE') and class_.OUTPUT_NODE is True:
+ if partial_execution_list is None or x in partial_execution_list:
+ outputs.add(x)
+
+ if len(outputs) == 0:
+ error = {
+ "type": "prompt_no_outputs",
+ "message": "Prompt has no outputs",
+ "details": "",
+ "extra_info": {}
+ }
+ return (False, error, [], {})
+
+ good_outputs = set()
+ errors = []
+ node_errors = {}
+ validated = {}
+ for o in outputs:
+ valid = False
+ reasons = []
+ try:
+ m = await validate_inputs(prompt_id, prompt, o, validated)
+ valid = m[0]
+ reasons = m[1]
+ except Exception as ex:
+ typ, _, tb = sys.exc_info()
+ valid = False
+ exception_type = full_type_name(typ)
+ reasons = [{
+ "type": "exception_during_validation",
+ "message": "Exception when validating node",
+ "details": str(ex),
+ "extra_info": {
+ "exception_type": exception_type,
+ "traceback": traceback.format_tb(tb)
+ }
+ }]
+ validated[o] = (False, reasons, o)
+
+ if valid is True:
+ good_outputs.add(o)
+ else:
+ logging.error(f"Failed to validate prompt for output {o}:")
+ if len(reasons) > 0:
+ logging.error("* (prompt):")
+ for reason in reasons:
+ logging.error(f" - {reason['message']}: {reason['details']}")
+ errors += [(o, reasons)]
+ for node_id, result in validated.items():
+ valid = result[0]
+ reasons = result[1]
+ # If a node upstream has errors, the nodes downstream will also
+ # be reported as invalid, but there will be no errors attached.
+ # So don't return those nodes as having errors in the response.
+ if valid is not True and len(reasons) > 0:
+ if node_id not in node_errors:
+ class_type = prompt[node_id]['class_type']
+ node_errors[node_id] = {
+ "errors": reasons,
+ "dependent_outputs": [],
+ "class_type": class_type
+ }
+ logging.error(f"* {class_type} {node_id}:")
+ for reason in reasons:
+ logging.error(f" - {reason['message']}: {reason['details']}")
+ node_errors[node_id]["dependent_outputs"].append(o)
+ logging.error("Output will be ignored")
+
+ if len(good_outputs) == 0:
+ errors_list = []
+ for o, errors in errors:
+ for error in errors:
+ errors_list.append(f"{error['message']}: {error['details']}")
+ errors_list = "\n".join(errors_list)
+
+ error = {
+ "type": "prompt_outputs_failed_validation",
+ "message": "Prompt outputs failed validation",
+ "details": errors_list,
+ "extra_info": {}
+ }
+
+ return (False, error, list(good_outputs), node_errors)
+
+ return (True, None, list(good_outputs), node_errors)
+
+MAXIMUM_HISTORY_SIZE = 10000
+
+class PromptQueue:
+ def __init__(self, server):
+ self.server = server
+ self.mutex = threading.RLock()
+ self.not_empty = threading.Condition(self.mutex)
+ self.task_counter = 0
+ self.queue = []
+ self.currently_running = {}
+ self.history = {}
+ self.flags = {}
+
+ def put(self, item):
+ with self.mutex:
+ heapq.heappush(self.queue, item)
+ self.server.queue_updated()
+ self.not_empty.notify()
+
+ def get(self, timeout=None):
+ with self.not_empty:
+ while len(self.queue) == 0:
+ self.not_empty.wait(timeout=timeout)
+ if timeout is not None and len(self.queue) == 0:
+ return None
+ item = heapq.heappop(self.queue)
+ i = self.task_counter
+ self.currently_running[i] = copy.deepcopy(item)
+ self.task_counter += 1
+ self.server.queue_updated()
+ return (item, i)
+
+ class ExecutionStatus(NamedTuple):
+ status_str: Literal['success', 'error']
+ completed: bool
+ messages: List[str]
+
+ def task_done(self, item_id, history_result,
+ status: Optional['PromptQueue.ExecutionStatus'], process_item=None):
+ with self.mutex:
+ prompt = self.currently_running.pop(item_id)
+ if len(self.history) > MAXIMUM_HISTORY_SIZE:
+ self.history.pop(next(iter(self.history)))
+
+ status_dict: Optional[dict] = None
+ if status is not None:
+ status_dict = copy.deepcopy(status._asdict())
+
+ if process_item is not None:
+ prompt = process_item(prompt)
+
+ self.history[prompt[1]] = {
+ "prompt": prompt,
+ "outputs": {},
+ 'status': status_dict,
+ }
+ self.history[prompt[1]].update(history_result)
+ self.server.queue_updated()
+
+ # Note: slow
+ def get_current_queue(self):
+ with self.mutex:
+ out = []
+ for x in self.currently_running.values():
+ out += [x]
+ return (out, copy.deepcopy(self.queue))
+
+ # read-safe as long as queue items are immutable
+ def get_current_queue_volatile(self):
+ with self.mutex:
+ running = [x for x in self.currently_running.values()]
+ queued = copy.copy(self.queue)
+ return (running, queued)
+
+ def get_tasks_remaining(self):
+ with self.mutex:
+ return len(self.queue) + len(self.currently_running)
+
+ def wipe_queue(self):
+ with self.mutex:
+ self.queue = []
+ self.server.queue_updated()
+
+ def delete_queue_item(self, function):
+ with self.mutex:
+ for x in range(len(self.queue)):
+ if function(self.queue[x]):
+ if len(self.queue) == 1:
+ self.wipe_queue()
+ else:
+ self.queue.pop(x)
+ heapq.heapify(self.queue)
+ self.server.queue_updated()
+ return True
+ return False
+
+ def get_history(self, prompt_id=None, max_items=None, offset=-1, map_function=None):
+ with self.mutex:
+ if prompt_id is None:
+ out = {}
+ i = 0
+ if offset < 0 and max_items is not None:
+ offset = len(self.history) - max_items
+ for k in self.history:
+ if i >= offset:
+ p = self.history[k]
+ if map_function is not None:
+ p = map_function(p)
+ out[k] = p
+ if max_items is not None and len(out) >= max_items:
+ break
+ i += 1
+ return out
+ elif prompt_id in self.history:
+ p = self.history[prompt_id]
+ if map_function is None:
+ p = copy.deepcopy(p)
+ else:
+ p = map_function(p)
+ return {prompt_id: p}
+ else:
+ return {}
+
+ def wipe_history(self):
+ with self.mutex:
+ self.history = {}
+
+ def delete_history_item(self, id_to_delete):
+ with self.mutex:
+ self.history.pop(id_to_delete, None)
+
+ def set_flag(self, name, data):
+ with self.mutex:
+ self.flags[name] = data
+ self.not_empty.notify()
+
+ def get_flags(self, reset=True):
+ with self.mutex:
+ if reset:
+ ret = self.flags
+ self.flags = {}
+ return ret
+ else:
+ return self.flags.copy()
diff --git a/docs/hel-892/separation-reference/core-0.3.68__nodes.py b/docs/hel-892/separation-reference/core-0.3.68__nodes.py
new file mode 100644
index 00000000..5689f6fe
--- /dev/null
+++ b/docs/hel-892/separation-reference/core-0.3.68__nodes.py
@@ -0,0 +1,2423 @@
+from __future__ import annotations
+import torch
+
+
+import os
+import sys
+import json
+import hashlib
+import inspect
+import traceback
+import math
+import time
+import random
+import logging
+
+from PIL import Image, ImageOps, ImageSequence
+from PIL.PngImagePlugin import PngInfo
+
+import numpy as np
+import safetensors.torch
+
+sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "comfy"))
+
+import comfy.diffusers_load
+import comfy.samplers
+import comfy.sample
+import comfy.sd
+import comfy.utils
+import comfy.controlnet
+from comfy.comfy_types import IO, ComfyNodeABC, InputTypeDict, FileLocator
+from comfy_api.internal import register_versions, ComfyAPIWithVersion
+from comfy_api.version_list import supported_versions
+from comfy_api.latest import io, ComfyExtension
+
+import comfy.clip_vision
+
+import comfy.model_management
+from comfy.cli_args import args
+
+import importlib
+
+import folder_paths
+import latent_preview
+import node_helpers
+
+def before_node_execution():
+ comfy.model_management.throw_exception_if_processing_interrupted()
+
+def interrupt_processing(value=True):
+ comfy.model_management.interrupt_current_processing(value)
+
+MAX_RESOLUTION=16384
+
+class CLIPTextEncode(ComfyNodeABC):
+ @classmethod
+ def INPUT_TYPES(s) -> InputTypeDict:
+ return {
+ "required": {
+ "text": (IO.STRING, {"multiline": True, "dynamicPrompts": True, "tooltip": "The text to be encoded."}),
+ "clip": (IO.CLIP, {"tooltip": "The CLIP model used for encoding the text."})
+ }
+ }
+ RETURN_TYPES = (IO.CONDITIONING,)
+ OUTPUT_TOOLTIPS = ("A conditioning containing the embedded text used to guide the diffusion model.",)
+ FUNCTION = "encode"
+
+ CATEGORY = "conditioning"
+ DESCRIPTION = "Encodes a text prompt using a CLIP model into an embedding that can be used to guide the diffusion model towards generating specific images."
+
+ def encode(self, clip, text):
+ if clip is None:
+ raise RuntimeError("ERROR: clip input is invalid: None\n\nIf the clip is from a checkpoint loader node your checkpoint does not contain a valid clip or text encoder model.")
+ tokens = clip.tokenize(text)
+ return (clip.encode_from_tokens_scheduled(tokens), )
+
+
+class ConditioningCombine:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning_1": ("CONDITIONING", ), "conditioning_2": ("CONDITIONING", )}}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "combine"
+
+ CATEGORY = "conditioning"
+
+ def combine(self, conditioning_1, conditioning_2):
+ return (conditioning_1 + conditioning_2, )
+
+class ConditioningAverage :
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning_to": ("CONDITIONING", ), "conditioning_from": ("CONDITIONING", ),
+ "conditioning_to_strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01})
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "addWeighted"
+
+ CATEGORY = "conditioning"
+
+ def addWeighted(self, conditioning_to, conditioning_from, conditioning_to_strength):
+ out = []
+
+ if len(conditioning_from) > 1:
+ logging.warning("Warning: ConditioningAverage conditioning_from contains more than 1 cond, only the first one will actually be applied to conditioning_to.")
+
+ cond_from = conditioning_from[0][0]
+ pooled_output_from = conditioning_from[0][1].get("pooled_output", None)
+
+ for i in range(len(conditioning_to)):
+ t1 = conditioning_to[i][0]
+ pooled_output_to = conditioning_to[i][1].get("pooled_output", pooled_output_from)
+ t0 = cond_from[:,:t1.shape[1]]
+ if t0.shape[1] < t1.shape[1]:
+ t0 = torch.cat([t0] + [torch.zeros((1, (t1.shape[1] - t0.shape[1]), t1.shape[2]))], dim=1)
+
+ tw = torch.mul(t1, conditioning_to_strength) + torch.mul(t0, (1.0 - conditioning_to_strength))
+ t_to = conditioning_to[i][1].copy()
+ if pooled_output_from is not None and pooled_output_to is not None:
+ t_to["pooled_output"] = torch.mul(pooled_output_to, conditioning_to_strength) + torch.mul(pooled_output_from, (1.0 - conditioning_to_strength))
+ elif pooled_output_from is not None:
+ t_to["pooled_output"] = pooled_output_from
+
+ n = [tw, t_to]
+ out.append(n)
+ return (out, )
+
+class ConditioningConcat:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {
+ "conditioning_to": ("CONDITIONING",),
+ "conditioning_from": ("CONDITIONING",),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "concat"
+
+ CATEGORY = "conditioning"
+
+ def concat(self, conditioning_to, conditioning_from):
+ out = []
+
+ if len(conditioning_from) > 1:
+ logging.warning("Warning: ConditioningConcat conditioning_from contains more than 1 cond, only the first one will actually be applied to conditioning_to.")
+
+ cond_from = conditioning_from[0][0]
+
+ for i in range(len(conditioning_to)):
+ t1 = conditioning_to[i][0]
+ tw = torch.cat((t1, cond_from),1)
+ n = [tw, conditioning_to[i][1].copy()]
+ out.append(n)
+
+ return (out, )
+
+class ConditioningSetArea:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "width": ("INT", {"default": 64, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
+ "height": ("INT", {"default": 64, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
+ "x": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "y": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "append"
+
+ CATEGORY = "conditioning"
+
+ def append(self, conditioning, width, height, x, y, strength):
+ c = node_helpers.conditioning_set_values(conditioning, {"area": (height // 8, width // 8, y // 8, x // 8),
+ "strength": strength,
+ "set_area_to_bounds": False})
+ return (c, )
+
+class ConditioningSetAreaPercentage:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "width": ("FLOAT", {"default": 1.0, "min": 0, "max": 1.0, "step": 0.01}),
+ "height": ("FLOAT", {"default": 1.0, "min": 0, "max": 1.0, "step": 0.01}),
+ "x": ("FLOAT", {"default": 0, "min": 0, "max": 1.0, "step": 0.01}),
+ "y": ("FLOAT", {"default": 0, "min": 0, "max": 1.0, "step": 0.01}),
+ "strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "append"
+
+ CATEGORY = "conditioning"
+
+ def append(self, conditioning, width, height, x, y, strength):
+ c = node_helpers.conditioning_set_values(conditioning, {"area": ("percentage", height, width, y, x),
+ "strength": strength,
+ "set_area_to_bounds": False})
+ return (c, )
+
+class ConditioningSetAreaStrength:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "append"
+
+ CATEGORY = "conditioning"
+
+ def append(self, conditioning, strength):
+ c = node_helpers.conditioning_set_values(conditioning, {"strength": strength})
+ return (c, )
+
+
+class ConditioningSetMask:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "mask": ("MASK", ),
+ "strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
+ "set_cond_area": (["default", "mask bounds"],),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "append"
+
+ CATEGORY = "conditioning"
+
+ def append(self, conditioning, mask, set_cond_area, strength):
+ set_area_to_bounds = False
+ if set_cond_area != "default":
+ set_area_to_bounds = True
+ if len(mask.shape) < 3:
+ mask = mask.unsqueeze(0)
+
+ c = node_helpers.conditioning_set_values(conditioning, {"mask": mask,
+ "set_area_to_bounds": set_area_to_bounds,
+ "mask_strength": strength})
+ return (c, )
+
+class ConditioningZeroOut:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", )}}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "zero_out"
+
+ CATEGORY = "advanced/conditioning"
+
+ def zero_out(self, conditioning):
+ c = []
+ for t in conditioning:
+ d = t[1].copy()
+ pooled_output = d.get("pooled_output", None)
+ if pooled_output is not None:
+ d["pooled_output"] = torch.zeros_like(pooled_output)
+ conditioning_lyrics = d.get("conditioning_lyrics", None)
+ if conditioning_lyrics is not None:
+ d["conditioning_lyrics"] = torch.zeros_like(conditioning_lyrics)
+ n = [torch.zeros_like(t[0]), d]
+ c.append(n)
+ return (c, )
+
+class ConditioningSetTimestepRange:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "start": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 1.0, "step": 0.001}),
+ "end": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.001})
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "set_range"
+
+ CATEGORY = "advanced/conditioning"
+
+ def set_range(self, conditioning, start, end):
+ c = node_helpers.conditioning_set_values(conditioning, {"start_percent": start,
+ "end_percent": end})
+ return (c, )
+
+class VAEDecode:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "samples": ("LATENT", {"tooltip": "The latent to be decoded."}),
+ "vae": ("VAE", {"tooltip": "The VAE model used for decoding the latent."})
+ }
+ }
+ RETURN_TYPES = ("IMAGE",)
+ OUTPUT_TOOLTIPS = ("The decoded image.",)
+ FUNCTION = "decode"
+
+ CATEGORY = "latent"
+ DESCRIPTION = "Decodes latent images back into pixel space images."
+
+ def decode(self, vae, samples):
+ images = vae.decode(samples["samples"])
+ if len(images.shape) == 5: #Combine batches
+ images = images.reshape(-1, images.shape[-3], images.shape[-2], images.shape[-1])
+ return (images, )
+
+class VAEDecodeTiled:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"samples": ("LATENT", ), "vae": ("VAE", ),
+ "tile_size": ("INT", {"default": 512, "min": 64, "max": 4096, "step": 32}),
+ "overlap": ("INT", {"default": 64, "min": 0, "max": 4096, "step": 32}),
+ "temporal_size": ("INT", {"default": 64, "min": 8, "max": 4096, "step": 4, "tooltip": "Only used for video VAEs: Amount of frames to decode at a time."}),
+ "temporal_overlap": ("INT", {"default": 8, "min": 4, "max": 4096, "step": 4, "tooltip": "Only used for video VAEs: Amount of frames to overlap."}),
+ }}
+ RETURN_TYPES = ("IMAGE",)
+ FUNCTION = "decode"
+
+ CATEGORY = "_for_testing"
+
+ def decode(self, vae, samples, tile_size, overlap=64, temporal_size=64, temporal_overlap=8):
+ if tile_size < overlap * 4:
+ overlap = tile_size // 4
+ if temporal_size < temporal_overlap * 2:
+ temporal_overlap = temporal_overlap // 2
+ temporal_compression = vae.temporal_compression_decode()
+ if temporal_compression is not None:
+ temporal_size = max(2, temporal_size // temporal_compression)
+ temporal_overlap = max(1, min(temporal_size // 2, temporal_overlap // temporal_compression))
+ else:
+ temporal_size = None
+ temporal_overlap = None
+
+ compression = vae.spacial_compression_decode()
+ images = vae.decode_tiled(samples["samples"], tile_x=tile_size // compression, tile_y=tile_size // compression, overlap=overlap // compression, tile_t=temporal_size, overlap_t=temporal_overlap)
+ if len(images.shape) == 5: #Combine batches
+ images = images.reshape(-1, images.shape[-3], images.shape[-2], images.shape[-1])
+ return (images, )
+
+class VAEEncode:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "pixels": ("IMAGE", ), "vae": ("VAE", )}}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "encode"
+
+ CATEGORY = "latent"
+
+ def encode(self, vae, pixels):
+ t = vae.encode(pixels[:,:,:,:3])
+ return ({"samples":t}, )
+
+class VAEEncodeTiled:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"pixels": ("IMAGE", ), "vae": ("VAE", ),
+ "tile_size": ("INT", {"default": 512, "min": 64, "max": 4096, "step": 64}),
+ "overlap": ("INT", {"default": 64, "min": 0, "max": 4096, "step": 32}),
+ "temporal_size": ("INT", {"default": 64, "min": 8, "max": 4096, "step": 4, "tooltip": "Only used for video VAEs: Amount of frames to encode at a time."}),
+ "temporal_overlap": ("INT", {"default": 8, "min": 4, "max": 4096, "step": 4, "tooltip": "Only used for video VAEs: Amount of frames to overlap."}),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "encode"
+
+ CATEGORY = "_for_testing"
+
+ def encode(self, vae, pixels, tile_size, overlap, temporal_size=64, temporal_overlap=8):
+ t = vae.encode_tiled(pixels[:,:,:,:3], tile_x=tile_size, tile_y=tile_size, overlap=overlap, tile_t=temporal_size, overlap_t=temporal_overlap)
+ return ({"samples": t}, )
+
+class VAEEncodeForInpaint:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "pixels": ("IMAGE", ), "vae": ("VAE", ), "mask": ("MASK", ), "grow_mask_by": ("INT", {"default": 6, "min": 0, "max": 64, "step": 1}),}}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "encode"
+
+ CATEGORY = "latent/inpaint"
+
+ def encode(self, vae, pixels, mask, grow_mask_by=6):
+ x = (pixels.shape[1] // vae.downscale_ratio) * vae.downscale_ratio
+ y = (pixels.shape[2] // vae.downscale_ratio) * vae.downscale_ratio
+ mask = torch.nn.functional.interpolate(mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1])), size=(pixels.shape[1], pixels.shape[2]), mode="bilinear")
+
+ pixels = pixels.clone()
+ if pixels.shape[1] != x or pixels.shape[2] != y:
+ x_offset = (pixels.shape[1] % vae.downscale_ratio) // 2
+ y_offset = (pixels.shape[2] % vae.downscale_ratio) // 2
+ pixels = pixels[:,x_offset:x + x_offset, y_offset:y + y_offset,:]
+ mask = mask[:,:,x_offset:x + x_offset, y_offset:y + y_offset]
+
+ #grow mask by a few pixels to keep things seamless in latent space
+ if grow_mask_by == 0:
+ mask_erosion = mask
+ else:
+ kernel_tensor = torch.ones((1, 1, grow_mask_by, grow_mask_by))
+ padding = math.ceil((grow_mask_by - 1) / 2)
+
+ mask_erosion = torch.clamp(torch.nn.functional.conv2d(mask.round(), kernel_tensor, padding=padding), 0, 1)
+
+ m = (1.0 - mask.round()).squeeze(1)
+ for i in range(3):
+ pixels[:,:,:,i] -= 0.5
+ pixels[:,:,:,i] *= m
+ pixels[:,:,:,i] += 0.5
+ t = vae.encode(pixels)
+
+ return ({"samples":t, "noise_mask": (mask_erosion[:,:,:x,:y].round())}, )
+
+
+class InpaintModelConditioning:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"positive": ("CONDITIONING", ),
+ "negative": ("CONDITIONING", ),
+ "vae": ("VAE", ),
+ "pixels": ("IMAGE", ),
+ "mask": ("MASK", ),
+ "noise_mask": ("BOOLEAN", {"default": True, "tooltip": "Add a noise mask to the latent so sampling will only happen within the mask. Might improve results or completely break things depending on the model."}),
+ }}
+
+ RETURN_TYPES = ("CONDITIONING","CONDITIONING","LATENT")
+ RETURN_NAMES = ("positive", "negative", "latent")
+ FUNCTION = "encode"
+
+ CATEGORY = "conditioning/inpaint"
+
+ def encode(self, positive, negative, pixels, vae, mask, noise_mask=True):
+ x = (pixels.shape[1] // 8) * 8
+ y = (pixels.shape[2] // 8) * 8
+ mask = torch.nn.functional.interpolate(mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1])), size=(pixels.shape[1], pixels.shape[2]), mode="bilinear")
+
+ orig_pixels = pixels
+ pixels = orig_pixels.clone()
+ if pixels.shape[1] != x or pixels.shape[2] != y:
+ x_offset = (pixels.shape[1] % 8) // 2
+ y_offset = (pixels.shape[2] % 8) // 2
+ pixels = pixels[:,x_offset:x + x_offset, y_offset:y + y_offset,:]
+ mask = mask[:,:,x_offset:x + x_offset, y_offset:y + y_offset]
+
+ m = (1.0 - mask.round()).squeeze(1)
+ for i in range(3):
+ pixels[:,:,:,i] -= 0.5
+ pixels[:,:,:,i] *= m
+ pixels[:,:,:,i] += 0.5
+ concat_latent = vae.encode(pixels)
+ orig_latent = vae.encode(orig_pixels)
+
+ out_latent = {}
+
+ out_latent["samples"] = orig_latent
+ if noise_mask:
+ out_latent["noise_mask"] = mask
+
+ out = []
+ for conditioning in [positive, negative]:
+ c = node_helpers.conditioning_set_values(conditioning, {"concat_latent_image": concat_latent,
+ "concat_mask": mask})
+ out.append(c)
+ return (out[0], out[1], out_latent)
+
+
+class SaveLatent:
+ def __init__(self):
+ self.output_dir = folder_paths.get_output_directory()
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT", ),
+ "filename_prefix": ("STRING", {"default": "latents/ComfyUI"})},
+ "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
+ }
+ RETURN_TYPES = ()
+ FUNCTION = "save"
+
+ OUTPUT_NODE = True
+
+ CATEGORY = "_for_testing"
+
+ def save(self, samples, filename_prefix="ComfyUI", prompt=None, extra_pnginfo=None):
+ full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(filename_prefix, self.output_dir)
+
+ # support save metadata for latent sharing
+ prompt_info = ""
+ if prompt is not None:
+ prompt_info = json.dumps(prompt)
+
+ metadata = None
+ if not args.disable_metadata:
+ metadata = {"prompt": prompt_info}
+ if extra_pnginfo is not None:
+ for x in extra_pnginfo:
+ metadata[x] = json.dumps(extra_pnginfo[x])
+
+ file = f"{filename}_{counter:05}_.latent"
+
+ results: list[FileLocator] = []
+ results.append({
+ "filename": file,
+ "subfolder": subfolder,
+ "type": "output"
+ })
+
+ file = os.path.join(full_output_folder, file)
+
+ output = {}
+ output["latent_tensor"] = samples["samples"].contiguous()
+ output["latent_format_version_0"] = torch.tensor([])
+
+ comfy.utils.save_torch_file(output, file, metadata=metadata)
+ return { "ui": { "latents": results } }
+
+
+class LoadLatent:
+ @classmethod
+ def INPUT_TYPES(s):
+ input_dir = folder_paths.get_input_directory()
+ files = [f for f in os.listdir(input_dir) if os.path.isfile(os.path.join(input_dir, f)) and f.endswith(".latent")]
+ return {"required": {"latent": [sorted(files), ]}, }
+
+ CATEGORY = "_for_testing"
+
+ RETURN_TYPES = ("LATENT", )
+ FUNCTION = "load"
+
+ def load(self, latent):
+ latent_path = folder_paths.get_annotated_filepath(latent)
+ latent = safetensors.torch.load_file(latent_path, device="cpu")
+ multiplier = 1.0
+ if "latent_format_version_0" not in latent:
+ multiplier = 1.0 / 0.18215
+ samples = {"samples": latent["latent_tensor"].float() * multiplier}
+ return (samples, )
+
+ @classmethod
+ def IS_CHANGED(s, latent):
+ image_path = folder_paths.get_annotated_filepath(latent)
+ m = hashlib.sha256()
+ with open(image_path, 'rb') as f:
+ m.update(f.read())
+ return m.digest().hex()
+
+ @classmethod
+ def VALIDATE_INPUTS(s, latent):
+ if not folder_paths.exists_annotated_filepath(latent):
+ return "Invalid latent file: {}".format(latent)
+ return True
+
+
+class CheckpointLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "config_name": (folder_paths.get_filename_list("configs"), ),
+ "ckpt_name": (folder_paths.get_filename_list("checkpoints"), )}}
+ RETURN_TYPES = ("MODEL", "CLIP", "VAE")
+ FUNCTION = "load_checkpoint"
+
+ CATEGORY = "advanced/loaders"
+ DEPRECATED = True
+
+ def load_checkpoint(self, config_name, ckpt_name):
+ config_path = folder_paths.get_full_path("configs", config_name)
+ ckpt_path = folder_paths.get_full_path_or_raise("checkpoints", ckpt_name)
+ return comfy.sd.load_checkpoint(config_path, ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
+
+class CheckpointLoaderSimple:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "ckpt_name": (folder_paths.get_filename_list("checkpoints"), {"tooltip": "The name of the checkpoint (model) to load."}),
+ }
+ }
+ RETURN_TYPES = ("MODEL", "CLIP", "VAE")
+ OUTPUT_TOOLTIPS = ("The model used for denoising latents.",
+ "The CLIP model used for encoding text prompts.",
+ "The VAE model used for encoding and decoding images to and from latent space.")
+ FUNCTION = "load_checkpoint"
+
+ CATEGORY = "loaders"
+ DESCRIPTION = "Loads a diffusion model checkpoint, diffusion models are used to denoise latents."
+
+ def load_checkpoint(self, ckpt_name):
+ ckpt_path = folder_paths.get_full_path_or_raise("checkpoints", ckpt_name)
+ out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
+ return out[:3]
+
+class DiffusersLoader:
+ @classmethod
+ def INPUT_TYPES(cls):
+ paths = []
+ for search_path in folder_paths.get_folder_paths("diffusers"):
+ if os.path.exists(search_path):
+ for root, subdir, files in os.walk(search_path, followlinks=True):
+ if "model_index.json" in files:
+ paths.append(os.path.relpath(root, start=search_path))
+
+ return {"required": {"model_path": (paths,), }}
+ RETURN_TYPES = ("MODEL", "CLIP", "VAE")
+ FUNCTION = "load_checkpoint"
+
+ CATEGORY = "advanced/loaders/deprecated"
+
+ def load_checkpoint(self, model_path, output_vae=True, output_clip=True):
+ for search_path in folder_paths.get_folder_paths("diffusers"):
+ if os.path.exists(search_path):
+ path = os.path.join(search_path, model_path)
+ if os.path.exists(path):
+ model_path = path
+ break
+
+ return comfy.diffusers_load.load_diffusers(model_path, output_vae=output_vae, output_clip=output_clip, embedding_directory=folder_paths.get_folder_paths("embeddings"))
+
+
+class unCLIPCheckpointLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "ckpt_name": (folder_paths.get_filename_list("checkpoints"), ),
+ }}
+ RETURN_TYPES = ("MODEL", "CLIP", "VAE", "CLIP_VISION")
+ FUNCTION = "load_checkpoint"
+
+ CATEGORY = "loaders"
+
+ def load_checkpoint(self, ckpt_name, output_vae=True, output_clip=True):
+ ckpt_path = folder_paths.get_full_path_or_raise("checkpoints", ckpt_name)
+ out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, output_clipvision=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
+ return out
+
+class CLIPSetLastLayer:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "clip": ("CLIP", ),
+ "stop_at_clip_layer": ("INT", {"default": -1, "min": -24, "max": -1, "step": 1}),
+ }}
+ RETURN_TYPES = ("CLIP",)
+ FUNCTION = "set_last_layer"
+
+ CATEGORY = "conditioning"
+
+ def set_last_layer(self, clip, stop_at_clip_layer):
+ clip = clip.clone()
+ clip.clip_layer(stop_at_clip_layer)
+ return (clip,)
+
+class LoraLoader:
+ def __init__(self):
+ self.loaded_lora = None
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "model": ("MODEL", {"tooltip": "The diffusion model the LoRA will be applied to."}),
+ "clip": ("CLIP", {"tooltip": "The CLIP model the LoRA will be applied to."}),
+ "lora_name": (folder_paths.get_filename_list("loras"), {"tooltip": "The name of the LoRA."}),
+ "strength_model": ("FLOAT", {"default": 1.0, "min": -100.0, "max": 100.0, "step": 0.01, "tooltip": "How strongly to modify the diffusion model. This value can be negative."}),
+ "strength_clip": ("FLOAT", {"default": 1.0, "min": -100.0, "max": 100.0, "step": 0.01, "tooltip": "How strongly to modify the CLIP model. This value can be negative."}),
+ }
+ }
+
+ RETURN_TYPES = ("MODEL", "CLIP")
+ OUTPUT_TOOLTIPS = ("The modified diffusion model.", "The modified CLIP model.")
+ FUNCTION = "load_lora"
+
+ CATEGORY = "loaders"
+ DESCRIPTION = "LoRAs are used to modify diffusion and CLIP models, altering the way in which latents are denoised such as applying styles. Multiple LoRA nodes can be linked together."
+
+ def load_lora(self, model, clip, lora_name, strength_model, strength_clip):
+ if strength_model == 0 and strength_clip == 0:
+ return (model, clip)
+
+ lora_path = folder_paths.get_full_path_or_raise("loras", lora_name)
+ lora = None
+ if self.loaded_lora is not None:
+ if self.loaded_lora[0] == lora_path:
+ lora = self.loaded_lora[1]
+ else:
+ self.loaded_lora = None
+
+ if lora is None:
+ lora = comfy.utils.load_torch_file(lora_path, safe_load=True)
+ self.loaded_lora = (lora_path, lora)
+
+ model_lora, clip_lora = comfy.sd.load_lora_for_models(model, clip, lora, strength_model, strength_clip)
+ return (model_lora, clip_lora)
+
+class LoraLoaderModelOnly(LoraLoader):
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "model": ("MODEL",),
+ "lora_name": (folder_paths.get_filename_list("loras"), ),
+ "strength_model": ("FLOAT", {"default": 1.0, "min": -100.0, "max": 100.0, "step": 0.01}),
+ }}
+ RETURN_TYPES = ("MODEL",)
+ FUNCTION = "load_lora_model_only"
+
+ def load_lora_model_only(self, model, lora_name, strength_model):
+ return (self.load_lora(model, None, lora_name, strength_model, 0)[0],)
+
+class VAELoader:
+ @staticmethod
+ def vae_list():
+ vaes = folder_paths.get_filename_list("vae")
+ approx_vaes = folder_paths.get_filename_list("vae_approx")
+ sdxl_taesd_enc = False
+ sdxl_taesd_dec = False
+ sd1_taesd_enc = False
+ sd1_taesd_dec = False
+ sd3_taesd_enc = False
+ sd3_taesd_dec = False
+ f1_taesd_enc = False
+ f1_taesd_dec = False
+
+ for v in approx_vaes:
+ if v.startswith("taesd_decoder."):
+ sd1_taesd_dec = True
+ elif v.startswith("taesd_encoder."):
+ sd1_taesd_enc = True
+ elif v.startswith("taesdxl_decoder."):
+ sdxl_taesd_dec = True
+ elif v.startswith("taesdxl_encoder."):
+ sdxl_taesd_enc = True
+ elif v.startswith("taesd3_decoder."):
+ sd3_taesd_dec = True
+ elif v.startswith("taesd3_encoder."):
+ sd3_taesd_enc = True
+ elif v.startswith("taef1_encoder."):
+ f1_taesd_dec = True
+ elif v.startswith("taef1_decoder."):
+ f1_taesd_enc = True
+ if sd1_taesd_dec and sd1_taesd_enc:
+ vaes.append("taesd")
+ if sdxl_taesd_dec and sdxl_taesd_enc:
+ vaes.append("taesdxl")
+ if sd3_taesd_dec and sd3_taesd_enc:
+ vaes.append("taesd3")
+ if f1_taesd_dec and f1_taesd_enc:
+ vaes.append("taef1")
+ vaes.append("pixel_space")
+ return vaes
+
+ @staticmethod
+ def load_taesd(name):
+ sd = {}
+ approx_vaes = folder_paths.get_filename_list("vae_approx")
+
+ encoder = next(filter(lambda a: a.startswith("{}_encoder.".format(name)), approx_vaes))
+ decoder = next(filter(lambda a: a.startswith("{}_decoder.".format(name)), approx_vaes))
+
+ enc = comfy.utils.load_torch_file(folder_paths.get_full_path_or_raise("vae_approx", encoder))
+ for k in enc:
+ sd["taesd_encoder.{}".format(k)] = enc[k]
+
+ dec = comfy.utils.load_torch_file(folder_paths.get_full_path_or_raise("vae_approx", decoder))
+ for k in dec:
+ sd["taesd_decoder.{}".format(k)] = dec[k]
+
+ if name == "taesd":
+ sd["vae_scale"] = torch.tensor(0.18215)
+ sd["vae_shift"] = torch.tensor(0.0)
+ elif name == "taesdxl":
+ sd["vae_scale"] = torch.tensor(0.13025)
+ sd["vae_shift"] = torch.tensor(0.0)
+ elif name == "taesd3":
+ sd["vae_scale"] = torch.tensor(1.5305)
+ sd["vae_shift"] = torch.tensor(0.0609)
+ elif name == "taef1":
+ sd["vae_scale"] = torch.tensor(0.3611)
+ sd["vae_shift"] = torch.tensor(0.1159)
+ return sd
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "vae_name": (s.vae_list(), )}}
+ RETURN_TYPES = ("VAE",)
+ FUNCTION = "load_vae"
+
+ CATEGORY = "loaders"
+
+ #TODO: scale factor?
+ def load_vae(self, vae_name):
+ if vae_name == "pixel_space":
+ sd = {}
+ sd["pixel_space_vae"] = torch.tensor(1.0)
+ elif vae_name in ["taesd", "taesdxl", "taesd3", "taef1"]:
+ sd = self.load_taesd(vae_name)
+ else:
+ vae_path = folder_paths.get_full_path_or_raise("vae", vae_name)
+ sd = comfy.utils.load_torch_file(vae_path)
+ vae = comfy.sd.VAE(sd=sd)
+ vae.throw_exception_if_invalid()
+ return (vae,)
+
+class ControlNetLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "control_net_name": (folder_paths.get_filename_list("controlnet"), )}}
+
+ RETURN_TYPES = ("CONTROL_NET",)
+ FUNCTION = "load_controlnet"
+
+ CATEGORY = "loaders"
+
+ def load_controlnet(self, control_net_name):
+ controlnet_path = folder_paths.get_full_path_or_raise("controlnet", control_net_name)
+ controlnet = comfy.controlnet.load_controlnet(controlnet_path)
+ if controlnet is None:
+ raise RuntimeError("ERROR: controlnet file is invalid and does not contain a valid controlnet model.")
+ return (controlnet,)
+
+class DiffControlNetLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "model": ("MODEL",),
+ "control_net_name": (folder_paths.get_filename_list("controlnet"), )}}
+
+ RETURN_TYPES = ("CONTROL_NET",)
+ FUNCTION = "load_controlnet"
+
+ CATEGORY = "loaders"
+
+ def load_controlnet(self, model, control_net_name):
+ controlnet_path = folder_paths.get_full_path_or_raise("controlnet", control_net_name)
+ controlnet = comfy.controlnet.load_controlnet(controlnet_path, model)
+ return (controlnet,)
+
+
+class ControlNetApply:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "control_net": ("CONTROL_NET", ),
+ "image": ("IMAGE", ),
+ "strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01})
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "apply_controlnet"
+
+ DEPRECATED = True
+ CATEGORY = "conditioning/controlnet"
+
+ def apply_controlnet(self, conditioning, control_net, image, strength):
+ if strength == 0:
+ return (conditioning, )
+
+ c = []
+ control_hint = image.movedim(-1,1)
+ for t in conditioning:
+ n = [t[0], t[1].copy()]
+ c_net = control_net.copy().set_cond_hint(control_hint, strength)
+ if 'control' in t[1]:
+ c_net.set_previous_controlnet(t[1]['control'])
+ n[1]['control'] = c_net
+ n[1]['control_apply_to_uncond'] = True
+ c.append(n)
+ return (c, )
+
+
+class ControlNetApplyAdvanced:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"positive": ("CONDITIONING", ),
+ "negative": ("CONDITIONING", ),
+ "control_net": ("CONTROL_NET", ),
+ "image": ("IMAGE", ),
+ "strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
+ "start_percent": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 1.0, "step": 0.001}),
+ "end_percent": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.001})
+ },
+ "optional": {"vae": ("VAE", ),
+ }
+ }
+
+ RETURN_TYPES = ("CONDITIONING","CONDITIONING")
+ RETURN_NAMES = ("positive", "negative")
+ FUNCTION = "apply_controlnet"
+
+ CATEGORY = "conditioning/controlnet"
+
+ def apply_controlnet(self, positive, negative, control_net, image, strength, start_percent, end_percent, vae=None, extra_concat=[]):
+ if strength == 0:
+ return (positive, negative)
+
+ control_hint = image.movedim(-1,1)
+ cnets = {}
+
+ out = []
+ for conditioning in [positive, negative]:
+ c = []
+ for t in conditioning:
+ d = t[1].copy()
+
+ prev_cnet = d.get('control', None)
+ if prev_cnet in cnets:
+ c_net = cnets[prev_cnet]
+ else:
+ c_net = control_net.copy().set_cond_hint(control_hint, strength, (start_percent, end_percent), vae=vae, extra_concat=extra_concat)
+ c_net.set_previous_controlnet(prev_cnet)
+ cnets[prev_cnet] = c_net
+
+ d['control'] = c_net
+ d['control_apply_to_uncond'] = False
+ n = [t[0], d]
+ c.append(n)
+ out.append(c)
+ return (out[0], out[1])
+
+
+class UNETLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "unet_name": (folder_paths.get_filename_list("diffusion_models"), ),
+ "weight_dtype": (["default", "fp8_e4m3fn", "fp8_e4m3fn_fast", "fp8_e5m2"],)
+ }}
+ RETURN_TYPES = ("MODEL",)
+ FUNCTION = "load_unet"
+
+ CATEGORY = "advanced/loaders"
+
+ def load_unet(self, unet_name, weight_dtype):
+ model_options = {}
+ if weight_dtype == "fp8_e4m3fn":
+ model_options["dtype"] = torch.float8_e4m3fn
+ elif weight_dtype == "fp8_e4m3fn_fast":
+ model_options["dtype"] = torch.float8_e4m3fn
+ model_options["fp8_optimizations"] = True
+ elif weight_dtype == "fp8_e5m2":
+ model_options["dtype"] = torch.float8_e5m2
+
+ unet_path = folder_paths.get_full_path_or_raise("diffusion_models", unet_name)
+ model = comfy.sd.load_diffusion_model(unet_path, model_options=model_options)
+ return (model,)
+
+class CLIPLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "clip_name": (folder_paths.get_filename_list("text_encoders"), ),
+ "type": (["stable_diffusion", "stable_cascade", "sd3", "stable_audio", "mochi", "ltxv", "pixart", "cosmos", "lumina2", "wan", "hidream", "chroma", "ace", "omnigen2", "qwen_image", "hunyuan_image"], ),
+ },
+ "optional": {
+ "device": (["default", "cpu"], {"advanced": True}),
+ }}
+ RETURN_TYPES = ("CLIP",)
+ FUNCTION = "load_clip"
+
+ CATEGORY = "advanced/loaders"
+
+ DESCRIPTION = "[Recipes]\n\nstable_diffusion: clip-l\nstable_cascade: clip-g\nsd3: t5 xxl/ clip-g / clip-l\nstable_audio: t5 base\nmochi: t5 xxl\ncosmos: old t5 xxl\nlumina2: gemma 2 2B\nwan: umt5 xxl\n hidream: llama-3.1 (Recommend) or t5\nomnigen2: qwen vl 2.5 3B"
+
+ def load_clip(self, clip_name, type="stable_diffusion", device="default"):
+ clip_type = getattr(comfy.sd.CLIPType, type.upper(), comfy.sd.CLIPType.STABLE_DIFFUSION)
+
+ model_options = {}
+ if device == "cpu":
+ model_options["load_device"] = model_options["offload_device"] = torch.device("cpu")
+
+ clip_path = folder_paths.get_full_path_or_raise("text_encoders", clip_name)
+ clip = comfy.sd.load_clip(ckpt_paths=[clip_path], embedding_directory=folder_paths.get_folder_paths("embeddings"), clip_type=clip_type, model_options=model_options)
+ return (clip,)
+
+class DualCLIPLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "clip_name1": (folder_paths.get_filename_list("text_encoders"), ),
+ "clip_name2": (folder_paths.get_filename_list("text_encoders"), ),
+ "type": (["sdxl", "sd3", "flux", "hunyuan_video", "hidream", "hunyuan_image"], ),
+ },
+ "optional": {
+ "device": (["default", "cpu"], {"advanced": True}),
+ }}
+ RETURN_TYPES = ("CLIP",)
+ FUNCTION = "load_clip"
+
+ CATEGORY = "advanced/loaders"
+
+ DESCRIPTION = "[Recipes]\n\nsdxl: clip-l, clip-g\nsd3: clip-l, clip-g / clip-l, t5 / clip-g, t5\nflux: clip-l, t5\nhidream: at least one of t5 or llama, recommended t5 and llama\nhunyuan_image: qwen2.5vl 7b and byt5 small"
+
+ def load_clip(self, clip_name1, clip_name2, type, device="default"):
+ clip_type = getattr(comfy.sd.CLIPType, type.upper(), comfy.sd.CLIPType.STABLE_DIFFUSION)
+
+ clip_path1 = folder_paths.get_full_path_or_raise("text_encoders", clip_name1)
+ clip_path2 = folder_paths.get_full_path_or_raise("text_encoders", clip_name2)
+
+ model_options = {}
+ if device == "cpu":
+ model_options["load_device"] = model_options["offload_device"] = torch.device("cpu")
+
+ clip = comfy.sd.load_clip(ckpt_paths=[clip_path1, clip_path2], embedding_directory=folder_paths.get_folder_paths("embeddings"), clip_type=clip_type, model_options=model_options)
+ return (clip,)
+
+class CLIPVisionLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "clip_name": (folder_paths.get_filename_list("clip_vision"), ),
+ }}
+ RETURN_TYPES = ("CLIP_VISION",)
+ FUNCTION = "load_clip"
+
+ CATEGORY = "loaders"
+
+ def load_clip(self, clip_name):
+ clip_path = folder_paths.get_full_path_or_raise("clip_vision", clip_name)
+ clip_vision = comfy.clip_vision.load(clip_path)
+ if clip_vision is None:
+ raise RuntimeError("ERROR: clip vision file is invalid and does not contain a valid vision model.")
+ return (clip_vision,)
+
+class CLIPVisionEncode:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "clip_vision": ("CLIP_VISION",),
+ "image": ("IMAGE",),
+ "crop": (["center", "none"],)
+ }}
+ RETURN_TYPES = ("CLIP_VISION_OUTPUT",)
+ FUNCTION = "encode"
+
+ CATEGORY = "conditioning"
+
+ def encode(self, clip_vision, image, crop):
+ crop_image = True
+ if crop != "center":
+ crop_image = False
+ output = clip_vision.encode_image(image, crop=crop_image)
+ return (output,)
+
+class StyleModelLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "style_model_name": (folder_paths.get_filename_list("style_models"), )}}
+
+ RETURN_TYPES = ("STYLE_MODEL",)
+ FUNCTION = "load_style_model"
+
+ CATEGORY = "loaders"
+
+ def load_style_model(self, style_model_name):
+ style_model_path = folder_paths.get_full_path_or_raise("style_models", style_model_name)
+ style_model = comfy.sd.load_style_model(style_model_path)
+ return (style_model,)
+
+
+class StyleModelApply:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "style_model": ("STYLE_MODEL", ),
+ "clip_vision_output": ("CLIP_VISION_OUTPUT", ),
+ "strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.001}),
+ "strength_type": (["multiply", "attn_bias"], ),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "apply_stylemodel"
+
+ CATEGORY = "conditioning/style_model"
+
+ def apply_stylemodel(self, conditioning, style_model, clip_vision_output, strength, strength_type):
+ cond = style_model.get_cond(clip_vision_output).flatten(start_dim=0, end_dim=1).unsqueeze(dim=0)
+ if strength_type == "multiply":
+ cond *= strength
+
+ n = cond.shape[1]
+ c_out = []
+ for t in conditioning:
+ (txt, keys) = t
+ keys = keys.copy()
+ # even if the strength is 1.0 (i.e, no change), if there's already a mask, we have to add to it
+ if "attention_mask" in keys or (strength_type == "attn_bias" and strength != 1.0):
+ # math.log raises an error if the argument is zero
+ # torch.log returns -inf, which is what we want
+ attn_bias = torch.log(torch.Tensor([strength if strength_type == "attn_bias" else 1.0]))
+ # get the size of the mask image
+ mask_ref_size = keys.get("attention_mask_img_shape", (1, 1))
+ n_ref = mask_ref_size[0] * mask_ref_size[1]
+ n_txt = txt.shape[1]
+ # grab the existing mask
+ mask = keys.get("attention_mask", None)
+ # create a default mask if it doesn't exist
+ if mask is None:
+ mask = torch.zeros((txt.shape[0], n_txt + n_ref, n_txt + n_ref), dtype=torch.float16)
+ # convert the mask dtype, because it might be boolean
+ # we want it to be interpreted as a bias
+ if mask.dtype == torch.bool:
+ # log(True) = log(1) = 0
+ # log(False) = log(0) = -inf
+ mask = torch.log(mask.to(dtype=torch.float16))
+ # now we make the mask bigger to add space for our new tokens
+ new_mask = torch.zeros((txt.shape[0], n_txt + n + n_ref, n_txt + n + n_ref), dtype=torch.float16)
+ # copy over the old mask, in quandrants
+ new_mask[:, :n_txt, :n_txt] = mask[:, :n_txt, :n_txt]
+ new_mask[:, :n_txt, n_txt+n:] = mask[:, :n_txt, n_txt:]
+ new_mask[:, n_txt+n:, :n_txt] = mask[:, n_txt:, :n_txt]
+ new_mask[:, n_txt+n:, n_txt+n:] = mask[:, n_txt:, n_txt:]
+ # now fill in the attention bias to our redux tokens
+ new_mask[:, :n_txt, n_txt:n_txt+n] = attn_bias
+ new_mask[:, n_txt+n:, n_txt:n_txt+n] = attn_bias
+ keys["attention_mask"] = new_mask.to(txt.device)
+ keys["attention_mask_img_shape"] = mask_ref_size
+
+ c_out.append([torch.cat((txt, cond), dim=1), keys])
+
+ return (c_out,)
+
+class unCLIPConditioning:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "clip_vision_output": ("CLIP_VISION_OUTPUT", ),
+ "strength": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
+ "noise_augmentation": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 1.0, "step": 0.01}),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "apply_adm"
+
+ CATEGORY = "conditioning"
+
+ def apply_adm(self, conditioning, clip_vision_output, strength, noise_augmentation):
+ if strength == 0:
+ return (conditioning, )
+
+ c = node_helpers.conditioning_set_values(conditioning, {"unclip_conditioning": [{"clip_vision_output": clip_vision_output, "strength": strength, "noise_augmentation": noise_augmentation}]}, append=True)
+ return (c, )
+
+class GLIGENLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "gligen_name": (folder_paths.get_filename_list("gligen"), )}}
+
+ RETURN_TYPES = ("GLIGEN",)
+ FUNCTION = "load_gligen"
+
+ CATEGORY = "loaders"
+
+ def load_gligen(self, gligen_name):
+ gligen_path = folder_paths.get_full_path_or_raise("gligen", gligen_name)
+ gligen = comfy.sd.load_gligen(gligen_path)
+ return (gligen,)
+
+class GLIGENTextBoxApply:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning_to": ("CONDITIONING", ),
+ "clip": ("CLIP", ),
+ "gligen_textbox_model": ("GLIGEN", ),
+ "text": ("STRING", {"multiline": True, "dynamicPrompts": True}),
+ "width": ("INT", {"default": 64, "min": 8, "max": MAX_RESOLUTION, "step": 8}),
+ "height": ("INT", {"default": 64, "min": 8, "max": MAX_RESOLUTION, "step": 8}),
+ "x": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "y": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "append"
+
+ CATEGORY = "conditioning/gligen"
+
+ def append(self, conditioning_to, clip, gligen_textbox_model, text, width, height, x, y):
+ c = []
+ cond, cond_pooled = clip.encode_from_tokens(clip.tokenize(text), return_pooled="unprojected")
+ for t in conditioning_to:
+ n = [t[0], t[1].copy()]
+ position_params = [(cond_pooled, height // 8, width // 8, y // 8, x // 8)]
+ prev = []
+ if "gligen" in n[1]:
+ prev = n[1]['gligen'][2]
+
+ n[1]['gligen'] = ("position", gligen_textbox_model, prev + position_params)
+ c.append(n)
+ return (c, )
+
+class EmptyLatentImage:
+ def __init__(self):
+ self.device = comfy.model_management.intermediate_device()
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "width": ("INT", {"default": 512, "min": 16, "max": MAX_RESOLUTION, "step": 8, "tooltip": "The width of the latent images in pixels."}),
+ "height": ("INT", {"default": 512, "min": 16, "max": MAX_RESOLUTION, "step": 8, "tooltip": "The height of the latent images in pixels."}),
+ "batch_size": ("INT", {"default": 1, "min": 1, "max": 4096, "tooltip": "The number of latent images in the batch."})
+ }
+ }
+ RETURN_TYPES = ("LATENT",)
+ OUTPUT_TOOLTIPS = ("The empty latent image batch.",)
+ FUNCTION = "generate"
+
+ CATEGORY = "latent"
+ DESCRIPTION = "Create a new batch of empty latent images to be denoised via sampling."
+
+ def generate(self, width, height, batch_size=1):
+ latent = torch.zeros([batch_size, 4, height // 8, width // 8], device=self.device)
+ return ({"samples":latent}, )
+
+
+class LatentFromBatch:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT",),
+ "batch_index": ("INT", {"default": 0, "min": 0, "max": 63}),
+ "length": ("INT", {"default": 1, "min": 1, "max": 64}),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "frombatch"
+
+ CATEGORY = "latent/batch"
+
+ def frombatch(self, samples, batch_index, length):
+ s = samples.copy()
+ s_in = samples["samples"]
+ batch_index = min(s_in.shape[0] - 1, batch_index)
+ length = min(s_in.shape[0] - batch_index, length)
+ s["samples"] = s_in[batch_index:batch_index + length].clone()
+ if "noise_mask" in samples:
+ masks = samples["noise_mask"]
+ if masks.shape[0] == 1:
+ s["noise_mask"] = masks.clone()
+ else:
+ if masks.shape[0] < s_in.shape[0]:
+ masks = masks.repeat(math.ceil(s_in.shape[0] / masks.shape[0]), 1, 1, 1)[:s_in.shape[0]]
+ s["noise_mask"] = masks[batch_index:batch_index + length].clone()
+ if "batch_index" not in s:
+ s["batch_index"] = [x for x in range(batch_index, batch_index+length)]
+ else:
+ s["batch_index"] = samples["batch_index"][batch_index:batch_index + length]
+ return (s,)
+
+class RepeatLatentBatch:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT",),
+ "amount": ("INT", {"default": 1, "min": 1, "max": 64}),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "repeat"
+
+ CATEGORY = "latent/batch"
+
+ def repeat(self, samples, amount):
+ s = samples.copy()
+ s_in = samples["samples"]
+
+ s["samples"] = s_in.repeat((amount,) + ((1,) * (s_in.ndim - 1)))
+ if "noise_mask" in samples and samples["noise_mask"].shape[0] > 1:
+ masks = samples["noise_mask"]
+ if masks.shape[0] < s_in.shape[0]:
+ masks = masks.repeat((math.ceil(s_in.shape[0] / masks.shape[0]),) + ((1,) * (masks.ndim - 1)))[:s_in.shape[0]]
+ s["noise_mask"] = samples["noise_mask"].repeat((amount,) + ((1,) * (samples["noise_mask"].ndim - 1)))
+ if "batch_index" in s:
+ offset = max(s["batch_index"]) - min(s["batch_index"]) + 1
+ s["batch_index"] = s["batch_index"] + [x + (i * offset) for i in range(1, amount) for x in s["batch_index"]]
+ return (s,)
+
+class LatentUpscale:
+ upscale_methods = ["nearest-exact", "bilinear", "area", "bicubic", "bislerp"]
+ crop_methods = ["disabled", "center"]
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT",), "upscale_method": (s.upscale_methods,),
+ "width": ("INT", {"default": 512, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "height": ("INT", {"default": 512, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "crop": (s.crop_methods,)}}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "upscale"
+
+ CATEGORY = "latent"
+
+ def upscale(self, samples, upscale_method, width, height, crop):
+ if width == 0 and height == 0:
+ s = samples
+ else:
+ s = samples.copy()
+
+ if width == 0:
+ height = max(64, height)
+ width = max(64, round(samples["samples"].shape[-1] * height / samples["samples"].shape[-2]))
+ elif height == 0:
+ width = max(64, width)
+ height = max(64, round(samples["samples"].shape[-2] * width / samples["samples"].shape[-1]))
+ else:
+ width = max(64, width)
+ height = max(64, height)
+
+ s["samples"] = comfy.utils.common_upscale(samples["samples"], width // 8, height // 8, upscale_method, crop)
+ return (s,)
+
+class LatentUpscaleBy:
+ upscale_methods = ["nearest-exact", "bilinear", "area", "bicubic", "bislerp"]
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT",), "upscale_method": (s.upscale_methods,),
+ "scale_by": ("FLOAT", {"default": 1.5, "min": 0.01, "max": 8.0, "step": 0.01}),}}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "upscale"
+
+ CATEGORY = "latent"
+
+ def upscale(self, samples, upscale_method, scale_by):
+ s = samples.copy()
+ width = round(samples["samples"].shape[-1] * scale_by)
+ height = round(samples["samples"].shape[-2] * scale_by)
+ s["samples"] = comfy.utils.common_upscale(samples["samples"], width, height, upscale_method, "disabled")
+ return (s,)
+
+class LatentRotate:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT",),
+ "rotation": (["none", "90 degrees", "180 degrees", "270 degrees"],),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "rotate"
+
+ CATEGORY = "latent/transform"
+
+ def rotate(self, samples, rotation):
+ s = samples.copy()
+ rotate_by = 0
+ if rotation.startswith("90"):
+ rotate_by = 1
+ elif rotation.startswith("180"):
+ rotate_by = 2
+ elif rotation.startswith("270"):
+ rotate_by = 3
+
+ s["samples"] = torch.rot90(samples["samples"], k=rotate_by, dims=[3, 2])
+ return (s,)
+
+class LatentFlip:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT",),
+ "flip_method": (["x-axis: vertically", "y-axis: horizontally"],),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "flip"
+
+ CATEGORY = "latent/transform"
+
+ def flip(self, samples, flip_method):
+ s = samples.copy()
+ if flip_method.startswith("x"):
+ s["samples"] = torch.flip(samples["samples"], dims=[2])
+ elif flip_method.startswith("y"):
+ s["samples"] = torch.flip(samples["samples"], dims=[3])
+
+ return (s,)
+
+class LatentComposite:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples_to": ("LATENT",),
+ "samples_from": ("LATENT",),
+ "x": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "y": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "feather": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "composite"
+
+ CATEGORY = "latent"
+
+ def composite(self, samples_to, samples_from, x, y, composite_method="normal", feather=0):
+ x = x // 8
+ y = y // 8
+ feather = feather // 8
+ samples_out = samples_to.copy()
+ s = samples_to["samples"].clone()
+ samples_to = samples_to["samples"]
+ samples_from = samples_from["samples"]
+ if feather == 0:
+ s[:,:,y:y+samples_from.shape[2],x:x+samples_from.shape[3]] = samples_from[:,:,:samples_to.shape[2] - y, :samples_to.shape[3] - x]
+ else:
+ samples_from = samples_from[:,:,:samples_to.shape[2] - y, :samples_to.shape[3] - x]
+ mask = torch.ones_like(samples_from)
+ for t in range(feather):
+ if y != 0:
+ mask[:,:,t:1+t,:] *= ((1.0/feather) * (t + 1))
+
+ if y + samples_from.shape[2] < samples_to.shape[2]:
+ mask[:,:,mask.shape[2] -1 -t: mask.shape[2]-t,:] *= ((1.0/feather) * (t + 1))
+ if x != 0:
+ mask[:,:,:,t:1+t] *= ((1.0/feather) * (t + 1))
+ if x + samples_from.shape[3] < samples_to.shape[3]:
+ mask[:,:,:,mask.shape[3]- 1 - t: mask.shape[3]- t] *= ((1.0/feather) * (t + 1))
+ rev_mask = torch.ones_like(mask) - mask
+ s[:,:,y:y+samples_from.shape[2],x:x+samples_from.shape[3]] = samples_from[:,:,:samples_to.shape[2] - y, :samples_to.shape[3] - x] * mask + s[:,:,y:y+samples_from.shape[2],x:x+samples_from.shape[3]] * rev_mask
+ samples_out["samples"] = s
+ return (samples_out,)
+
+class LatentBlend:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {
+ "samples1": ("LATENT",),
+ "samples2": ("LATENT",),
+ "blend_factor": ("FLOAT", {
+ "default": 0.5,
+ "min": 0,
+ "max": 1,
+ "step": 0.01
+ }),
+ }}
+
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "blend"
+
+ CATEGORY = "_for_testing"
+
+ def blend(self, samples1, samples2, blend_factor:float, blend_mode: str="normal"):
+
+ samples_out = samples1.copy()
+ samples1 = samples1["samples"]
+ samples2 = samples2["samples"]
+
+ if samples1.shape != samples2.shape:
+ samples2.permute(0, 3, 1, 2)
+ samples2 = comfy.utils.common_upscale(samples2, samples1.shape[3], samples1.shape[2], 'bicubic', crop='center')
+ samples2.permute(0, 2, 3, 1)
+
+ samples_blended = self.blend_mode(samples1, samples2, blend_mode)
+ samples_blended = samples1 * blend_factor + samples_blended * (1 - blend_factor)
+ samples_out["samples"] = samples_blended
+ return (samples_out,)
+
+ def blend_mode(self, img1, img2, mode):
+ if mode == "normal":
+ return img2
+ else:
+ raise ValueError(f"Unsupported blend mode: {mode}")
+
+class LatentCrop:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT",),
+ "width": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
+ "height": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
+ "x": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "y": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "crop"
+
+ CATEGORY = "latent/transform"
+
+ def crop(self, samples, width, height, x, y):
+ s = samples.copy()
+ samples = samples['samples']
+ x = x // 8
+ y = y // 8
+
+ #enfonce minimum size of 64
+ if x > (samples.shape[3] - 8):
+ x = samples.shape[3] - 8
+ if y > (samples.shape[2] - 8):
+ y = samples.shape[2] - 8
+
+ new_height = height // 8
+ new_width = width // 8
+ to_x = new_width + x
+ to_y = new_height + y
+ s['samples'] = samples[:,:,y:to_y, x:to_x]
+ return (s,)
+
+class SetLatentNoiseMask:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT",),
+ "mask": ("MASK",),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "set_mask"
+
+ CATEGORY = "latent/inpaint"
+
+ def set_mask(self, samples, mask):
+ s = samples.copy()
+ s["noise_mask"] = mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1]))
+ return (s,)
+
+def common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent, denoise=1.0, disable_noise=False, start_step=None, last_step=None, force_full_denoise=False):
+ latent_image = latent["samples"]
+ latent_image = comfy.sample.fix_empty_latent_channels(model, latent_image)
+
+ if disable_noise:
+ noise = torch.zeros(latent_image.size(), dtype=latent_image.dtype, layout=latent_image.layout, device="cpu")
+ else:
+ batch_inds = latent["batch_index"] if "batch_index" in latent else None
+ noise = comfy.sample.prepare_noise(latent_image, seed, batch_inds)
+
+ noise_mask = None
+ if "noise_mask" in latent:
+ noise_mask = latent["noise_mask"]
+
+ callback = latent_preview.prepare_callback(model, steps)
+ disable_pbar = not comfy.utils.PROGRESS_BAR_ENABLED
+ samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
+ denoise=denoise, disable_noise=disable_noise, start_step=start_step, last_step=last_step,
+ force_full_denoise=force_full_denoise, noise_mask=noise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
+ out = latent.copy()
+ out["samples"] = samples
+ return (out, )
+
+class KSampler:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "model": ("MODEL", {"tooltip": "The model used for denoising the input latent."}),
+ "seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff, "control_after_generate": True, "tooltip": "The random seed used for creating the noise."}),
+ "steps": ("INT", {"default": 20, "min": 1, "max": 10000, "tooltip": "The number of steps used in the denoising process."}),
+ "cfg": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0, "step":0.1, "round": 0.01, "tooltip": "The Classifier-Free Guidance scale balances creativity and adherence to the prompt. Higher values result in images more closely matching the prompt however too high values will negatively impact quality."}),
+ "sampler_name": (comfy.samplers.KSampler.SAMPLERS, {"tooltip": "The algorithm used when sampling, this can affect the quality, speed, and style of the generated output."}),
+ "scheduler": (comfy.samplers.KSampler.SCHEDULERS, {"tooltip": "The scheduler controls how noise is gradually removed to form the image."}),
+ "positive": ("CONDITIONING", {"tooltip": "The conditioning describing the attributes you want to include in the image."}),
+ "negative": ("CONDITIONING", {"tooltip": "The conditioning describing the attributes you want to exclude from the image."}),
+ "latent_image": ("LATENT", {"tooltip": "The latent image to denoise."}),
+ "denoise": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01, "tooltip": "The amount of denoising applied, lower values will maintain the structure of the initial image allowing for image to image sampling."}),
+ }
+ }
+
+ RETURN_TYPES = ("LATENT",)
+ OUTPUT_TOOLTIPS = ("The denoised latent.",)
+ FUNCTION = "sample"
+
+ CATEGORY = "sampling"
+ DESCRIPTION = "Uses the provided model, positive and negative conditioning to denoise the latent image."
+
+ def sample(self, model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=1.0):
+ return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
+
+class KSamplerAdvanced:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required":
+ {"model": ("MODEL",),
+ "add_noise": (["enable", "disable"], ),
+ "noise_seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff, "control_after_generate": True}),
+ "steps": ("INT", {"default": 20, "min": 1, "max": 10000}),
+ "cfg": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0, "step":0.1, "round": 0.01}),
+ "sampler_name": (comfy.samplers.KSampler.SAMPLERS, ),
+ "scheduler": (comfy.samplers.KSampler.SCHEDULERS, ),
+ "positive": ("CONDITIONING", ),
+ "negative": ("CONDITIONING", ),
+ "latent_image": ("LATENT", ),
+ "start_at_step": ("INT", {"default": 0, "min": 0, "max": 10000}),
+ "end_at_step": ("INT", {"default": 10000, "min": 0, "max": 10000}),
+ "return_with_leftover_noise": (["disable", "enable"], ),
+ }
+ }
+
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "sample"
+
+ CATEGORY = "sampling"
+
+ def sample(self, model, add_noise, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, start_at_step, end_at_step, return_with_leftover_noise, denoise=1.0):
+ force_full_denoise = True
+ if return_with_leftover_noise == "enable":
+ force_full_denoise = False
+ disable_noise = False
+ if add_noise == "disable":
+ disable_noise = True
+ return common_ksampler(model, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise, disable_noise=disable_noise, start_step=start_at_step, last_step=end_at_step, force_full_denoise=force_full_denoise)
+
+class SaveImage:
+ def __init__(self):
+ self.output_dir = folder_paths.get_output_directory()
+ self.type = "output"
+ self.prefix_append = ""
+ self.compress_level = 4
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "images": ("IMAGE", {"tooltip": "The images to save."}),
+ "filename_prefix": ("STRING", {"default": "ComfyUI", "tooltip": "The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes."})
+ },
+ "hidden": {
+ "prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"
+ },
+ }
+
+ RETURN_TYPES = ()
+ FUNCTION = "save_images"
+
+ OUTPUT_NODE = True
+
+ CATEGORY = "image"
+ DESCRIPTION = "Saves the input images to your ComfyUI output directory."
+
+ def save_images(self, images, filename_prefix="ComfyUI", prompt=None, extra_pnginfo=None):
+ filename_prefix += self.prefix_append
+ full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(filename_prefix, self.output_dir, images[0].shape[1], images[0].shape[0])
+ results = list()
+ for (batch_number, image) in enumerate(images):
+ i = 255. * image.cpu().numpy()
+ img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
+ metadata = None
+ if not args.disable_metadata:
+ metadata = PngInfo()
+ if prompt is not None:
+ metadata.add_text("prompt", json.dumps(prompt))
+ if extra_pnginfo is not None:
+ for x in extra_pnginfo:
+ metadata.add_text(x, json.dumps(extra_pnginfo[x]))
+
+ filename_with_batch_num = filename.replace("%batch_num%", str(batch_number))
+ file = f"{filename_with_batch_num}_{counter:05}_.png"
+ img.save(os.path.join(full_output_folder, file), pnginfo=metadata, compress_level=self.compress_level)
+ results.append({
+ "filename": file,
+ "subfolder": subfolder,
+ "type": self.type
+ })
+ counter += 1
+
+ return { "ui": { "images": results } }
+
+class PreviewImage(SaveImage):
+ def __init__(self):
+ self.output_dir = folder_paths.get_temp_directory()
+ self.type = "temp"
+ self.prefix_append = "_temp_" + ''.join(random.choice("abcdefghijklmnopqrstupvxyz") for x in range(5))
+ self.compress_level = 1
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required":
+ {"images": ("IMAGE", ), },
+ "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
+ }
+
+class LoadImage:
+ @classmethod
+ def INPUT_TYPES(s):
+ input_dir = folder_paths.get_input_directory()
+ files = [f for f in os.listdir(input_dir) if os.path.isfile(os.path.join(input_dir, f))]
+ files = folder_paths.filter_files_content_types(files, ["image"])
+ return {"required":
+ {"image": (sorted(files), {"image_upload": True})},
+ }
+
+ CATEGORY = "image"
+
+ RETURN_TYPES = ("IMAGE", "MASK")
+ FUNCTION = "load_image"
+ def load_image(self, image):
+ image_path = folder_paths.get_annotated_filepath(image)
+
+ img = node_helpers.pillow(Image.open, image_path)
+
+ output_images = []
+ output_masks = []
+ w, h = None, None
+
+ excluded_formats = ['MPO']
+
+ for i in ImageSequence.Iterator(img):
+ i = node_helpers.pillow(ImageOps.exif_transpose, i)
+
+ if i.mode == 'I':
+ i = i.point(lambda i: i * (1 / 255))
+ image = i.convert("RGB")
+
+ if len(output_images) == 0:
+ w = image.size[0]
+ h = image.size[1]
+
+ if image.size[0] != w or image.size[1] != h:
+ continue
+
+ image = np.array(image).astype(np.float32) / 255.0
+ image = torch.from_numpy(image)[None,]
+ if 'A' in i.getbands():
+ mask = np.array(i.getchannel('A')).astype(np.float32) / 255.0
+ mask = 1. - torch.from_numpy(mask)
+ elif i.mode == 'P' and 'transparency' in i.info:
+ mask = np.array(i.convert('RGBA').getchannel('A')).astype(np.float32) / 255.0
+ mask = 1. - torch.from_numpy(mask)
+ else:
+ mask = torch.zeros((64,64), dtype=torch.float32, device="cpu")
+ output_images.append(image)
+ output_masks.append(mask.unsqueeze(0))
+
+ if len(output_images) > 1 and img.format not in excluded_formats:
+ output_image = torch.cat(output_images, dim=0)
+ output_mask = torch.cat(output_masks, dim=0)
+ else:
+ output_image = output_images[0]
+ output_mask = output_masks[0]
+
+ return (output_image, output_mask)
+
+ @classmethod
+ def IS_CHANGED(s, image):
+ image_path = folder_paths.get_annotated_filepath(image)
+ m = hashlib.sha256()
+ with open(image_path, 'rb') as f:
+ m.update(f.read())
+ return m.digest().hex()
+
+ @classmethod
+ def VALIDATE_INPUTS(s, image):
+ if not folder_paths.exists_annotated_filepath(image):
+ return "Invalid image file: {}".format(image)
+
+ return True
+
+class LoadImageMask:
+ _color_channels = ["alpha", "red", "green", "blue"]
+ @classmethod
+ def INPUT_TYPES(s):
+ input_dir = folder_paths.get_input_directory()
+ files = [f for f in os.listdir(input_dir) if os.path.isfile(os.path.join(input_dir, f))]
+ return {"required":
+ {"image": (sorted(files), {"image_upload": True}),
+ "channel": (s._color_channels, ), }
+ }
+
+ CATEGORY = "mask"
+
+ RETURN_TYPES = ("MASK",)
+ FUNCTION = "load_image"
+ def load_image(self, image, channel):
+ image_path = folder_paths.get_annotated_filepath(image)
+ i = node_helpers.pillow(Image.open, image_path)
+ i = node_helpers.pillow(ImageOps.exif_transpose, i)
+ if i.getbands() != ("R", "G", "B", "A"):
+ if i.mode == 'I':
+ i = i.point(lambda i: i * (1 / 255))
+ i = i.convert("RGBA")
+ mask = None
+ c = channel[0].upper()
+ if c in i.getbands():
+ mask = np.array(i.getchannel(c)).astype(np.float32) / 255.0
+ mask = torch.from_numpy(mask)
+ if c == 'A':
+ mask = 1. - mask
+ else:
+ mask = torch.zeros((64,64), dtype=torch.float32, device="cpu")
+ return (mask.unsqueeze(0),)
+
+ @classmethod
+ def IS_CHANGED(s, image, channel):
+ image_path = folder_paths.get_annotated_filepath(image)
+ m = hashlib.sha256()
+ with open(image_path, 'rb') as f:
+ m.update(f.read())
+ return m.digest().hex()
+
+ @classmethod
+ def VALIDATE_INPUTS(s, image):
+ if not folder_paths.exists_annotated_filepath(image):
+ return "Invalid image file: {}".format(image)
+
+ return True
+
+
+class LoadImageOutput(LoadImage):
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "image": ("COMBO", {
+ "image_upload": True,
+ "image_folder": "output",
+ "remote": {
+ "route": "/internal/files/output",
+ "refresh_button": True,
+ "control_after_refresh": "first",
+ },
+ }),
+ }
+ }
+
+ DESCRIPTION = "Load an image from the output folder. When the refresh button is clicked, the node will update the image list and automatically select the first image, allowing for easy iteration."
+ EXPERIMENTAL = True
+ FUNCTION = "load_image"
+
+
+class ImageScale:
+ upscale_methods = ["nearest-exact", "bilinear", "area", "bicubic", "lanczos"]
+ crop_methods = ["disabled", "center"]
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "image": ("IMAGE",), "upscale_method": (s.upscale_methods,),
+ "width": ("INT", {"default": 512, "min": 0, "max": MAX_RESOLUTION, "step": 1}),
+ "height": ("INT", {"default": 512, "min": 0, "max": MAX_RESOLUTION, "step": 1}),
+ "crop": (s.crop_methods,)}}
+ RETURN_TYPES = ("IMAGE",)
+ FUNCTION = "upscale"
+
+ CATEGORY = "image/upscaling"
+
+ def upscale(self, image, upscale_method, width, height, crop):
+ if width == 0 and height == 0:
+ s = image
+ else:
+ samples = image.movedim(-1,1)
+
+ if width == 0:
+ width = max(1, round(samples.shape[3] * height / samples.shape[2]))
+ elif height == 0:
+ height = max(1, round(samples.shape[2] * width / samples.shape[3]))
+
+ s = comfy.utils.common_upscale(samples, width, height, upscale_method, crop)
+ s = s.movedim(1,-1)
+ return (s,)
+
+class ImageScaleBy:
+ upscale_methods = ["nearest-exact", "bilinear", "area", "bicubic", "lanczos"]
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "image": ("IMAGE",), "upscale_method": (s.upscale_methods,),
+ "scale_by": ("FLOAT", {"default": 1.0, "min": 0.01, "max": 8.0, "step": 0.01}),}}
+ RETURN_TYPES = ("IMAGE",)
+ FUNCTION = "upscale"
+
+ CATEGORY = "image/upscaling"
+
+ def upscale(self, image, upscale_method, scale_by):
+ samples = image.movedim(-1,1)
+ width = round(samples.shape[3] * scale_by)
+ height = round(samples.shape[2] * scale_by)
+ s = comfy.utils.common_upscale(samples, width, height, upscale_method, "disabled")
+ s = s.movedim(1,-1)
+ return (s,)
+
+class ImageInvert:
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "image": ("IMAGE",)}}
+
+ RETURN_TYPES = ("IMAGE",)
+ FUNCTION = "invert"
+
+ CATEGORY = "image"
+
+ def invert(self, image):
+ s = 1.0 - image
+ return (s,)
+
+class ImageBatch:
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "image1": ("IMAGE",), "image2": ("IMAGE",)}}
+
+ RETURN_TYPES = ("IMAGE",)
+ FUNCTION = "batch"
+
+ CATEGORY = "image"
+
+ def batch(self, image1, image2):
+ if image1.shape[1:] != image2.shape[1:]:
+ image2 = comfy.utils.common_upscale(image2.movedim(-1,1), image1.shape[2], image1.shape[1], "bilinear", "center").movedim(1,-1)
+ s = torch.cat((image1, image2), dim=0)
+ return (s,)
+
+class EmptyImage:
+ def __init__(self, device="cpu"):
+ self.device = device
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "width": ("INT", {"default": 512, "min": 1, "max": MAX_RESOLUTION, "step": 1}),
+ "height": ("INT", {"default": 512, "min": 1, "max": MAX_RESOLUTION, "step": 1}),
+ "batch_size": ("INT", {"default": 1, "min": 1, "max": 4096}),
+ "color": ("INT", {"default": 0, "min": 0, "max": 0xFFFFFF, "step": 1, "display": "color"}),
+ }}
+ RETURN_TYPES = ("IMAGE",)
+ FUNCTION = "generate"
+
+ CATEGORY = "image"
+
+ def generate(self, width, height, batch_size=1, color=0):
+ r = torch.full([batch_size, height, width, 1], ((color >> 16) & 0xFF) / 0xFF)
+ g = torch.full([batch_size, height, width, 1], ((color >> 8) & 0xFF) / 0xFF)
+ b = torch.full([batch_size, height, width, 1], ((color) & 0xFF) / 0xFF)
+ return (torch.cat((r, g, b), dim=-1), )
+
+class ImagePadForOutpaint:
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "image": ("IMAGE",),
+ "left": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "top": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "right": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "bottom": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "feathering": ("INT", {"default": 40, "min": 0, "max": MAX_RESOLUTION, "step": 1}),
+ }
+ }
+
+ RETURN_TYPES = ("IMAGE", "MASK")
+ FUNCTION = "expand_image"
+
+ CATEGORY = "image"
+
+ def expand_image(self, image, left, top, right, bottom, feathering):
+ d1, d2, d3, d4 = image.size()
+
+ new_image = torch.ones(
+ (d1, d2 + top + bottom, d3 + left + right, d4),
+ dtype=torch.float32,
+ ) * 0.5
+
+ new_image[:, top:top + d2, left:left + d3, :] = image
+
+ mask = torch.ones(
+ (d2 + top + bottom, d3 + left + right),
+ dtype=torch.float32,
+ )
+
+ t = torch.zeros(
+ (d2, d3),
+ dtype=torch.float32
+ )
+
+ if feathering > 0 and feathering * 2 < d2 and feathering * 2 < d3:
+
+ for i in range(d2):
+ for j in range(d3):
+ dt = i if top != 0 else d2
+ db = d2 - i if bottom != 0 else d2
+
+ dl = j if left != 0 else d3
+ dr = d3 - j if right != 0 else d3
+
+ d = min(dt, db, dl, dr)
+
+ if d >= feathering:
+ continue
+
+ v = (feathering - d) / feathering
+
+ t[i, j] = v * v
+
+ mask[top:top + d2, left:left + d3] = t
+
+ return (new_image, mask.unsqueeze(0))
+
+
+NODE_CLASS_MAPPINGS = {
+ "KSampler": KSampler,
+ "CheckpointLoaderSimple": CheckpointLoaderSimple,
+ "CLIPTextEncode": CLIPTextEncode,
+ "CLIPSetLastLayer": CLIPSetLastLayer,
+ "VAEDecode": VAEDecode,
+ "VAEEncode": VAEEncode,
+ "VAEEncodeForInpaint": VAEEncodeForInpaint,
+ "VAELoader": VAELoader,
+ "EmptyLatentImage": EmptyLatentImage,
+ "LatentUpscale": LatentUpscale,
+ "LatentUpscaleBy": LatentUpscaleBy,
+ "LatentFromBatch": LatentFromBatch,
+ "RepeatLatentBatch": RepeatLatentBatch,
+ "SaveImage": SaveImage,
+ "PreviewImage": PreviewImage,
+ "LoadImage": LoadImage,
+ "LoadImageMask": LoadImageMask,
+ "LoadImageOutput": LoadImageOutput,
+ "ImageScale": ImageScale,
+ "ImageScaleBy": ImageScaleBy,
+ "ImageInvert": ImageInvert,
+ "ImageBatch": ImageBatch,
+ "ImagePadForOutpaint": ImagePadForOutpaint,
+ "EmptyImage": EmptyImage,
+ "ConditioningAverage": ConditioningAverage ,
+ "ConditioningCombine": ConditioningCombine,
+ "ConditioningConcat": ConditioningConcat,
+ "ConditioningSetArea": ConditioningSetArea,
+ "ConditioningSetAreaPercentage": ConditioningSetAreaPercentage,
+ "ConditioningSetAreaStrength": ConditioningSetAreaStrength,
+ "ConditioningSetMask": ConditioningSetMask,
+ "KSamplerAdvanced": KSamplerAdvanced,
+ "SetLatentNoiseMask": SetLatentNoiseMask,
+ "LatentComposite": LatentComposite,
+ "LatentBlend": LatentBlend,
+ "LatentRotate": LatentRotate,
+ "LatentFlip": LatentFlip,
+ "LatentCrop": LatentCrop,
+ "LoraLoader": LoraLoader,
+ "CLIPLoader": CLIPLoader,
+ "UNETLoader": UNETLoader,
+ "DualCLIPLoader": DualCLIPLoader,
+ "CLIPVisionEncode": CLIPVisionEncode,
+ "StyleModelApply": StyleModelApply,
+ "unCLIPConditioning": unCLIPConditioning,
+ "ControlNetApply": ControlNetApply,
+ "ControlNetApplyAdvanced": ControlNetApplyAdvanced,
+ "ControlNetLoader": ControlNetLoader,
+ "DiffControlNetLoader": DiffControlNetLoader,
+ "StyleModelLoader": StyleModelLoader,
+ "CLIPVisionLoader": CLIPVisionLoader,
+ "VAEDecodeTiled": VAEDecodeTiled,
+ "VAEEncodeTiled": VAEEncodeTiled,
+ "unCLIPCheckpointLoader": unCLIPCheckpointLoader,
+ "GLIGENLoader": GLIGENLoader,
+ "GLIGENTextBoxApply": GLIGENTextBoxApply,
+ "InpaintModelConditioning": InpaintModelConditioning,
+
+ "CheckpointLoader": CheckpointLoader,
+ "DiffusersLoader": DiffusersLoader,
+
+ "LoadLatent": LoadLatent,
+ "SaveLatent": SaveLatent,
+
+ "ConditioningZeroOut": ConditioningZeroOut,
+ "ConditioningSetTimestepRange": ConditioningSetTimestepRange,
+ "LoraLoaderModelOnly": LoraLoaderModelOnly,
+}
+
+NODE_DISPLAY_NAME_MAPPINGS = {
+ # Sampling
+ "KSampler": "KSampler",
+ "KSamplerAdvanced": "KSampler (Advanced)",
+ # Loaders
+ "CheckpointLoader": "Load Checkpoint With Config (DEPRECATED)",
+ "CheckpointLoaderSimple": "Load Checkpoint",
+ "VAELoader": "Load VAE",
+ "LoraLoader": "Load LoRA",
+ "CLIPLoader": "Load CLIP",
+ "ControlNetLoader": "Load ControlNet Model",
+ "DiffControlNetLoader": "Load ControlNet Model (diff)",
+ "StyleModelLoader": "Load Style Model",
+ "CLIPVisionLoader": "Load CLIP Vision",
+ "UNETLoader": "Load Diffusion Model",
+ # Conditioning
+ "CLIPVisionEncode": "CLIP Vision Encode",
+ "StyleModelApply": "Apply Style Model",
+ "CLIPTextEncode": "CLIP Text Encode (Prompt)",
+ "CLIPSetLastLayer": "CLIP Set Last Layer",
+ "ConditioningCombine": "Conditioning (Combine)",
+ "ConditioningAverage ": "Conditioning (Average)",
+ "ConditioningConcat": "Conditioning (Concat)",
+ "ConditioningSetArea": "Conditioning (Set Area)",
+ "ConditioningSetAreaPercentage": "Conditioning (Set Area with Percentage)",
+ "ConditioningSetMask": "Conditioning (Set Mask)",
+ "ControlNetApply": "Apply ControlNet (OLD)",
+ "ControlNetApplyAdvanced": "Apply ControlNet",
+ # Latent
+ "VAEEncodeForInpaint": "VAE Encode (for Inpainting)",
+ "SetLatentNoiseMask": "Set Latent Noise Mask",
+ "VAEDecode": "VAE Decode",
+ "VAEEncode": "VAE Encode",
+ "LatentRotate": "Rotate Latent",
+ "LatentFlip": "Flip Latent",
+ "LatentCrop": "Crop Latent",
+ "EmptyLatentImage": "Empty Latent Image",
+ "LatentUpscale": "Upscale Latent",
+ "LatentUpscaleBy": "Upscale Latent By",
+ "LatentComposite": "Latent Composite",
+ "LatentBlend": "Latent Blend",
+ "LatentFromBatch" : "Latent From Batch",
+ "RepeatLatentBatch": "Repeat Latent Batch",
+ # Image
+ "SaveImage": "Save Image",
+ "PreviewImage": "Preview Image",
+ "LoadImage": "Load Image",
+ "LoadImageMask": "Load Image (as Mask)",
+ "LoadImageOutput": "Load Image (from Outputs)",
+ "ImageScale": "Upscale Image",
+ "ImageScaleBy": "Upscale Image By",
+ "ImageInvert": "Invert Image",
+ "ImagePadForOutpaint": "Pad Image for Outpainting",
+ "ImageBatch": "Batch Images",
+ "ImageCrop": "Image Crop",
+ "ImageStitch": "Image Stitch",
+ "ImageBlend": "Image Blend",
+ "ImageBlur": "Image Blur",
+ "ImageQuantize": "Image Quantize",
+ "ImageSharpen": "Image Sharpen",
+ "ImageScaleToTotalPixels": "Scale Image to Total Pixels",
+ "GetImageSize": "Get Image Size",
+ # _for_testing
+ "VAEDecodeTiled": "VAE Decode (Tiled)",
+ "VAEEncodeTiled": "VAE Encode (Tiled)",
+}
+
+EXTENSION_WEB_DIRS = {}
+
+# Dictionary of successfully loaded module names and associated directories.
+LOADED_MODULE_DIRS = {}
+
+
+def get_module_name(module_path: str) -> str:
+ """
+ Returns the module name based on the given module path.
+ Examples:
+ get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node.py") -> "my_custom_node"
+ get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node") -> "my_custom_node"
+ get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node/") -> "my_custom_node"
+ get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node/__init__.py") -> "my_custom_node"
+ get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node/__init__") -> "my_custom_node"
+ get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node/__init__/") -> "my_custom_node"
+ get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node.disabled") -> "custom_nodes
+ Args:
+ module_path (str): The path of the module.
+ Returns:
+ str: The module name.
+ """
+ base_path = os.path.basename(module_path)
+ if os.path.isfile(module_path):
+ base_path = os.path.splitext(base_path)[0]
+ return base_path
+
+
+async def load_custom_node(module_path: str, ignore=set(), module_parent="custom_nodes") -> bool:
+ module_name = get_module_name(module_path)
+ if os.path.isfile(module_path):
+ sp = os.path.splitext(module_path)
+ module_name = sp[0]
+ sys_module_name = module_name
+ elif os.path.isdir(module_path):
+ sys_module_name = module_path.replace(".", "_x_")
+
+ try:
+ logging.debug("Trying to load custom node {}".format(module_path))
+ if os.path.isfile(module_path):
+ module_spec = importlib.util.spec_from_file_location(sys_module_name, module_path)
+ module_dir = os.path.split(module_path)[0]
+ else:
+ module_spec = importlib.util.spec_from_file_location(sys_module_name, os.path.join(module_path, "__init__.py"))
+ module_dir = module_path
+
+ module = importlib.util.module_from_spec(module_spec)
+ sys.modules[sys_module_name] = module
+ module_spec.loader.exec_module(module)
+
+ LOADED_MODULE_DIRS[module_name] = os.path.abspath(module_dir)
+
+ try:
+ from comfy_config import config_parser
+
+ project_config = config_parser.extract_node_configuration(module_path)
+
+ web_dir_name = project_config.tool_comfy.web
+
+ if web_dir_name:
+ web_dir_path = os.path.join(module_path, web_dir_name)
+
+ if os.path.isdir(web_dir_path):
+ project_name = project_config.project.name
+
+ EXTENSION_WEB_DIRS[project_name] = web_dir_path
+
+ logging.info("Automatically register web folder {} for {}".format(web_dir_name, project_name))
+ except Exception as e:
+ logging.warning(f"Unable to parse pyproject.toml due to lack dependency pydantic-settings, please run 'pip install -r requirements.txt': {e}")
+
+ if hasattr(module, "WEB_DIRECTORY") and getattr(module, "WEB_DIRECTORY") is not None:
+ web_dir = os.path.abspath(os.path.join(module_dir, getattr(module, "WEB_DIRECTORY")))
+ if os.path.isdir(web_dir):
+ EXTENSION_WEB_DIRS[module_name] = web_dir
+
+ # V1 node definition
+ if hasattr(module, "NODE_CLASS_MAPPINGS") and getattr(module, "NODE_CLASS_MAPPINGS") is not None:
+ for name, node_cls in module.NODE_CLASS_MAPPINGS.items():
+ if name not in ignore:
+ NODE_CLASS_MAPPINGS[name] = node_cls
+ node_cls.RELATIVE_PYTHON_MODULE = "{}.{}".format(module_parent, get_module_name(module_path))
+ if hasattr(module, "NODE_DISPLAY_NAME_MAPPINGS") and getattr(module, "NODE_DISPLAY_NAME_MAPPINGS") is not None:
+ NODE_DISPLAY_NAME_MAPPINGS.update(module.NODE_DISPLAY_NAME_MAPPINGS)
+ return True
+ # V3 Extension Definition
+ elif hasattr(module, "comfy_entrypoint"):
+ entrypoint = getattr(module, "comfy_entrypoint")
+ if not callable(entrypoint):
+ logging.warning(f"comfy_entrypoint in {module_path} is not callable, skipping.")
+ return False
+ try:
+ if inspect.iscoroutinefunction(entrypoint):
+ extension = await entrypoint()
+ else:
+ extension = entrypoint()
+ if not isinstance(extension, ComfyExtension):
+ logging.warning(f"comfy_entrypoint in {module_path} did not return a ComfyExtension, skipping.")
+ return False
+ node_list = await extension.get_node_list()
+ if not isinstance(node_list, list):
+ logging.warning(f"comfy_entrypoint in {module_path} did not return a list of nodes, skipping.")
+ return False
+ for node_cls in node_list:
+ node_cls: io.ComfyNode
+ schema = node_cls.GET_SCHEMA()
+ if schema.node_id not in ignore:
+ NODE_CLASS_MAPPINGS[schema.node_id] = node_cls
+ node_cls.RELATIVE_PYTHON_MODULE = "{}.{}".format(module_parent, get_module_name(module_path))
+ if schema.display_name is not None:
+ NODE_DISPLAY_NAME_MAPPINGS[schema.node_id] = schema.display_name
+ return True
+ except Exception as e:
+ logging.warning(f"Error while calling comfy_entrypoint in {module_path}: {e}")
+ return False
+ else:
+ logging.warning(f"Skip {module_path} module for custom nodes due to the lack of NODE_CLASS_MAPPINGS or NODES_LIST (need one).")
+ return False
+ except Exception as e:
+ logging.warning(traceback.format_exc())
+ logging.warning(f"Cannot import {module_path} module for custom nodes: {e}")
+ return False
+
+async def init_external_custom_nodes():
+ """
+ Initializes the external custom nodes.
+
+ This function loads custom nodes from the specified folder paths and imports them into the application.
+ It measures the import times for each custom node and logs the results.
+
+ Returns:
+ None
+ """
+ base_node_names = set(NODE_CLASS_MAPPINGS.keys())
+ node_paths = folder_paths.get_folder_paths("custom_nodes")
+ node_import_times = []
+ for custom_node_path in node_paths:
+ possible_modules = os.listdir(os.path.realpath(custom_node_path))
+ if "__pycache__" in possible_modules:
+ possible_modules.remove("__pycache__")
+
+ for possible_module in possible_modules:
+ module_path = os.path.join(custom_node_path, possible_module)
+ if os.path.isfile(module_path) and os.path.splitext(module_path)[1] != ".py": continue
+ if module_path.endswith(".disabled"): continue
+ if args.disable_all_custom_nodes and possible_module not in args.whitelist_custom_nodes:
+ logging.info(f"Skipping {possible_module} due to disable_all_custom_nodes and whitelist_custom_nodes")
+ continue
+ time_before = time.perf_counter()
+ success = await load_custom_node(module_path, base_node_names, module_parent="custom_nodes")
+ node_import_times.append((time.perf_counter() - time_before, module_path, success))
+
+ if len(node_import_times) > 0:
+ logging.info("\nImport times for custom nodes:")
+ for n in sorted(node_import_times):
+ if n[2]:
+ import_message = ""
+ else:
+ import_message = " (IMPORT FAILED)"
+ logging.info("{:6.1f} seconds{}: {}".format(n[0], import_message, n[1]))
+ logging.info("")
+
+async def init_builtin_extra_nodes():
+ """
+ Initializes the built-in extra nodes in ComfyUI.
+
+ This function loads the extra node files located in the "comfy_extras" directory and imports them into ComfyUI.
+ If any of the extra node files fail to import, a warning message is logged.
+
+ Returns:
+ None
+ """
+ extras_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "comfy_extras")
+ extras_files = [
+ "nodes_latent.py",
+ "nodes_hypernetwork.py",
+ "nodes_upscale_model.py",
+ "nodes_post_processing.py",
+ "nodes_mask.py",
+ "nodes_compositing.py",
+ "nodes_rebatch.py",
+ "nodes_model_merging.py",
+ "nodes_tomesd.py",
+ "nodes_clip_sdxl.py",
+ "nodes_canny.py",
+ "nodes_freelunch.py",
+ "nodes_custom_sampler.py",
+ "nodes_hypertile.py",
+ "nodes_model_advanced.py",
+ "nodes_model_downscale.py",
+ "nodes_images.py",
+ "nodes_video_model.py",
+ "nodes_train.py",
+ "nodes_sag.py",
+ "nodes_perpneg.py",
+ "nodes_stable3d.py",
+ "nodes_sdupscale.py",
+ "nodes_photomaker.py",
+ "nodes_pixart.py",
+ "nodes_cond.py",
+ "nodes_morphology.py",
+ "nodes_stable_cascade.py",
+ "nodes_differential_diffusion.py",
+ "nodes_ip2p.py",
+ "nodes_model_merging_model_specific.py",
+ "nodes_pag.py",
+ "nodes_align_your_steps.py",
+ "nodes_attention_multiply.py",
+ "nodes_advanced_samplers.py",
+ "nodes_webcam.py",
+ "nodes_audio.py",
+ "nodes_sd3.py",
+ "nodes_gits.py",
+ "nodes_controlnet.py",
+ "nodes_hunyuan.py",
+ "nodes_eps.py",
+ "nodes_flux.py",
+ "nodes_lora_extract.py",
+ "nodes_torch_compile.py",
+ "nodes_mochi.py",
+ "nodes_slg.py",
+ "nodes_mahiro.py",
+ "nodes_lt.py",
+ "nodes_hooks.py",
+ "nodes_load_3d.py",
+ "nodes_cosmos.py",
+ "nodes_video.py",
+ "nodes_lumina2.py",
+ "nodes_wan.py",
+ "nodes_lotus.py",
+ "nodes_hunyuan3d.py",
+ "nodes_primitive.py",
+ "nodes_cfg.py",
+ "nodes_optimalsteps.py",
+ "nodes_hidream.py",
+ "nodes_fresca.py",
+ "nodes_apg.py",
+ "nodes_preview_any.py",
+ "nodes_ace.py",
+ "nodes_string.py",
+ "nodes_camera_trajectory.py",
+ "nodes_edit_model.py",
+ "nodes_tcfg.py",
+ "nodes_context_windows.py",
+ "nodes_qwen.py",
+ "nodes_chroma_radiance.py",
+ "nodes_model_patch.py",
+ "nodes_easycache.py",
+ "nodes_audio_encoder.py",
+ "nodes_rope.py",
+ ]
+
+ import_failed = []
+ for node_file in extras_files:
+ if not await load_custom_node(os.path.join(extras_dir, node_file), module_parent="comfy_extras"):
+ import_failed.append(node_file)
+
+ return import_failed
+
+
+async def init_builtin_api_nodes():
+ api_nodes_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "comfy_api_nodes")
+ api_nodes_files = [
+ "nodes_ideogram.py",
+ "nodes_openai.py",
+ "nodes_minimax.py",
+ "nodes_veo2.py",
+ "nodes_kling.py",
+ "nodes_bfl.py",
+ "nodes_bytedance.py",
+ "nodes_ltxv.py",
+ "nodes_luma.py",
+ "nodes_recraft.py",
+ "nodes_pixverse.py",
+ "nodes_stability.py",
+ "nodes_pika.py",
+ "nodes_runway.py",
+ "nodes_sora.py",
+ "nodes_tripo.py",
+ "nodes_moonvalley.py",
+ "nodes_rodin.py",
+ "nodes_gemini.py",
+ "nodes_vidu.py",
+ "nodes_wan.py",
+ ]
+
+ if not await load_custom_node(os.path.join(api_nodes_dir, "canary.py"), module_parent="comfy_api_nodes"):
+ return api_nodes_files
+
+ import_failed = []
+ for node_file in api_nodes_files:
+ if not await load_custom_node(os.path.join(api_nodes_dir, node_file), module_parent="comfy_api_nodes"):
+ import_failed.append(node_file)
+
+ return import_failed
+
+async def init_public_apis():
+ register_versions([
+ ComfyAPIWithVersion(
+ version=getattr(v, "VERSION"),
+ api_class=v
+ ) for v in supported_versions
+ ])
+
+async def init_extra_nodes(init_custom_nodes=True, init_api_nodes=True):
+ await init_public_apis()
+
+ import_failed = await init_builtin_extra_nodes()
+
+ import_failed_api = []
+ if init_api_nodes:
+ import_failed_api = await init_builtin_api_nodes()
+
+ if init_custom_nodes:
+ await init_external_custom_nodes()
+ else:
+ logging.info("Skipping loading of custom nodes")
+
+ if len(import_failed_api) > 0:
+ logging.warning("WARNING: some comfy_api_nodes/ nodes did not import correctly. This may be because they are missing some dependencies.\n")
+ for node in import_failed_api:
+ logging.warning("IMPORT FAILED: {}".format(node))
+ logging.warning("\nThis issue might be caused by new missing dependencies added the last time you updated ComfyUI.")
+ if args.windows_standalone_build:
+ logging.warning("Please run the update script: update/update_comfyui.bat")
+ else:
+ logging.warning("Please do a: pip install -r requirements.txt")
+ logging.warning("")
+
+ if len(import_failed) > 0:
+ logging.warning("WARNING: some comfy_extras/ nodes did not import correctly. This may be because they are missing some dependencies.\n")
+ for node in import_failed:
+ logging.warning("IMPORT FAILED: {}".format(node))
+ logging.warning("\nThis issue might be caused by new missing dependencies added the last time you updated ComfyUI.")
+ if args.windows_standalone_build:
+ logging.warning("Please run the update script: update/update_comfyui.bat")
+ else:
+ logging.warning("Please do a: pip install -r requirements.txt")
+ logging.warning("")
+
+ return import_failed
diff --git a/docs/hel-892/separation-reference/core-0.3.71__LICENSE b/docs/hel-892/separation-reference/core-0.3.71__LICENSE
new file mode 100644
index 00000000..f288702d
--- /dev/null
+++ b/docs/hel-892/separation-reference/core-0.3.71__LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
diff --git a/docs/hel-892/separation-reference/core-0.3.71__comfy_extras__nodes_audio.py b/docs/hel-892/separation-reference/core-0.3.71__comfy_extras__nodes_audio.py
new file mode 100644
index 00000000..2ed7e0b2
--- /dev/null
+++ b/docs/hel-892/separation-reference/core-0.3.71__comfy_extras__nodes_audio.py
@@ -0,0 +1,614 @@
+from __future__ import annotations
+
+import av
+import torchaudio
+import torch
+import comfy.model_management
+import folder_paths
+import os
+import io
+import json
+import random
+import hashlib
+import node_helpers
+import logging
+from comfy.cli_args import args
+from comfy.comfy_types import FileLocator
+
+class EmptyLatentAudio:
+ def __init__(self):
+ self.device = comfy.model_management.intermediate_device()
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"seconds": ("FLOAT", {"default": 47.6, "min": 1.0, "max": 1000.0, "step": 0.1}),
+ "batch_size": ("INT", {"default": 1, "min": 1, "max": 4096, "tooltip": "The number of latent images in the batch."}),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "generate"
+
+ CATEGORY = "latent/audio"
+
+ def generate(self, seconds, batch_size):
+ length = round((seconds * 44100 / 2048) / 2) * 2
+ latent = torch.zeros([batch_size, 64, length], device=self.device)
+ return ({"samples":latent, "type": "audio"}, )
+
+class ConditioningStableAudio:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"positive": ("CONDITIONING", ),
+ "negative": ("CONDITIONING", ),
+ "seconds_start": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 1000.0, "step": 0.1}),
+ "seconds_total": ("FLOAT", {"default": 47.0, "min": 0.0, "max": 1000.0, "step": 0.1}),
+ }}
+
+ RETURN_TYPES = ("CONDITIONING","CONDITIONING")
+ RETURN_NAMES = ("positive", "negative")
+
+ FUNCTION = "append"
+
+ CATEGORY = "conditioning"
+
+ def append(self, positive, negative, seconds_start, seconds_total):
+ positive = node_helpers.conditioning_set_values(positive, {"seconds_start": seconds_start, "seconds_total": seconds_total})
+ negative = node_helpers.conditioning_set_values(negative, {"seconds_start": seconds_start, "seconds_total": seconds_total})
+ return (positive, negative)
+
+class VAEEncodeAudio:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "audio": ("AUDIO", ), "vae": ("VAE", )}}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "encode"
+
+ CATEGORY = "latent/audio"
+
+ def encode(self, vae, audio):
+ sample_rate = audio["sample_rate"]
+ if 44100 != sample_rate:
+ waveform = torchaudio.functional.resample(audio["waveform"], sample_rate, 44100)
+ else:
+ waveform = audio["waveform"]
+
+ t = vae.encode(waveform.movedim(1, -1))
+ return ({"samples":t}, )
+
+class VAEDecodeAudio:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT", ), "vae": ("VAE", )}}
+ RETURN_TYPES = ("AUDIO",)
+ FUNCTION = "decode"
+
+ CATEGORY = "latent/audio"
+
+ def decode(self, vae, samples):
+ audio = vae.decode(samples["samples"]).movedim(-1, 1)
+ std = torch.std(audio, dim=[1,2], keepdim=True) * 5.0
+ std[std < 1.0] = 1.0
+ audio /= std
+ return ({"waveform": audio, "sample_rate": 44100}, )
+
+
+def save_audio(self, audio, filename_prefix="ComfyUI", format="flac", prompt=None, extra_pnginfo=None, quality="128k"):
+
+ filename_prefix += self.prefix_append
+ full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(filename_prefix, self.output_dir)
+ results: list[FileLocator] = []
+
+ # Prepare metadata dictionary
+ metadata = {}
+ if not args.disable_metadata:
+ if prompt is not None:
+ metadata["prompt"] = json.dumps(prompt)
+ if extra_pnginfo is not None:
+ for x in extra_pnginfo:
+ metadata[x] = json.dumps(extra_pnginfo[x])
+
+ # Opus supported sample rates
+ OPUS_RATES = [8000, 12000, 16000, 24000, 48000]
+
+ for (batch_number, waveform) in enumerate(audio["waveform"].cpu()):
+ filename_with_batch_num = filename.replace("%batch_num%", str(batch_number))
+ file = f"{filename_with_batch_num}_{counter:05}_.{format}"
+ output_path = os.path.join(full_output_folder, file)
+
+ # Use original sample rate initially
+ sample_rate = audio["sample_rate"]
+
+ # Handle Opus sample rate requirements
+ if format == "opus":
+ if sample_rate > 48000:
+ sample_rate = 48000
+ elif sample_rate not in OPUS_RATES:
+ # Find the next highest supported rate
+ for rate in sorted(OPUS_RATES):
+ if rate > sample_rate:
+ sample_rate = rate
+ break
+ if sample_rate not in OPUS_RATES: # Fallback if still not supported
+ sample_rate = 48000
+
+ # Resample if necessary
+ if sample_rate != audio["sample_rate"]:
+ waveform = torchaudio.functional.resample(waveform, audio["sample_rate"], sample_rate)
+
+ # Create output with specified format
+ output_buffer = io.BytesIO()
+ output_container = av.open(output_buffer, mode='w', format=format)
+
+ # Set metadata on the container
+ for key, value in metadata.items():
+ output_container.metadata[key] = value
+
+ layout = 'mono' if waveform.shape[0] == 1 else 'stereo'
+ # Set up the output stream with appropriate properties
+ if format == "opus":
+ out_stream = output_container.add_stream("libopus", rate=sample_rate, layout=layout)
+ if quality == "64k":
+ out_stream.bit_rate = 64000
+ elif quality == "96k":
+ out_stream.bit_rate = 96000
+ elif quality == "128k":
+ out_stream.bit_rate = 128000
+ elif quality == "192k":
+ out_stream.bit_rate = 192000
+ elif quality == "320k":
+ out_stream.bit_rate = 320000
+ elif format == "mp3":
+ out_stream = output_container.add_stream("libmp3lame", rate=sample_rate, layout=layout)
+ if quality == "V0":
+ #TODO i would really love to support V3 and V5 but there doesn't seem to be a way to set the qscale level, the property below is a bool
+ out_stream.codec_context.qscale = 1
+ elif quality == "128k":
+ out_stream.bit_rate = 128000
+ elif quality == "320k":
+ out_stream.bit_rate = 320000
+ else: #format == "flac":
+ out_stream = output_container.add_stream("flac", rate=sample_rate, layout=layout)
+
+ frame = av.AudioFrame.from_ndarray(waveform.movedim(0, 1).reshape(1, -1).float().numpy(), format='flt', layout=layout)
+ frame.sample_rate = sample_rate
+ frame.pts = 0
+ output_container.mux(out_stream.encode(frame))
+
+ # Flush encoder
+ output_container.mux(out_stream.encode(None))
+
+ # Close containers
+ output_container.close()
+
+ # Write the output to file
+ output_buffer.seek(0)
+ with open(output_path, 'wb') as f:
+ f.write(output_buffer.getbuffer())
+
+ results.append({
+ "filename": file,
+ "subfolder": subfolder,
+ "type": self.type
+ })
+ counter += 1
+
+ return { "ui": { "audio": results } }
+
+class SaveAudio:
+ def __init__(self):
+ self.output_dir = folder_paths.get_output_directory()
+ self.type = "output"
+ self.prefix_append = ""
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "audio": ("AUDIO", ),
+ "filename_prefix": ("STRING", {"default": "audio/ComfyUI"}),
+ },
+ "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
+ }
+
+ RETURN_TYPES = ()
+ FUNCTION = "save_flac"
+
+ OUTPUT_NODE = True
+
+ CATEGORY = "audio"
+
+ def save_flac(self, audio, filename_prefix="ComfyUI", format="flac", prompt=None, extra_pnginfo=None):
+ return save_audio(self, audio, filename_prefix, format, prompt, extra_pnginfo)
+
+class SaveAudioMP3:
+ def __init__(self):
+ self.output_dir = folder_paths.get_output_directory()
+ self.type = "output"
+ self.prefix_append = ""
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "audio": ("AUDIO", ),
+ "filename_prefix": ("STRING", {"default": "audio/ComfyUI"}),
+ "quality": (["V0", "128k", "320k"], {"default": "V0"}),
+ },
+ "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
+ }
+
+ RETURN_TYPES = ()
+ FUNCTION = "save_mp3"
+
+ OUTPUT_NODE = True
+
+ CATEGORY = "audio"
+
+ def save_mp3(self, audio, filename_prefix="ComfyUI", format="mp3", prompt=None, extra_pnginfo=None, quality="128k"):
+ return save_audio(self, audio, filename_prefix, format, prompt, extra_pnginfo, quality)
+
+class SaveAudioOpus:
+ def __init__(self):
+ self.output_dir = folder_paths.get_output_directory()
+ self.type = "output"
+ self.prefix_append = ""
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "audio": ("AUDIO", ),
+ "filename_prefix": ("STRING", {"default": "audio/ComfyUI"}),
+ "quality": (["64k", "96k", "128k", "192k", "320k"], {"default": "128k"}),
+ },
+ "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
+ }
+
+ RETURN_TYPES = ()
+ FUNCTION = "save_opus"
+
+ OUTPUT_NODE = True
+
+ CATEGORY = "audio"
+
+ def save_opus(self, audio, filename_prefix="ComfyUI", format="opus", prompt=None, extra_pnginfo=None, quality="V3"):
+ return save_audio(self, audio, filename_prefix, format, prompt, extra_pnginfo, quality)
+
+class PreviewAudio(SaveAudio):
+ def __init__(self):
+ self.output_dir = folder_paths.get_temp_directory()
+ self.type = "temp"
+ self.prefix_append = "_temp_" + ''.join(random.choice("abcdefghijklmnopqrstupvxyz") for x in range(5))
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required":
+ {"audio": ("AUDIO", ), },
+ "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
+ }
+
+def f32_pcm(wav: torch.Tensor) -> torch.Tensor:
+ """Convert audio to float 32 bits PCM format."""
+ if wav.dtype.is_floating_point:
+ return wav
+ elif wav.dtype == torch.int16:
+ return wav.float() / (2 ** 15)
+ elif wav.dtype == torch.int32:
+ return wav.float() / (2 ** 31)
+ raise ValueError(f"Unsupported wav dtype: {wav.dtype}")
+
+def load(filepath: str) -> tuple[torch.Tensor, int]:
+ with av.open(filepath) as af:
+ if not af.streams.audio:
+ raise ValueError("No audio stream found in the file.")
+
+ stream = af.streams.audio[0]
+ sr = stream.codec_context.sample_rate
+ n_channels = stream.channels
+
+ frames = []
+ length = 0
+ for frame in af.decode(streams=stream.index):
+ buf = torch.from_numpy(frame.to_ndarray())
+ if buf.shape[0] != n_channels:
+ buf = buf.view(-1, n_channels).t()
+
+ frames.append(buf)
+ length += buf.shape[1]
+
+ if not frames:
+ raise ValueError("No audio frames decoded.")
+
+ wav = torch.cat(frames, dim=1)
+ wav = f32_pcm(wav)
+ return wav, sr
+
+class LoadAudio:
+ @classmethod
+ def INPUT_TYPES(s):
+ input_dir = folder_paths.get_input_directory()
+ files = folder_paths.filter_files_content_types(os.listdir(input_dir), ["audio", "video"])
+ return {"required": {"audio": (sorted(files), {"audio_upload": True})}}
+
+ CATEGORY = "audio"
+
+ RETURN_TYPES = ("AUDIO", )
+ FUNCTION = "load"
+
+ def load(self, audio):
+ audio_path = folder_paths.get_annotated_filepath(audio)
+ waveform, sample_rate = load(audio_path)
+ audio = {"waveform": waveform.unsqueeze(0), "sample_rate": sample_rate}
+ return (audio, )
+
+ @classmethod
+ def IS_CHANGED(s, audio):
+ image_path = folder_paths.get_annotated_filepath(audio)
+ m = hashlib.sha256()
+ with open(image_path, 'rb') as f:
+ m.update(f.read())
+ return m.digest().hex()
+
+ @classmethod
+ def VALIDATE_INPUTS(s, audio):
+ if not folder_paths.exists_annotated_filepath(audio):
+ return "Invalid audio file: {}".format(audio)
+ return True
+
+class RecordAudio:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"audio": ("AUDIO_RECORD", {})}}
+
+ CATEGORY = "audio"
+
+ RETURN_TYPES = ("AUDIO", )
+ FUNCTION = "load"
+
+ def load(self, audio):
+ audio_path = folder_paths.get_annotated_filepath(audio)
+
+ waveform, sample_rate = load(audio_path)
+ audio = {"waveform": waveform.unsqueeze(0), "sample_rate": sample_rate}
+ return (audio, )
+
+
+class TrimAudioDuration:
+ @classmethod
+ def INPUT_TYPES(cls):
+ return {
+ "required": {
+ "audio": ("AUDIO",),
+ "start_index": ("FLOAT", {"default": 0.0, "min": -0xffffffffffffffff, "max": 0xffffffffffffffff, "step": 0.01, "tooltip": "Start time in seconds, can be negative to count from the end (supports sub-seconds)."}),
+ "duration": ("FLOAT", {"default": 60.0, "min": 0.0, "step": 0.01, "tooltip": "Duration in seconds"}),
+ },
+ }
+
+ FUNCTION = "trim"
+ RETURN_TYPES = ("AUDIO",)
+ CATEGORY = "audio"
+ DESCRIPTION = "Trim audio tensor into chosen time range."
+
+ def trim(self, audio, start_index, duration):
+ waveform = audio["waveform"]
+ sample_rate = audio["sample_rate"]
+ audio_length = waveform.shape[-1]
+
+ if start_index < 0:
+ start_frame = audio_length + int(round(start_index * sample_rate))
+ else:
+ start_frame = int(round(start_index * sample_rate))
+ start_frame = max(0, min(start_frame, audio_length - 1))
+
+ end_frame = start_frame + int(round(duration * sample_rate))
+ end_frame = max(0, min(end_frame, audio_length))
+
+ if start_frame >= end_frame:
+ raise ValueError("AudioTrim: Start time must be less than end time and be within the audio length.")
+
+ return ({"waveform": waveform[..., start_frame:end_frame], "sample_rate": sample_rate},)
+
+
+class SplitAudioChannels:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {
+ "audio": ("AUDIO",),
+ }}
+
+ RETURN_TYPES = ("AUDIO", "AUDIO")
+ RETURN_NAMES = ("left", "right")
+ FUNCTION = "separate"
+ CATEGORY = "audio"
+ DESCRIPTION = "Separates the audio into left and right channels."
+
+ def separate(self, audio):
+ waveform = audio["waveform"]
+ sample_rate = audio["sample_rate"]
+
+ if waveform.shape[1] != 2:
+ raise ValueError("AudioSplit: Input audio has only one channel.")
+
+ left_channel = waveform[..., 0:1, :]
+ right_channel = waveform[..., 1:2, :]
+
+ return ({"waveform": left_channel, "sample_rate": sample_rate}, {"waveform": right_channel, "sample_rate": sample_rate})
+
+
+def match_audio_sample_rates(waveform_1, sample_rate_1, waveform_2, sample_rate_2):
+ if sample_rate_1 != sample_rate_2:
+ if sample_rate_1 > sample_rate_2:
+ waveform_2 = torchaudio.functional.resample(waveform_2, sample_rate_2, sample_rate_1)
+ output_sample_rate = sample_rate_1
+ logging.info(f"Resampling audio2 from {sample_rate_2}Hz to {sample_rate_1}Hz for merging.")
+ else:
+ waveform_1 = torchaudio.functional.resample(waveform_1, sample_rate_1, sample_rate_2)
+ output_sample_rate = sample_rate_2
+ logging.info(f"Resampling audio1 from {sample_rate_1}Hz to {sample_rate_2}Hz for merging.")
+ else:
+ output_sample_rate = sample_rate_1
+ return waveform_1, waveform_2, output_sample_rate
+
+
+class AudioConcat:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {
+ "audio1": ("AUDIO",),
+ "audio2": ("AUDIO",),
+ "direction": (['after', 'before'], {"default": 'after', "tooltip": "Whether to append audio2 after or before audio1."}),
+ }}
+
+ RETURN_TYPES = ("AUDIO",)
+ FUNCTION = "concat"
+ CATEGORY = "audio"
+ DESCRIPTION = "Concatenates the audio1 to audio2 in the specified direction."
+
+ def concat(self, audio1, audio2, direction):
+ waveform_1 = audio1["waveform"]
+ waveform_2 = audio2["waveform"]
+ sample_rate_1 = audio1["sample_rate"]
+ sample_rate_2 = audio2["sample_rate"]
+
+ if waveform_1.shape[1] == 1:
+ waveform_1 = waveform_1.repeat(1, 2, 1)
+ logging.info("AudioConcat: Converted mono audio1 to stereo by duplicating the channel.")
+ if waveform_2.shape[1] == 1:
+ waveform_2 = waveform_2.repeat(1, 2, 1)
+ logging.info("AudioConcat: Converted mono audio2 to stereo by duplicating the channel.")
+
+ waveform_1, waveform_2, output_sample_rate = match_audio_sample_rates(waveform_1, sample_rate_1, waveform_2, sample_rate_2)
+
+ if direction == 'after':
+ concatenated_audio = torch.cat((waveform_1, waveform_2), dim=2)
+ elif direction == 'before':
+ concatenated_audio = torch.cat((waveform_2, waveform_1), dim=2)
+
+ return ({"waveform": concatenated_audio, "sample_rate": output_sample_rate},)
+
+
+class AudioMerge:
+ @classmethod
+ def INPUT_TYPES(cls):
+ return {
+ "required": {
+ "audio1": ("AUDIO",),
+ "audio2": ("AUDIO",),
+ "merge_method": (["add", "mean", "subtract", "multiply"], {"tooltip": "The method used to combine the audio waveforms."}),
+ },
+ }
+
+ FUNCTION = "merge"
+ RETURN_TYPES = ("AUDIO",)
+ CATEGORY = "audio"
+ DESCRIPTION = "Combine two audio tracks by overlaying their waveforms."
+
+ def merge(self, audio1, audio2, merge_method):
+ waveform_1 = audio1["waveform"]
+ waveform_2 = audio2["waveform"]
+ sample_rate_1 = audio1["sample_rate"]
+ sample_rate_2 = audio2["sample_rate"]
+
+ waveform_1, waveform_2, output_sample_rate = match_audio_sample_rates(waveform_1, sample_rate_1, waveform_2, sample_rate_2)
+
+ length_1 = waveform_1.shape[-1]
+ length_2 = waveform_2.shape[-1]
+
+ if length_2 > length_1:
+ logging.info(f"AudioMerge: Trimming audio2 from {length_2} to {length_1} samples to match audio1 length.")
+ waveform_2 = waveform_2[..., :length_1]
+ elif length_2 < length_1:
+ logging.info(f"AudioMerge: Padding audio2 from {length_2} to {length_1} samples to match audio1 length.")
+ pad_shape = list(waveform_2.shape)
+ pad_shape[-1] = length_1 - length_2
+ pad_tensor = torch.zeros(pad_shape, dtype=waveform_2.dtype, device=waveform_2.device)
+ waveform_2 = torch.cat((waveform_2, pad_tensor), dim=-1)
+
+ if merge_method == "add":
+ waveform = waveform_1 + waveform_2
+ elif merge_method == "subtract":
+ waveform = waveform_1 - waveform_2
+ elif merge_method == "multiply":
+ waveform = waveform_1 * waveform_2
+ elif merge_method == "mean":
+ waveform = (waveform_1 + waveform_2) / 2
+
+ max_val = waveform.abs().max()
+ if max_val > 1.0:
+ waveform = waveform / max_val
+
+ return ({"waveform": waveform, "sample_rate": output_sample_rate},)
+
+
+class AudioAdjustVolume:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {
+ "audio": ("AUDIO",),
+ "volume": ("INT", {"default": 1.0, "min": -100, "max": 100, "tooltip": "Volume adjustment in decibels (dB). 0 = no change, +6 = double, -6 = half, etc"}),
+ }}
+
+ RETURN_TYPES = ("AUDIO",)
+ FUNCTION = "adjust_volume"
+ CATEGORY = "audio"
+
+ def adjust_volume(self, audio, volume):
+ if volume == 0:
+ return (audio,)
+ waveform = audio["waveform"]
+ sample_rate = audio["sample_rate"]
+
+ gain = 10 ** (volume / 20)
+ waveform = waveform * gain
+
+ return ({"waveform": waveform, "sample_rate": sample_rate},)
+
+
+class EmptyAudio:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {
+ "duration": ("FLOAT", {"default": 60.0, "min": 0.0, "max": 0xffffffffffffffff, "step": 0.01, "tooltip": "Duration of the empty audio clip in seconds"}),
+ "sample_rate": ("INT", {"default": 44100, "tooltip": "Sample rate of the empty audio clip."}),
+ "channels": ("INT", {"default": 2, "min": 1, "max": 2, "tooltip": "Number of audio channels (1 for mono, 2 for stereo)."}),
+ }}
+
+ RETURN_TYPES = ("AUDIO",)
+ FUNCTION = "create_empty_audio"
+ CATEGORY = "audio"
+
+ def create_empty_audio(self, duration, sample_rate, channels):
+ num_samples = int(round(duration * sample_rate))
+ waveform = torch.zeros((1, channels, num_samples), dtype=torch.float32)
+ return ({"waveform": waveform, "sample_rate": sample_rate},)
+
+
+NODE_CLASS_MAPPINGS = {
+ "EmptyLatentAudio": EmptyLatentAudio,
+ "VAEEncodeAudio": VAEEncodeAudio,
+ "VAEDecodeAudio": VAEDecodeAudio,
+ "SaveAudio": SaveAudio,
+ "SaveAudioMP3": SaveAudioMP3,
+ "SaveAudioOpus": SaveAudioOpus,
+ "LoadAudio": LoadAudio,
+ "PreviewAudio": PreviewAudio,
+ "ConditioningStableAudio": ConditioningStableAudio,
+ "RecordAudio": RecordAudio,
+ "TrimAudioDuration": TrimAudioDuration,
+ "SplitAudioChannels": SplitAudioChannels,
+ "AudioConcat": AudioConcat,
+ "AudioMerge": AudioMerge,
+ "AudioAdjustVolume": AudioAdjustVolume,
+ "EmptyAudio": EmptyAudio,
+}
+
+NODE_DISPLAY_NAME_MAPPINGS = {
+ "EmptyLatentAudio": "Empty Latent Audio",
+ "VAEEncodeAudio": "VAE Encode Audio",
+ "VAEDecodeAudio": "VAE Decode Audio",
+ "PreviewAudio": "Preview Audio",
+ "LoadAudio": "Load Audio",
+ "SaveAudio": "Save Audio (FLAC)",
+ "SaveAudioMP3": "Save Audio (MP3)",
+ "SaveAudioOpus": "Save Audio (Opus)",
+ "RecordAudio": "Record Audio",
+ "TrimAudioDuration": "Trim Audio Duration",
+ "SplitAudioChannels": "Split Audio Channels",
+ "AudioConcat": "Audio Concat",
+ "AudioMerge": "Audio Merge",
+ "AudioAdjustVolume": "Audio Adjust Volume",
+ "EmptyAudio": "Empty Audio",
+}
diff --git a/docs/hel-892/separation-reference/core-0.3.71__execution.py b/docs/hel-892/separation-reference/core-0.3.71__execution.py
new file mode 100644
index 00000000..17c77bea
--- /dev/null
+++ b/docs/hel-892/separation-reference/core-0.3.71__execution.py
@@ -0,0 +1,1232 @@
+import copy
+import heapq
+import inspect
+import logging
+import sys
+import threading
+import time
+import traceback
+from enum import Enum
+from typing import List, Literal, NamedTuple, Optional, Union
+import asyncio
+
+import torch
+
+import comfy.model_management
+import nodes
+from comfy_execution.caching import (
+ BasicCache,
+ CacheKeySetID,
+ CacheKeySetInputSignature,
+ NullCache,
+ HierarchicalCache,
+ LRUCache,
+ RAMPressureCache,
+)
+from comfy_execution.graph import (
+ DynamicPrompt,
+ ExecutionBlocker,
+ ExecutionList,
+ get_input_info,
+)
+from comfy_execution.graph_utils import GraphBuilder, is_link
+from comfy_execution.validation import validate_node_input
+from comfy_execution.progress import get_progress_state, reset_progress_state, add_progress_handler, WebUIProgressHandler
+from comfy_execution.utils import CurrentNodeContext
+from comfy_api.internal import _ComfyNodeInternal, _NodeOutputInternal, first_real_override, is_class, make_locked_method_func
+from comfy_api.latest import io
+
+
+class ExecutionResult(Enum):
+ SUCCESS = 0
+ FAILURE = 1
+ PENDING = 2
+
+class DuplicateNodeError(Exception):
+ pass
+
+class IsChangedCache:
+ def __init__(self, prompt_id: str, dynprompt: DynamicPrompt, outputs_cache: BasicCache):
+ self.prompt_id = prompt_id
+ self.dynprompt = dynprompt
+ self.outputs_cache = outputs_cache
+ self.is_changed = {}
+
+ async def get(self, node_id):
+ if node_id in self.is_changed:
+ return self.is_changed[node_id]
+
+ node = self.dynprompt.get_node(node_id)
+ class_type = node["class_type"]
+ class_def = nodes.NODE_CLASS_MAPPINGS[class_type]
+ has_is_changed = False
+ is_changed_name = None
+ if issubclass(class_def, _ComfyNodeInternal) and first_real_override(class_def, "fingerprint_inputs") is not None:
+ has_is_changed = True
+ is_changed_name = "fingerprint_inputs"
+ elif hasattr(class_def, "IS_CHANGED"):
+ has_is_changed = True
+ is_changed_name = "IS_CHANGED"
+ if not has_is_changed:
+ self.is_changed[node_id] = False
+ return self.is_changed[node_id]
+
+ if "is_changed" in node:
+ self.is_changed[node_id] = node["is_changed"]
+ return self.is_changed[node_id]
+
+ # Intentionally do not use cached outputs here. We only want constants in IS_CHANGED
+ input_data_all, _, hidden_inputs = get_input_data(node["inputs"], class_def, node_id, None)
+ try:
+ is_changed = await _async_map_node_over_list(self.prompt_id, node_id, class_def, input_data_all, is_changed_name)
+ is_changed = await resolve_map_node_over_list_results(is_changed)
+ node["is_changed"] = [None if isinstance(x, ExecutionBlocker) else x for x in is_changed]
+ except Exception as e:
+ logging.warning("WARNING: {}".format(e))
+ node["is_changed"] = float("NaN")
+ finally:
+ self.is_changed[node_id] = node["is_changed"]
+ return self.is_changed[node_id]
+
+
+class CacheEntry(NamedTuple):
+ ui: dict
+ outputs: list
+
+
+class CacheType(Enum):
+ CLASSIC = 0
+ LRU = 1
+ NONE = 2
+ RAM_PRESSURE = 3
+
+
+class CacheSet:
+ def __init__(self, cache_type=None, cache_args={}):
+ if cache_type == CacheType.NONE:
+ self.init_null_cache()
+ logging.info("Disabling intermediate node cache.")
+ elif cache_type == CacheType.RAM_PRESSURE:
+ cache_ram = cache_args.get("ram", 16.0)
+ self.init_ram_cache(cache_ram)
+ logging.info("Using RAM pressure cache.")
+ elif cache_type == CacheType.LRU:
+ cache_size = cache_args.get("lru", 0)
+ self.init_lru_cache(cache_size)
+ logging.info("Using LRU cache")
+ else:
+ self.init_classic_cache()
+
+ self.all = [self.outputs, self.objects]
+
+ # Performs like the old cache -- dump data ASAP
+ def init_classic_cache(self):
+ self.outputs = HierarchicalCache(CacheKeySetInputSignature)
+ self.objects = HierarchicalCache(CacheKeySetID)
+
+ def init_lru_cache(self, cache_size):
+ self.outputs = LRUCache(CacheKeySetInputSignature, max_size=cache_size)
+ self.objects = HierarchicalCache(CacheKeySetID)
+
+ def init_ram_cache(self, min_headroom):
+ self.outputs = RAMPressureCache(CacheKeySetInputSignature)
+ self.objects = HierarchicalCache(CacheKeySetID)
+
+ def init_null_cache(self):
+ self.outputs = NullCache()
+ self.objects = NullCache()
+
+ def recursive_debug_dump(self):
+ result = {
+ "outputs": self.outputs.recursive_debug_dump(),
+ }
+ return result
+
+SENSITIVE_EXTRA_DATA_KEYS = ("auth_token_comfy_org", "api_key_comfy_org")
+
+def get_input_data(inputs, class_def, unique_id, execution_list=None, dynprompt=None, extra_data={}):
+ is_v3 = issubclass(class_def, _ComfyNodeInternal)
+ if is_v3:
+ valid_inputs, schema = class_def.INPUT_TYPES(include_hidden=False, return_schema=True)
+ else:
+ valid_inputs = class_def.INPUT_TYPES()
+ input_data_all = {}
+ missing_keys = {}
+ hidden_inputs_v3 = {}
+ for x in inputs:
+ input_data = inputs[x]
+ _, input_category, input_info = get_input_info(class_def, x, valid_inputs)
+ def mark_missing():
+ missing_keys[x] = True
+ input_data_all[x] = (None,)
+ if is_link(input_data) and (not input_info or not input_info.get("rawLink", False)):
+ input_unique_id = input_data[0]
+ output_index = input_data[1]
+ if execution_list is None:
+ mark_missing()
+ continue # This might be a lazily-evaluated input
+ cached = execution_list.get_cache(input_unique_id, unique_id)
+ if cached is None or cached.outputs is None:
+ mark_missing()
+ continue
+ if output_index >= len(cached.outputs):
+ mark_missing()
+ continue
+ obj = cached.outputs[output_index]
+ input_data_all[x] = obj
+ elif input_category is not None:
+ input_data_all[x] = [input_data]
+
+ if is_v3:
+ if schema.hidden:
+ if io.Hidden.prompt in schema.hidden:
+ hidden_inputs_v3[io.Hidden.prompt] = dynprompt.get_original_prompt() if dynprompt is not None else {}
+ if io.Hidden.dynprompt in schema.hidden:
+ hidden_inputs_v3[io.Hidden.dynprompt] = dynprompt
+ if io.Hidden.extra_pnginfo in schema.hidden:
+ hidden_inputs_v3[io.Hidden.extra_pnginfo] = extra_data.get('extra_pnginfo', None)
+ if io.Hidden.unique_id in schema.hidden:
+ hidden_inputs_v3[io.Hidden.unique_id] = unique_id
+ if io.Hidden.auth_token_comfy_org in schema.hidden:
+ hidden_inputs_v3[io.Hidden.auth_token_comfy_org] = extra_data.get("auth_token_comfy_org", None)
+ if io.Hidden.api_key_comfy_org in schema.hidden:
+ hidden_inputs_v3[io.Hidden.api_key_comfy_org] = extra_data.get("api_key_comfy_org", None)
+ else:
+ if "hidden" in valid_inputs:
+ h = valid_inputs["hidden"]
+ for x in h:
+ if h[x] == "PROMPT":
+ input_data_all[x] = [dynprompt.get_original_prompt() if dynprompt is not None else {}]
+ if h[x] == "DYNPROMPT":
+ input_data_all[x] = [dynprompt]
+ if h[x] == "EXTRA_PNGINFO":
+ input_data_all[x] = [extra_data.get('extra_pnginfo', None)]
+ if h[x] == "UNIQUE_ID":
+ input_data_all[x] = [unique_id]
+ if h[x] == "AUTH_TOKEN_COMFY_ORG":
+ input_data_all[x] = [extra_data.get("auth_token_comfy_org", None)]
+ if h[x] == "API_KEY_COMFY_ORG":
+ input_data_all[x] = [extra_data.get("api_key_comfy_org", None)]
+ return input_data_all, missing_keys, hidden_inputs_v3
+
+map_node_over_list = None #Don't hook this please
+
+async def resolve_map_node_over_list_results(results):
+ remaining = [x for x in results if isinstance(x, asyncio.Task) and not x.done()]
+ if len(remaining) == 0:
+ return [x.result() if isinstance(x, asyncio.Task) else x for x in results]
+ else:
+ done, pending = await asyncio.wait(remaining)
+ for task in done:
+ exc = task.exception()
+ if exc is not None:
+ raise exc
+ return [x.result() if isinstance(x, asyncio.Task) else x for x in results]
+
+async def _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, func, allow_interrupt=False, execution_block_cb=None, pre_execute_cb=None, hidden_inputs=None):
+ # check if node wants the lists
+ input_is_list = getattr(obj, "INPUT_IS_LIST", False)
+
+ if len(input_data_all) == 0:
+ max_len_input = 0
+ else:
+ max_len_input = max(len(x) for x in input_data_all.values())
+
+ # get a slice of inputs, repeat last input when list isn't long enough
+ def slice_dict(d, i):
+ return {k: v[i if len(v) > i else -1] for k, v in d.items()}
+
+ results = []
+ async def process_inputs(inputs, index=None, input_is_list=False):
+ if allow_interrupt:
+ nodes.before_node_execution()
+ execution_block = None
+ for k, v in inputs.items():
+ if input_is_list:
+ for e in v:
+ if isinstance(e, ExecutionBlocker):
+ v = e
+ break
+ if isinstance(v, ExecutionBlocker):
+ execution_block = execution_block_cb(v) if execution_block_cb else v
+ break
+ if execution_block is None:
+ if pre_execute_cb is not None and index is not None:
+ pre_execute_cb(index)
+ # V3
+ if isinstance(obj, _ComfyNodeInternal) or (is_class(obj) and issubclass(obj, _ComfyNodeInternal)):
+ # if is just a class, then assign no resources or state, just create clone
+ if is_class(obj):
+ type_obj = obj
+ obj.VALIDATE_CLASS()
+ class_clone = obj.PREPARE_CLASS_CLONE(hidden_inputs)
+ # otherwise, use class instance to populate/reuse some fields
+ else:
+ type_obj = type(obj)
+ type_obj.VALIDATE_CLASS()
+ class_clone = type_obj.PREPARE_CLASS_CLONE(hidden_inputs)
+ f = make_locked_method_func(type_obj, func, class_clone)
+ # V1
+ else:
+ f = getattr(obj, func)
+ if inspect.iscoroutinefunction(f):
+ async def async_wrapper(f, prompt_id, unique_id, list_index, args):
+ with CurrentNodeContext(prompt_id, unique_id, list_index):
+ return await f(**args)
+ task = asyncio.create_task(async_wrapper(f, prompt_id, unique_id, index, args=inputs))
+ # Give the task a chance to execute without yielding
+ await asyncio.sleep(0)
+ if task.done():
+ result = task.result()
+ results.append(result)
+ else:
+ results.append(task)
+ else:
+ with CurrentNodeContext(prompt_id, unique_id, index):
+ result = f(**inputs)
+ results.append(result)
+ else:
+ results.append(execution_block)
+
+ if input_is_list:
+ await process_inputs(input_data_all, 0, input_is_list=input_is_list)
+ elif max_len_input == 0:
+ await process_inputs({})
+ else:
+ for i in range(max_len_input):
+ input_dict = slice_dict(input_data_all, i)
+ await process_inputs(input_dict, i)
+ return results
+
+
+def merge_result_data(results, obj):
+ # check which outputs need concatenating
+ output = []
+ output_is_list = [False] * len(results[0])
+ if hasattr(obj, "OUTPUT_IS_LIST"):
+ output_is_list = obj.OUTPUT_IS_LIST
+
+ # merge node execution results
+ for i, is_list in zip(range(len(results[0])), output_is_list):
+ if is_list:
+ value = []
+ for o in results:
+ if isinstance(o[i], ExecutionBlocker):
+ value.append(o[i])
+ else:
+ value.extend(o[i])
+ output.append(value)
+ else:
+ output.append([o[i] for o in results])
+ return output
+
+async def get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=None, pre_execute_cb=None, hidden_inputs=None):
+ return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
+ has_pending_task = any(isinstance(r, asyncio.Task) and not r.done() for r in return_values)
+ if has_pending_task:
+ return return_values, {}, False, has_pending_task
+ output, ui, has_subgraph = get_output_from_returns(return_values, obj)
+ return output, ui, has_subgraph, False
+
+def get_output_from_returns(return_values, obj):
+ results = []
+ uis = []
+ subgraph_results = []
+ has_subgraph = False
+ for i in range(len(return_values)):
+ r = return_values[i]
+ if isinstance(r, dict):
+ if 'ui' in r:
+ uis.append(r['ui'])
+ if 'expand' in r:
+ # Perform an expansion, but do not append results
+ has_subgraph = True
+ new_graph = r['expand']
+ result = r.get("result", None)
+ if isinstance(result, ExecutionBlocker):
+ result = tuple([result] * len(obj.RETURN_TYPES))
+ subgraph_results.append((new_graph, result))
+ elif 'result' in r:
+ result = r.get("result", None)
+ if isinstance(result, ExecutionBlocker):
+ result = tuple([result] * len(obj.RETURN_TYPES))
+ results.append(result)
+ subgraph_results.append((None, result))
+ elif isinstance(r, _NodeOutputInternal):
+ # V3
+ if r.ui is not None:
+ if isinstance(r.ui, dict):
+ uis.append(r.ui)
+ else:
+ uis.append(r.ui.as_dict())
+ if r.expand is not None:
+ has_subgraph = True
+ new_graph = r.expand
+ result = r.result
+ if r.block_execution is not None:
+ result = tuple([ExecutionBlocker(r.block_execution)] * len(obj.RETURN_TYPES))
+ subgraph_results.append((new_graph, result))
+ elif r.result is not None:
+ result = r.result
+ if r.block_execution is not None:
+ result = tuple([ExecutionBlocker(r.block_execution)] * len(obj.RETURN_TYPES))
+ results.append(result)
+ subgraph_results.append((None, result))
+ else:
+ if isinstance(r, ExecutionBlocker):
+ r = tuple([r] * len(obj.RETURN_TYPES))
+ results.append(r)
+ subgraph_results.append((None, r))
+
+ if has_subgraph:
+ output = subgraph_results
+ elif len(results) > 0:
+ output = merge_result_data(results, obj)
+ else:
+ output = []
+ ui = dict()
+ # TODO: Think there's an existing bug here
+ # If we're performing a subgraph expansion, we probably shouldn't be returning UI values yet.
+ # They'll get cached without the completed subgraphs. It's an edge case and I'm not aware of
+ # any nodes that use both subgraph expansion and custom UI outputs, but might be a problem in the future.
+ if len(uis) > 0:
+ ui = {k: [y for x in uis for y in x[k]] for k in uis[0].keys()}
+ return output, ui, has_subgraph
+
+def format_value(x):
+ if x is None:
+ return None
+ elif isinstance(x, (int, float, bool, str)):
+ return x
+ else:
+ return str(x)
+
+async def execute(server, dynprompt, caches, current_item, extra_data, executed, prompt_id, execution_list, pending_subgraph_results, pending_async_nodes, ui_outputs):
+ unique_id = current_item
+ real_node_id = dynprompt.get_real_node_id(unique_id)
+ display_node_id = dynprompt.get_display_node_id(unique_id)
+ parent_node_id = dynprompt.get_parent_node_id(unique_id)
+ inputs = dynprompt.get_node(unique_id)['inputs']
+ class_type = dynprompt.get_node(unique_id)['class_type']
+ class_def = nodes.NODE_CLASS_MAPPINGS[class_type]
+ cached = caches.outputs.get(unique_id)
+ if cached is not None:
+ if server.client_id is not None:
+ cached_ui = cached.ui or {}
+ server.send_sync("executed", { "node": unique_id, "display_node": display_node_id, "output": cached_ui.get("output",None), "prompt_id": prompt_id }, server.client_id)
+ if cached.ui is not None:
+ ui_outputs[unique_id] = cached.ui
+ get_progress_state().finish_progress(unique_id)
+ execution_list.cache_update(unique_id, cached)
+ return (ExecutionResult.SUCCESS, None, None)
+
+ input_data_all = None
+ try:
+ if unique_id in pending_async_nodes:
+ results = []
+ for r in pending_async_nodes[unique_id]:
+ if isinstance(r, asyncio.Task):
+ try:
+ results.append(r.result())
+ except Exception as ex:
+ # An async task failed - propagate the exception up
+ del pending_async_nodes[unique_id]
+ raise ex
+ else:
+ results.append(r)
+ del pending_async_nodes[unique_id]
+ output_data, output_ui, has_subgraph = get_output_from_returns(results, class_def)
+ elif unique_id in pending_subgraph_results:
+ cached_results = pending_subgraph_results[unique_id]
+ resolved_outputs = []
+ for is_subgraph, result in cached_results:
+ if not is_subgraph:
+ resolved_outputs.append(result)
+ else:
+ resolved_output = []
+ for r in result:
+ if is_link(r):
+ source_node, source_output = r[0], r[1]
+ node_cached = execution_list.get_cache(source_node, unique_id)
+ for o in node_cached.outputs[source_output]:
+ resolved_output.append(o)
+
+ else:
+ resolved_output.append(r)
+ resolved_outputs.append(tuple(resolved_output))
+ output_data = merge_result_data(resolved_outputs, class_def)
+ output_ui = []
+ del pending_subgraph_results[unique_id]
+ has_subgraph = False
+ else:
+ get_progress_state().start_progress(unique_id)
+ input_data_all, missing_keys, hidden_inputs = get_input_data(inputs, class_def, unique_id, execution_list, dynprompt, extra_data)
+ if server.client_id is not None:
+ server.last_node_id = display_node_id
+ server.send_sync("executing", { "node": unique_id, "display_node": display_node_id, "prompt_id": prompt_id }, server.client_id)
+
+ obj = caches.objects.get(unique_id)
+ if obj is None:
+ obj = class_def()
+ caches.objects.set(unique_id, obj)
+
+ if issubclass(class_def, _ComfyNodeInternal):
+ lazy_status_present = first_real_override(class_def, "check_lazy_status") is not None
+ else:
+ lazy_status_present = getattr(obj, "check_lazy_status", None) is not None
+ if lazy_status_present:
+ required_inputs = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, "check_lazy_status", allow_interrupt=True, hidden_inputs=hidden_inputs)
+ required_inputs = await resolve_map_node_over_list_results(required_inputs)
+ required_inputs = set(sum([r for r in required_inputs if isinstance(r,list)], []))
+ required_inputs = [x for x in required_inputs if isinstance(x,str) and (
+ x not in input_data_all or x in missing_keys
+ )]
+ if len(required_inputs) > 0:
+ for i in required_inputs:
+ execution_list.make_input_strong_link(unique_id, i)
+ return (ExecutionResult.PENDING, None, None)
+
+ def execution_block_cb(block):
+ if block.message is not None:
+ mes = {
+ "prompt_id": prompt_id,
+ "node_id": unique_id,
+ "node_type": class_type,
+ "executed": list(executed),
+
+ "exception_message": f"Execution Blocked: {block.message}",
+ "exception_type": "ExecutionBlocked",
+ "traceback": [],
+ "current_inputs": [],
+ "current_outputs": [],
+ }
+ server.send_sync("execution_error", mes, server.client_id)
+ return ExecutionBlocker(None)
+ else:
+ return block
+ def pre_execute_cb(call_index):
+ # TODO - How to handle this with async functions without contextvars (which requires Python 3.12)?
+ GraphBuilder.set_default_prefix(unique_id, call_index, 0)
+ output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
+ if has_pending_tasks:
+ pending_async_nodes[unique_id] = output_data
+ unblock = execution_list.add_external_block(unique_id)
+ async def await_completion():
+ tasks = [x for x in output_data if isinstance(x, asyncio.Task)]
+ await asyncio.gather(*tasks, return_exceptions=True)
+ unblock()
+ asyncio.create_task(await_completion())
+ return (ExecutionResult.PENDING, None, None)
+ if len(output_ui) > 0:
+ ui_outputs[unique_id] = {
+ "meta": {
+ "node_id": unique_id,
+ "display_node": display_node_id,
+ "parent_node": parent_node_id,
+ "real_node_id": real_node_id,
+ },
+ "output": output_ui
+ }
+ if server.client_id is not None:
+ server.send_sync("executed", { "node": unique_id, "display_node": display_node_id, "output": output_ui, "prompt_id": prompt_id }, server.client_id)
+ if has_subgraph:
+ cached_outputs = []
+ new_node_ids = []
+ new_output_ids = []
+ new_output_links = []
+ for i in range(len(output_data)):
+ new_graph, node_outputs = output_data[i]
+ if new_graph is None:
+ cached_outputs.append((False, node_outputs))
+ else:
+ for node_id, node_info in new_graph.items():
+ new_node_ids.append(node_id)
+ display_id = node_info.get("override_display_id", unique_id)
+ dynprompt.add_ephemeral_node(node_id, node_info, unique_id, display_id)
+ # Figure out if the newly created node is an output node
+ class_type = node_info["class_type"]
+ class_def = nodes.NODE_CLASS_MAPPINGS[class_type]
+ if hasattr(class_def, 'OUTPUT_NODE') and class_def.OUTPUT_NODE == True:
+ new_output_ids.append(node_id)
+ for i in range(len(node_outputs)):
+ if is_link(node_outputs[i]):
+ from_node_id, from_socket = node_outputs[i][0], node_outputs[i][1]
+ new_output_links.append((from_node_id, from_socket))
+ cached_outputs.append((True, node_outputs))
+ new_node_ids = set(new_node_ids)
+ for cache in caches.all:
+ subcache = await cache.ensure_subcache_for(unique_id, new_node_ids)
+ subcache.clean_unused()
+ for node_id in new_output_ids:
+ execution_list.add_node(node_id)
+ execution_list.cache_link(node_id, unique_id)
+ for link in new_output_links:
+ execution_list.add_strong_link(link[0], link[1], unique_id)
+ pending_subgraph_results[unique_id] = cached_outputs
+ return (ExecutionResult.PENDING, None, None)
+
+ cache_entry = CacheEntry(ui=ui_outputs.get(unique_id), outputs=output_data)
+ execution_list.cache_update(unique_id, cache_entry)
+ caches.outputs.set(unique_id, cache_entry)
+
+ except comfy.model_management.InterruptProcessingException as iex:
+ logging.info("Processing interrupted")
+
+ # skip formatting inputs/outputs
+ error_details = {
+ "node_id": real_node_id,
+ }
+
+ return (ExecutionResult.FAILURE, error_details, iex)
+ except Exception as ex:
+ typ, _, tb = sys.exc_info()
+ exception_type = full_type_name(typ)
+ input_data_formatted = {}
+ if input_data_all is not None:
+ input_data_formatted = {}
+ for name, inputs in input_data_all.items():
+ input_data_formatted[name] = [format_value(x) for x in inputs]
+
+ logging.error(f"!!! Exception during processing !!! {ex}")
+ logging.error(traceback.format_exc())
+ tips = ""
+
+ if isinstance(ex, comfy.model_management.OOM_EXCEPTION):
+ tips = "This error means you ran out of memory on your GPU.\n\nTIPS: If the workflow worked before you might have accidentally set the batch_size to a large number."
+ logging.error("Got an OOM, unloading all loaded models.")
+ comfy.model_management.unload_all_models()
+
+ error_details = {
+ "node_id": real_node_id,
+ "exception_message": "{}\n{}".format(ex, tips),
+ "exception_type": exception_type,
+ "traceback": traceback.format_tb(tb),
+ "current_inputs": input_data_formatted
+ }
+
+ return (ExecutionResult.FAILURE, error_details, ex)
+
+ get_progress_state().finish_progress(unique_id)
+ executed.add(unique_id)
+
+ return (ExecutionResult.SUCCESS, None, None)
+
+class PromptExecutor:
+ def __init__(self, server, cache_type=False, cache_args=None):
+ self.cache_args = cache_args
+ self.cache_type = cache_type
+ self.server = server
+ self.reset()
+
+ def reset(self):
+ self.caches = CacheSet(cache_type=self.cache_type, cache_args=self.cache_args)
+ self.status_messages = []
+ self.success = True
+
+ def add_message(self, event, data: dict, broadcast: bool):
+ data = {
+ **data,
+ "timestamp": int(time.time() * 1000),
+ }
+ self.status_messages.append((event, data))
+ if self.server.client_id is not None or broadcast:
+ self.server.send_sync(event, data, self.server.client_id)
+
+ def handle_execution_error(self, prompt_id, prompt, current_outputs, executed, error, ex):
+ node_id = error["node_id"]
+ class_type = prompt[node_id]["class_type"]
+
+ # First, send back the status to the frontend depending
+ # on the exception type
+ if isinstance(ex, comfy.model_management.InterruptProcessingException):
+ mes = {
+ "prompt_id": prompt_id,
+ "node_id": node_id,
+ "node_type": class_type,
+ "executed": list(executed),
+ }
+ self.add_message("execution_interrupted", mes, broadcast=True)
+ else:
+ mes = {
+ "prompt_id": prompt_id,
+ "node_id": node_id,
+ "node_type": class_type,
+ "executed": list(executed),
+ "exception_message": error["exception_message"],
+ "exception_type": error["exception_type"],
+ "traceback": error["traceback"],
+ "current_inputs": error["current_inputs"],
+ "current_outputs": list(current_outputs),
+ }
+ self.add_message("execution_error", mes, broadcast=False)
+
+ def execute(self, prompt, prompt_id, extra_data={}, execute_outputs=[]):
+ asyncio.run(self.execute_async(prompt, prompt_id, extra_data, execute_outputs))
+
+ async def execute_async(self, prompt, prompt_id, extra_data={}, execute_outputs=[]):
+ nodes.interrupt_processing(False)
+
+ if "client_id" in extra_data:
+ self.server.client_id = extra_data["client_id"]
+ else:
+ self.server.client_id = None
+
+ self.status_messages = []
+ self.add_message("execution_start", { "prompt_id": prompt_id}, broadcast=False)
+
+ with torch.inference_mode():
+ dynamic_prompt = DynamicPrompt(prompt)
+ reset_progress_state(prompt_id, dynamic_prompt)
+ add_progress_handler(WebUIProgressHandler(self.server))
+ is_changed_cache = IsChangedCache(prompt_id, dynamic_prompt, self.caches.outputs)
+ for cache in self.caches.all:
+ await cache.set_prompt(dynamic_prompt, prompt.keys(), is_changed_cache)
+ cache.clean_unused()
+
+ cached_nodes = []
+ for node_id in prompt:
+ if self.caches.outputs.get(node_id) is not None:
+ cached_nodes.append(node_id)
+
+ comfy.model_management.cleanup_models_gc()
+ self.add_message("execution_cached",
+ { "nodes": cached_nodes, "prompt_id": prompt_id},
+ broadcast=False)
+ pending_subgraph_results = {}
+ pending_async_nodes = {} # TODO - Unify this with pending_subgraph_results
+ ui_node_outputs = {}
+ executed = set()
+ execution_list = ExecutionList(dynamic_prompt, self.caches.outputs)
+ current_outputs = self.caches.outputs.all_node_ids()
+ for node_id in list(execute_outputs):
+ execution_list.add_node(node_id)
+
+ while not execution_list.is_empty():
+ node_id, error, ex = await execution_list.stage_node_execution()
+ if error is not None:
+ self.handle_execution_error(prompt_id, dynamic_prompt.original_prompt, current_outputs, executed, error, ex)
+ break
+
+ assert node_id is not None, "Node ID should not be None at this point"
+ result, error, ex = await execute(self.server, dynamic_prompt, self.caches, node_id, extra_data, executed, prompt_id, execution_list, pending_subgraph_results, pending_async_nodes, ui_node_outputs)
+ self.success = result != ExecutionResult.FAILURE
+ if result == ExecutionResult.FAILURE:
+ self.handle_execution_error(prompt_id, dynamic_prompt.original_prompt, current_outputs, executed, error, ex)
+ break
+ elif result == ExecutionResult.PENDING:
+ execution_list.unstage_node_execution()
+ else: # result == ExecutionResult.SUCCESS:
+ execution_list.complete_node_execution()
+ self.caches.outputs.poll(ram_headroom=self.cache_args["ram"])
+ else:
+ # Only execute when the while-loop ends without break
+ self.add_message("execution_success", { "prompt_id": prompt_id }, broadcast=False)
+
+ ui_outputs = {}
+ meta_outputs = {}
+ for node_id, ui_info in ui_node_outputs.items():
+ ui_outputs[node_id] = ui_info["output"]
+ meta_outputs[node_id] = ui_info["meta"]
+ self.history_result = {
+ "outputs": ui_outputs,
+ "meta": meta_outputs,
+ }
+ self.server.last_node_id = None
+ if comfy.model_management.DISABLE_SMART_MEMORY:
+ comfy.model_management.unload_all_models()
+
+
+async def validate_inputs(prompt_id, prompt, item, validated):
+ unique_id = item
+ if unique_id in validated:
+ return validated[unique_id]
+
+ inputs = prompt[unique_id]['inputs']
+ class_type = prompt[unique_id]['class_type']
+ obj_class = nodes.NODE_CLASS_MAPPINGS[class_type]
+
+ class_inputs = obj_class.INPUT_TYPES()
+ valid_inputs = set(class_inputs.get('required',{})).union(set(class_inputs.get('optional',{})))
+
+ errors = []
+ valid = True
+
+ validate_function_inputs = []
+ validate_has_kwargs = False
+ if issubclass(obj_class, _ComfyNodeInternal):
+ validate_function_name = "validate_inputs"
+ validate_function = first_real_override(obj_class, validate_function_name)
+ else:
+ validate_function_name = "VALIDATE_INPUTS"
+ validate_function = getattr(obj_class, validate_function_name, None)
+ if validate_function is not None:
+ argspec = inspect.getfullargspec(validate_function)
+ validate_function_inputs = argspec.args
+ validate_has_kwargs = argspec.varkw is not None
+ received_types = {}
+
+ for x in valid_inputs:
+ input_type, input_category, extra_info = get_input_info(obj_class, x, class_inputs)
+ assert extra_info is not None
+ if x not in inputs:
+ if input_category == "required":
+ error = {
+ "type": "required_input_missing",
+ "message": "Required input is missing",
+ "details": f"{x}",
+ "extra_info": {
+ "input_name": x
+ }
+ }
+ errors.append(error)
+ continue
+
+ val = inputs[x]
+ info = (input_type, extra_info)
+ if isinstance(val, list):
+ if len(val) != 2:
+ error = {
+ "type": "bad_linked_input",
+ "message": "Bad linked input, must be a length-2 list of [node_id, slot_index]",
+ "details": f"{x}",
+ "extra_info": {
+ "input_name": x,
+ "input_config": info,
+ "received_value": val
+ }
+ }
+ errors.append(error)
+ continue
+
+ o_id = val[0]
+ o_class_type = prompt[o_id]['class_type']
+ r = nodes.NODE_CLASS_MAPPINGS[o_class_type].RETURN_TYPES
+ received_type = r[val[1]]
+ received_types[x] = received_type
+ if 'input_types' not in validate_function_inputs and not validate_node_input(received_type, input_type):
+ details = f"{x}, received_type({received_type}) mismatch input_type({input_type})"
+ error = {
+ "type": "return_type_mismatch",
+ "message": "Return type mismatch between linked nodes",
+ "details": details,
+ "extra_info": {
+ "input_name": x,
+ "input_config": info,
+ "received_type": received_type,
+ "linked_node": val
+ }
+ }
+ errors.append(error)
+ continue
+ try:
+ r = await validate_inputs(prompt_id, prompt, o_id, validated)
+ if r[0] is False:
+ # `r` will be set in `validated[o_id]` already
+ valid = False
+ continue
+ except Exception as ex:
+ typ, _, tb = sys.exc_info()
+ valid = False
+ exception_type = full_type_name(typ)
+ reasons = [{
+ "type": "exception_during_inner_validation",
+ "message": "Exception when validating inner node",
+ "details": str(ex),
+ "extra_info": {
+ "input_name": x,
+ "input_config": info,
+ "exception_message": str(ex),
+ "exception_type": exception_type,
+ "traceback": traceback.format_tb(tb),
+ "linked_node": val
+ }
+ }]
+ validated[o_id] = (False, reasons, o_id)
+ continue
+ else:
+ try:
+ # Unwraps values wrapped in __value__ key. This is used to pass
+ # list widget value to execution, as by default list value is
+ # reserved to represent the connection between nodes.
+ if isinstance(val, dict) and "__value__" in val:
+ val = val["__value__"]
+ inputs[x] = val
+
+ if input_type == "INT":
+ val = int(val)
+ inputs[x] = val
+ if input_type == "FLOAT":
+ val = float(val)
+ inputs[x] = val
+ if input_type == "STRING":
+ val = str(val)
+ inputs[x] = val
+ if input_type == "BOOLEAN":
+ val = bool(val)
+ inputs[x] = val
+ except Exception as ex:
+ error = {
+ "type": "invalid_input_type",
+ "message": f"Failed to convert an input value to a {input_type} value",
+ "details": f"{x}, {val}, {ex}",
+ "extra_info": {
+ "input_name": x,
+ "input_config": info,
+ "received_value": val,
+ "exception_message": str(ex)
+ }
+ }
+ errors.append(error)
+ continue
+
+ if x not in validate_function_inputs and not validate_has_kwargs:
+ if "min" in extra_info and val < extra_info["min"]:
+ error = {
+ "type": "value_smaller_than_min",
+ "message": "Value {} smaller than min of {}".format(val, extra_info["min"]),
+ "details": f"{x}",
+ "extra_info": {
+ "input_name": x,
+ "input_config": info,
+ "received_value": val,
+ }
+ }
+ errors.append(error)
+ continue
+ if "max" in extra_info and val > extra_info["max"]:
+ error = {
+ "type": "value_bigger_than_max",
+ "message": "Value {} bigger than max of {}".format(val, extra_info["max"]),
+ "details": f"{x}",
+ "extra_info": {
+ "input_name": x,
+ "input_config": info,
+ "received_value": val,
+ }
+ }
+ errors.append(error)
+ continue
+
+ if isinstance(input_type, list):
+ combo_options = input_type
+ if val not in combo_options:
+ input_config = info
+ list_info = ""
+
+ # Don't send back gigantic lists like if they're lots of
+ # scanned model filepaths
+ if len(combo_options) > 20:
+ list_info = f"(list of length {len(combo_options)})"
+ input_config = None
+ else:
+ list_info = str(combo_options)
+
+ error = {
+ "type": "value_not_in_list",
+ "message": "Value not in list",
+ "details": f"{x}: '{val}' not in {list_info}",
+ "extra_info": {
+ "input_name": x,
+ "input_config": input_config,
+ "received_value": val,
+ }
+ }
+ errors.append(error)
+ continue
+
+ if len(validate_function_inputs) > 0 or validate_has_kwargs:
+ input_data_all, _, hidden_inputs = get_input_data(inputs, obj_class, unique_id)
+ input_filtered = {}
+ for x in input_data_all:
+ if x in validate_function_inputs or validate_has_kwargs:
+ input_filtered[x] = input_data_all[x]
+ if 'input_types' in validate_function_inputs:
+ input_filtered['input_types'] = [received_types]
+
+ ret = await _async_map_node_over_list(prompt_id, unique_id, obj_class, input_filtered, validate_function_name, hidden_inputs=hidden_inputs)
+ ret = await resolve_map_node_over_list_results(ret)
+ for x in input_filtered:
+ for i, r in enumerate(ret):
+ if r is not True and not isinstance(r, ExecutionBlocker):
+ details = f"{x}"
+ if r is not False:
+ details += f" - {str(r)}"
+
+ error = {
+ "type": "custom_validation_failed",
+ "message": "Custom validation failed for node",
+ "details": details,
+ "extra_info": {
+ "input_name": x,
+ }
+ }
+ errors.append(error)
+ continue
+
+ if len(errors) > 0 or valid is not True:
+ ret = (False, errors, unique_id)
+ else:
+ ret = (True, [], unique_id)
+
+ validated[unique_id] = ret
+ return ret
+
+def full_type_name(klass):
+ module = klass.__module__
+ if module == 'builtins':
+ return klass.__qualname__
+ return module + '.' + klass.__qualname__
+
+async def validate_prompt(prompt_id, prompt, partial_execution_list: Union[list[str], None]):
+ outputs = set()
+ for x in prompt:
+ if 'class_type' not in prompt[x]:
+ error = {
+ "type": "invalid_prompt",
+ "message": "Cannot execute because a node is missing the class_type property.",
+ "details": f"Node ID '#{x}'",
+ "extra_info": {}
+ }
+ return (False, error, [], {})
+
+ class_type = prompt[x]['class_type']
+ class_ = nodes.NODE_CLASS_MAPPINGS.get(class_type, None)
+ if class_ is None:
+ error = {
+ "type": "invalid_prompt",
+ "message": f"Cannot execute because node {class_type} does not exist.",
+ "details": f"Node ID '#{x}'",
+ "extra_info": {}
+ }
+ return (False, error, [], {})
+
+ if hasattr(class_, 'OUTPUT_NODE') and class_.OUTPUT_NODE is True:
+ if partial_execution_list is None or x in partial_execution_list:
+ outputs.add(x)
+
+ if len(outputs) == 0:
+ error = {
+ "type": "prompt_no_outputs",
+ "message": "Prompt has no outputs",
+ "details": "",
+ "extra_info": {}
+ }
+ return (False, error, [], {})
+
+ good_outputs = set()
+ errors = []
+ node_errors = {}
+ validated = {}
+ for o in outputs:
+ valid = False
+ reasons = []
+ try:
+ m = await validate_inputs(prompt_id, prompt, o, validated)
+ valid = m[0]
+ reasons = m[1]
+ except Exception as ex:
+ typ, _, tb = sys.exc_info()
+ valid = False
+ exception_type = full_type_name(typ)
+ reasons = [{
+ "type": "exception_during_validation",
+ "message": "Exception when validating node",
+ "details": str(ex),
+ "extra_info": {
+ "exception_type": exception_type,
+ "traceback": traceback.format_tb(tb)
+ }
+ }]
+ validated[o] = (False, reasons, o)
+
+ if valid is True:
+ good_outputs.add(o)
+ else:
+ logging.error(f"Failed to validate prompt for output {o}:")
+ if len(reasons) > 0:
+ logging.error("* (prompt):")
+ for reason in reasons:
+ logging.error(f" - {reason['message']}: {reason['details']}")
+ errors += [(o, reasons)]
+ for node_id, result in validated.items():
+ valid = result[0]
+ reasons = result[1]
+ # If a node upstream has errors, the nodes downstream will also
+ # be reported as invalid, but there will be no errors attached.
+ # So don't return those nodes as having errors in the response.
+ if valid is not True and len(reasons) > 0:
+ if node_id not in node_errors:
+ class_type = prompt[node_id]['class_type']
+ node_errors[node_id] = {
+ "errors": reasons,
+ "dependent_outputs": [],
+ "class_type": class_type
+ }
+ logging.error(f"* {class_type} {node_id}:")
+ for reason in reasons:
+ logging.error(f" - {reason['message']}: {reason['details']}")
+ node_errors[node_id]["dependent_outputs"].append(o)
+ logging.error("Output will be ignored")
+
+ if len(good_outputs) == 0:
+ errors_list = []
+ for o, errors in errors:
+ for error in errors:
+ errors_list.append(f"{error['message']}: {error['details']}")
+ errors_list = "\n".join(errors_list)
+
+ error = {
+ "type": "prompt_outputs_failed_validation",
+ "message": "Prompt outputs failed validation",
+ "details": errors_list,
+ "extra_info": {}
+ }
+
+ return (False, error, list(good_outputs), node_errors)
+
+ return (True, None, list(good_outputs), node_errors)
+
+MAXIMUM_HISTORY_SIZE = 10000
+
+class PromptQueue:
+ def __init__(self, server):
+ self.server = server
+ self.mutex = threading.RLock()
+ self.not_empty = threading.Condition(self.mutex)
+ self.task_counter = 0
+ self.queue = []
+ self.currently_running = {}
+ self.history = {}
+ self.flags = {}
+
+ def put(self, item):
+ with self.mutex:
+ heapq.heappush(self.queue, item)
+ self.server.queue_updated()
+ self.not_empty.notify()
+
+ def get(self, timeout=None):
+ with self.not_empty:
+ while len(self.queue) == 0:
+ self.not_empty.wait(timeout=timeout)
+ if timeout is not None and len(self.queue) == 0:
+ return None
+ item = heapq.heappop(self.queue)
+ i = self.task_counter
+ self.currently_running[i] = copy.deepcopy(item)
+ self.task_counter += 1
+ self.server.queue_updated()
+ return (item, i)
+
+ class ExecutionStatus(NamedTuple):
+ status_str: Literal['success', 'error']
+ completed: bool
+ messages: List[str]
+
+ def task_done(self, item_id, history_result,
+ status: Optional['PromptQueue.ExecutionStatus'], process_item=None):
+ with self.mutex:
+ prompt = self.currently_running.pop(item_id)
+ if len(self.history) > MAXIMUM_HISTORY_SIZE:
+ self.history.pop(next(iter(self.history)))
+
+ status_dict: Optional[dict] = None
+ if status is not None:
+ status_dict = copy.deepcopy(status._asdict())
+
+ if process_item is not None:
+ prompt = process_item(prompt)
+
+ self.history[prompt[1]] = {
+ "prompt": prompt,
+ "outputs": {},
+ 'status': status_dict,
+ }
+ self.history[prompt[1]].update(history_result)
+ self.server.queue_updated()
+
+ # Note: slow
+ def get_current_queue(self):
+ with self.mutex:
+ out = []
+ for x in self.currently_running.values():
+ out += [x]
+ return (out, copy.deepcopy(self.queue))
+
+ # read-safe as long as queue items are immutable
+ def get_current_queue_volatile(self):
+ with self.mutex:
+ running = [x for x in self.currently_running.values()]
+ queued = copy.copy(self.queue)
+ return (running, queued)
+
+ def get_tasks_remaining(self):
+ with self.mutex:
+ return len(self.queue) + len(self.currently_running)
+
+ def wipe_queue(self):
+ with self.mutex:
+ self.queue = []
+ self.server.queue_updated()
+
+ def delete_queue_item(self, function):
+ with self.mutex:
+ for x in range(len(self.queue)):
+ if function(self.queue[x]):
+ if len(self.queue) == 1:
+ self.wipe_queue()
+ else:
+ self.queue.pop(x)
+ heapq.heapify(self.queue)
+ self.server.queue_updated()
+ return True
+ return False
+
+ def get_history(self, prompt_id=None, max_items=None, offset=-1, map_function=None):
+ with self.mutex:
+ if prompt_id is None:
+ out = {}
+ i = 0
+ if offset < 0 and max_items is not None:
+ offset = len(self.history) - max_items
+ for k in self.history:
+ if i >= offset:
+ p = self.history[k]
+ if map_function is not None:
+ p = map_function(p)
+ out[k] = p
+ if max_items is not None and len(out) >= max_items:
+ break
+ i += 1
+ return out
+ elif prompt_id in self.history:
+ p = self.history[prompt_id]
+ if map_function is None:
+ p = copy.deepcopy(p)
+ else:
+ p = map_function(p)
+ return {prompt_id: p}
+ else:
+ return {}
+
+ def wipe_history(self):
+ with self.mutex:
+ self.history = {}
+
+ def delete_history_item(self, id_to_delete):
+ with self.mutex:
+ self.history.pop(id_to_delete, None)
+
+ def set_flag(self, name, data):
+ with self.mutex:
+ self.flags[name] = data
+ self.not_empty.notify()
+
+ def get_flags(self, reset=True):
+ with self.mutex:
+ if reset:
+ ret = self.flags
+ self.flags = {}
+ return ret
+ else:
+ return self.flags.copy()
diff --git a/docs/hel-892/separation-reference/core-0.3.71__nodes.py b/docs/hel-892/separation-reference/core-0.3.71__nodes.py
new file mode 100644
index 00000000..f023ae3b
--- /dev/null
+++ b/docs/hel-892/separation-reference/core-0.3.71__nodes.py
@@ -0,0 +1,2430 @@
+from __future__ import annotations
+import torch
+
+
+import os
+import sys
+import json
+import hashlib
+import inspect
+import traceback
+import math
+import time
+import random
+import logging
+
+from PIL import Image, ImageOps, ImageSequence
+from PIL.PngImagePlugin import PngInfo
+
+import numpy as np
+import safetensors.torch
+
+sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "comfy"))
+
+import comfy.diffusers_load
+import comfy.samplers
+import comfy.sample
+import comfy.sd
+import comfy.utils
+import comfy.controlnet
+from comfy.comfy_types import IO, ComfyNodeABC, InputTypeDict, FileLocator
+from comfy_api.internal import register_versions, ComfyAPIWithVersion
+from comfy_api.version_list import supported_versions
+from comfy_api.latest import io, ComfyExtension
+
+import comfy.clip_vision
+
+import comfy.model_management
+from comfy.cli_args import args
+
+import importlib
+
+import folder_paths
+import latent_preview
+import node_helpers
+
+def before_node_execution():
+ comfy.model_management.throw_exception_if_processing_interrupted()
+
+def interrupt_processing(value=True):
+ comfy.model_management.interrupt_current_processing(value)
+
+MAX_RESOLUTION=16384
+
+class CLIPTextEncode(ComfyNodeABC):
+ @classmethod
+ def INPUT_TYPES(s) -> InputTypeDict:
+ return {
+ "required": {
+ "text": (IO.STRING, {"multiline": True, "dynamicPrompts": True, "tooltip": "The text to be encoded."}),
+ "clip": (IO.CLIP, {"tooltip": "The CLIP model used for encoding the text."})
+ }
+ }
+ RETURN_TYPES = (IO.CONDITIONING,)
+ OUTPUT_TOOLTIPS = ("A conditioning containing the embedded text used to guide the diffusion model.",)
+ FUNCTION = "encode"
+
+ CATEGORY = "conditioning"
+ DESCRIPTION = "Encodes a text prompt using a CLIP model into an embedding that can be used to guide the diffusion model towards generating specific images."
+
+ def encode(self, clip, text):
+ if clip is None:
+ raise RuntimeError("ERROR: clip input is invalid: None\n\nIf the clip is from a checkpoint loader node your checkpoint does not contain a valid clip or text encoder model.")
+ tokens = clip.tokenize(text)
+ return (clip.encode_from_tokens_scheduled(tokens), )
+
+
+class ConditioningCombine:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning_1": ("CONDITIONING", ), "conditioning_2": ("CONDITIONING", )}}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "combine"
+
+ CATEGORY = "conditioning"
+
+ def combine(self, conditioning_1, conditioning_2):
+ return (conditioning_1 + conditioning_2, )
+
+class ConditioningAverage :
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning_to": ("CONDITIONING", ), "conditioning_from": ("CONDITIONING", ),
+ "conditioning_to_strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01})
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "addWeighted"
+
+ CATEGORY = "conditioning"
+
+ def addWeighted(self, conditioning_to, conditioning_from, conditioning_to_strength):
+ out = []
+
+ if len(conditioning_from) > 1:
+ logging.warning("Warning: ConditioningAverage conditioning_from contains more than 1 cond, only the first one will actually be applied to conditioning_to.")
+
+ cond_from = conditioning_from[0][0]
+ pooled_output_from = conditioning_from[0][1].get("pooled_output", None)
+
+ for i in range(len(conditioning_to)):
+ t1 = conditioning_to[i][0]
+ pooled_output_to = conditioning_to[i][1].get("pooled_output", pooled_output_from)
+ t0 = cond_from[:,:t1.shape[1]]
+ if t0.shape[1] < t1.shape[1]:
+ t0 = torch.cat([t0] + [torch.zeros((1, (t1.shape[1] - t0.shape[1]), t1.shape[2]))], dim=1)
+
+ tw = torch.mul(t1, conditioning_to_strength) + torch.mul(t0, (1.0 - conditioning_to_strength))
+ t_to = conditioning_to[i][1].copy()
+ if pooled_output_from is not None and pooled_output_to is not None:
+ t_to["pooled_output"] = torch.mul(pooled_output_to, conditioning_to_strength) + torch.mul(pooled_output_from, (1.0 - conditioning_to_strength))
+ elif pooled_output_from is not None:
+ t_to["pooled_output"] = pooled_output_from
+
+ n = [tw, t_to]
+ out.append(n)
+ return (out, )
+
+class ConditioningConcat:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {
+ "conditioning_to": ("CONDITIONING",),
+ "conditioning_from": ("CONDITIONING",),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "concat"
+
+ CATEGORY = "conditioning"
+
+ def concat(self, conditioning_to, conditioning_from):
+ out = []
+
+ if len(conditioning_from) > 1:
+ logging.warning("Warning: ConditioningConcat conditioning_from contains more than 1 cond, only the first one will actually be applied to conditioning_to.")
+
+ cond_from = conditioning_from[0][0]
+
+ for i in range(len(conditioning_to)):
+ t1 = conditioning_to[i][0]
+ tw = torch.cat((t1, cond_from),1)
+ n = [tw, conditioning_to[i][1].copy()]
+ out.append(n)
+
+ return (out, )
+
+class ConditioningSetArea:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "width": ("INT", {"default": 64, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
+ "height": ("INT", {"default": 64, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
+ "x": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "y": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "append"
+
+ CATEGORY = "conditioning"
+
+ def append(self, conditioning, width, height, x, y, strength):
+ c = node_helpers.conditioning_set_values(conditioning, {"area": (height // 8, width // 8, y // 8, x // 8),
+ "strength": strength,
+ "set_area_to_bounds": False})
+ return (c, )
+
+class ConditioningSetAreaPercentage:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "width": ("FLOAT", {"default": 1.0, "min": 0, "max": 1.0, "step": 0.01}),
+ "height": ("FLOAT", {"default": 1.0, "min": 0, "max": 1.0, "step": 0.01}),
+ "x": ("FLOAT", {"default": 0, "min": 0, "max": 1.0, "step": 0.01}),
+ "y": ("FLOAT", {"default": 0, "min": 0, "max": 1.0, "step": 0.01}),
+ "strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "append"
+
+ CATEGORY = "conditioning"
+
+ def append(self, conditioning, width, height, x, y, strength):
+ c = node_helpers.conditioning_set_values(conditioning, {"area": ("percentage", height, width, y, x),
+ "strength": strength,
+ "set_area_to_bounds": False})
+ return (c, )
+
+class ConditioningSetAreaStrength:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "append"
+
+ CATEGORY = "conditioning"
+
+ def append(self, conditioning, strength):
+ c = node_helpers.conditioning_set_values(conditioning, {"strength": strength})
+ return (c, )
+
+
+class ConditioningSetMask:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "mask": ("MASK", ),
+ "strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
+ "set_cond_area": (["default", "mask bounds"],),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "append"
+
+ CATEGORY = "conditioning"
+
+ def append(self, conditioning, mask, set_cond_area, strength):
+ set_area_to_bounds = False
+ if set_cond_area != "default":
+ set_area_to_bounds = True
+ if len(mask.shape) < 3:
+ mask = mask.unsqueeze(0)
+
+ c = node_helpers.conditioning_set_values(conditioning, {"mask": mask,
+ "set_area_to_bounds": set_area_to_bounds,
+ "mask_strength": strength})
+ return (c, )
+
+class ConditioningZeroOut:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", )}}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "zero_out"
+
+ CATEGORY = "advanced/conditioning"
+
+ def zero_out(self, conditioning):
+ c = []
+ for t in conditioning:
+ d = t[1].copy()
+ pooled_output = d.get("pooled_output", None)
+ if pooled_output is not None:
+ d["pooled_output"] = torch.zeros_like(pooled_output)
+ conditioning_lyrics = d.get("conditioning_lyrics", None)
+ if conditioning_lyrics is not None:
+ d["conditioning_lyrics"] = torch.zeros_like(conditioning_lyrics)
+ n = [torch.zeros_like(t[0]), d]
+ c.append(n)
+ return (c, )
+
+class ConditioningSetTimestepRange:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "start": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 1.0, "step": 0.001}),
+ "end": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.001})
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "set_range"
+
+ CATEGORY = "advanced/conditioning"
+
+ def set_range(self, conditioning, start, end):
+ c = node_helpers.conditioning_set_values(conditioning, {"start_percent": start,
+ "end_percent": end})
+ return (c, )
+
+class VAEDecode:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "samples": ("LATENT", {"tooltip": "The latent to be decoded."}),
+ "vae": ("VAE", {"tooltip": "The VAE model used for decoding the latent."})
+ }
+ }
+ RETURN_TYPES = ("IMAGE",)
+ OUTPUT_TOOLTIPS = ("The decoded image.",)
+ FUNCTION = "decode"
+
+ CATEGORY = "latent"
+ DESCRIPTION = "Decodes latent images back into pixel space images."
+
+ def decode(self, vae, samples):
+ images = vae.decode(samples["samples"])
+ if len(images.shape) == 5: #Combine batches
+ images = images.reshape(-1, images.shape[-3], images.shape[-2], images.shape[-1])
+ return (images, )
+
+class VAEDecodeTiled:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"samples": ("LATENT", ), "vae": ("VAE", ),
+ "tile_size": ("INT", {"default": 512, "min": 64, "max": 4096, "step": 32}),
+ "overlap": ("INT", {"default": 64, "min": 0, "max": 4096, "step": 32}),
+ "temporal_size": ("INT", {"default": 64, "min": 8, "max": 4096, "step": 4, "tooltip": "Only used for video VAEs: Amount of frames to decode at a time."}),
+ "temporal_overlap": ("INT", {"default": 8, "min": 4, "max": 4096, "step": 4, "tooltip": "Only used for video VAEs: Amount of frames to overlap."}),
+ }}
+ RETURN_TYPES = ("IMAGE",)
+ FUNCTION = "decode"
+
+ CATEGORY = "_for_testing"
+
+ def decode(self, vae, samples, tile_size, overlap=64, temporal_size=64, temporal_overlap=8):
+ if tile_size < overlap * 4:
+ overlap = tile_size // 4
+ if temporal_size < temporal_overlap * 2:
+ temporal_overlap = temporal_overlap // 2
+ temporal_compression = vae.temporal_compression_decode()
+ if temporal_compression is not None:
+ temporal_size = max(2, temporal_size // temporal_compression)
+ temporal_overlap = max(1, min(temporal_size // 2, temporal_overlap // temporal_compression))
+ else:
+ temporal_size = None
+ temporal_overlap = None
+
+ compression = vae.spacial_compression_decode()
+ images = vae.decode_tiled(samples["samples"], tile_x=tile_size // compression, tile_y=tile_size // compression, overlap=overlap // compression, tile_t=temporal_size, overlap_t=temporal_overlap)
+ if len(images.shape) == 5: #Combine batches
+ images = images.reshape(-1, images.shape[-3], images.shape[-2], images.shape[-1])
+ return (images, )
+
+class VAEEncode:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "pixels": ("IMAGE", ), "vae": ("VAE", )}}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "encode"
+
+ CATEGORY = "latent"
+
+ def encode(self, vae, pixels):
+ t = vae.encode(pixels[:,:,:,:3])
+ return ({"samples":t}, )
+
+class VAEEncodeTiled:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"pixels": ("IMAGE", ), "vae": ("VAE", ),
+ "tile_size": ("INT", {"default": 512, "min": 64, "max": 4096, "step": 64}),
+ "overlap": ("INT", {"default": 64, "min": 0, "max": 4096, "step": 32}),
+ "temporal_size": ("INT", {"default": 64, "min": 8, "max": 4096, "step": 4, "tooltip": "Only used for video VAEs: Amount of frames to encode at a time."}),
+ "temporal_overlap": ("INT", {"default": 8, "min": 4, "max": 4096, "step": 4, "tooltip": "Only used for video VAEs: Amount of frames to overlap."}),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "encode"
+
+ CATEGORY = "_for_testing"
+
+ def encode(self, vae, pixels, tile_size, overlap, temporal_size=64, temporal_overlap=8):
+ t = vae.encode_tiled(pixels[:,:,:,:3], tile_x=tile_size, tile_y=tile_size, overlap=overlap, tile_t=temporal_size, overlap_t=temporal_overlap)
+ return ({"samples": t}, )
+
+class VAEEncodeForInpaint:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "pixels": ("IMAGE", ), "vae": ("VAE", ), "mask": ("MASK", ), "grow_mask_by": ("INT", {"default": 6, "min": 0, "max": 64, "step": 1}),}}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "encode"
+
+ CATEGORY = "latent/inpaint"
+
+ def encode(self, vae, pixels, mask, grow_mask_by=6):
+ x = (pixels.shape[1] // vae.downscale_ratio) * vae.downscale_ratio
+ y = (pixels.shape[2] // vae.downscale_ratio) * vae.downscale_ratio
+ mask = torch.nn.functional.interpolate(mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1])), size=(pixels.shape[1], pixels.shape[2]), mode="bilinear")
+
+ pixels = pixels.clone()
+ if pixels.shape[1] != x or pixels.shape[2] != y:
+ x_offset = (pixels.shape[1] % vae.downscale_ratio) // 2
+ y_offset = (pixels.shape[2] % vae.downscale_ratio) // 2
+ pixels = pixels[:,x_offset:x + x_offset, y_offset:y + y_offset,:]
+ mask = mask[:,:,x_offset:x + x_offset, y_offset:y + y_offset]
+
+ #grow mask by a few pixels to keep things seamless in latent space
+ if grow_mask_by == 0:
+ mask_erosion = mask
+ else:
+ kernel_tensor = torch.ones((1, 1, grow_mask_by, grow_mask_by))
+ padding = math.ceil((grow_mask_by - 1) / 2)
+
+ mask_erosion = torch.clamp(torch.nn.functional.conv2d(mask.round(), kernel_tensor, padding=padding), 0, 1)
+
+ m = (1.0 - mask.round()).squeeze(1)
+ for i in range(3):
+ pixels[:,:,:,i] -= 0.5
+ pixels[:,:,:,i] *= m
+ pixels[:,:,:,i] += 0.5
+ t = vae.encode(pixels)
+
+ return ({"samples":t, "noise_mask": (mask_erosion[:,:,:x,:y].round())}, )
+
+
+class InpaintModelConditioning:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"positive": ("CONDITIONING", ),
+ "negative": ("CONDITIONING", ),
+ "vae": ("VAE", ),
+ "pixels": ("IMAGE", ),
+ "mask": ("MASK", ),
+ "noise_mask": ("BOOLEAN", {"default": True, "tooltip": "Add a noise mask to the latent so sampling will only happen within the mask. Might improve results or completely break things depending on the model."}),
+ }}
+
+ RETURN_TYPES = ("CONDITIONING","CONDITIONING","LATENT")
+ RETURN_NAMES = ("positive", "negative", "latent")
+ FUNCTION = "encode"
+
+ CATEGORY = "conditioning/inpaint"
+
+ def encode(self, positive, negative, pixels, vae, mask, noise_mask=True):
+ x = (pixels.shape[1] // 8) * 8
+ y = (pixels.shape[2] // 8) * 8
+ mask = torch.nn.functional.interpolate(mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1])), size=(pixels.shape[1], pixels.shape[2]), mode="bilinear")
+
+ orig_pixels = pixels
+ pixels = orig_pixels.clone()
+ if pixels.shape[1] != x or pixels.shape[2] != y:
+ x_offset = (pixels.shape[1] % 8) // 2
+ y_offset = (pixels.shape[2] % 8) // 2
+ pixels = pixels[:,x_offset:x + x_offset, y_offset:y + y_offset,:]
+ mask = mask[:,:,x_offset:x + x_offset, y_offset:y + y_offset]
+
+ m = (1.0 - mask.round()).squeeze(1)
+ for i in range(3):
+ pixels[:,:,:,i] -= 0.5
+ pixels[:,:,:,i] *= m
+ pixels[:,:,:,i] += 0.5
+ concat_latent = vae.encode(pixels)
+ orig_latent = vae.encode(orig_pixels)
+
+ out_latent = {}
+
+ out_latent["samples"] = orig_latent
+ if noise_mask:
+ out_latent["noise_mask"] = mask
+
+ out = []
+ for conditioning in [positive, negative]:
+ c = node_helpers.conditioning_set_values(conditioning, {"concat_latent_image": concat_latent,
+ "concat_mask": mask})
+ out.append(c)
+ return (out[0], out[1], out_latent)
+
+
+class SaveLatent:
+ def __init__(self):
+ self.output_dir = folder_paths.get_output_directory()
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT", ),
+ "filename_prefix": ("STRING", {"default": "latents/ComfyUI"})},
+ "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
+ }
+ RETURN_TYPES = ()
+ FUNCTION = "save"
+
+ OUTPUT_NODE = True
+
+ CATEGORY = "_for_testing"
+
+ def save(self, samples, filename_prefix="ComfyUI", prompt=None, extra_pnginfo=None):
+ full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(filename_prefix, self.output_dir)
+
+ # support save metadata for latent sharing
+ prompt_info = ""
+ if prompt is not None:
+ prompt_info = json.dumps(prompt)
+
+ metadata = None
+ if not args.disable_metadata:
+ metadata = {"prompt": prompt_info}
+ if extra_pnginfo is not None:
+ for x in extra_pnginfo:
+ metadata[x] = json.dumps(extra_pnginfo[x])
+
+ file = f"{filename}_{counter:05}_.latent"
+
+ results: list[FileLocator] = []
+ results.append({
+ "filename": file,
+ "subfolder": subfolder,
+ "type": "output"
+ })
+
+ file = os.path.join(full_output_folder, file)
+
+ output = {}
+ output["latent_tensor"] = samples["samples"].contiguous()
+ output["latent_format_version_0"] = torch.tensor([])
+
+ comfy.utils.save_torch_file(output, file, metadata=metadata)
+ return { "ui": { "latents": results } }
+
+
+class LoadLatent:
+ @classmethod
+ def INPUT_TYPES(s):
+ input_dir = folder_paths.get_input_directory()
+ files = [f for f in os.listdir(input_dir) if os.path.isfile(os.path.join(input_dir, f)) and f.endswith(".latent")]
+ return {"required": {"latent": [sorted(files), ]}, }
+
+ CATEGORY = "_for_testing"
+
+ RETURN_TYPES = ("LATENT", )
+ FUNCTION = "load"
+
+ def load(self, latent):
+ latent_path = folder_paths.get_annotated_filepath(latent)
+ latent = safetensors.torch.load_file(latent_path, device="cpu")
+ multiplier = 1.0
+ if "latent_format_version_0" not in latent:
+ multiplier = 1.0 / 0.18215
+ samples = {"samples": latent["latent_tensor"].float() * multiplier}
+ return (samples, )
+
+ @classmethod
+ def IS_CHANGED(s, latent):
+ image_path = folder_paths.get_annotated_filepath(latent)
+ m = hashlib.sha256()
+ with open(image_path, 'rb') as f:
+ m.update(f.read())
+ return m.digest().hex()
+
+ @classmethod
+ def VALIDATE_INPUTS(s, latent):
+ if not folder_paths.exists_annotated_filepath(latent):
+ return "Invalid latent file: {}".format(latent)
+ return True
+
+
+class CheckpointLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "config_name": (folder_paths.get_filename_list("configs"), ),
+ "ckpt_name": (folder_paths.get_filename_list("checkpoints"), )}}
+ RETURN_TYPES = ("MODEL", "CLIP", "VAE")
+ FUNCTION = "load_checkpoint"
+
+ CATEGORY = "advanced/loaders"
+ DEPRECATED = True
+
+ def load_checkpoint(self, config_name, ckpt_name):
+ config_path = folder_paths.get_full_path("configs", config_name)
+ ckpt_path = folder_paths.get_full_path_or_raise("checkpoints", ckpt_name)
+ return comfy.sd.load_checkpoint(config_path, ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
+
+class CheckpointLoaderSimple:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "ckpt_name": (folder_paths.get_filename_list("checkpoints"), {"tooltip": "The name of the checkpoint (model) to load."}),
+ }
+ }
+ RETURN_TYPES = ("MODEL", "CLIP", "VAE")
+ OUTPUT_TOOLTIPS = ("The model used for denoising latents.",
+ "The CLIP model used for encoding text prompts.",
+ "The VAE model used for encoding and decoding images to and from latent space.")
+ FUNCTION = "load_checkpoint"
+
+ CATEGORY = "loaders"
+ DESCRIPTION = "Loads a diffusion model checkpoint, diffusion models are used to denoise latents."
+
+ def load_checkpoint(self, ckpt_name):
+ ckpt_path = folder_paths.get_full_path_or_raise("checkpoints", ckpt_name)
+ out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
+ return out[:3]
+
+class DiffusersLoader:
+ @classmethod
+ def INPUT_TYPES(cls):
+ paths = []
+ for search_path in folder_paths.get_folder_paths("diffusers"):
+ if os.path.exists(search_path):
+ for root, subdir, files in os.walk(search_path, followlinks=True):
+ if "model_index.json" in files:
+ paths.append(os.path.relpath(root, start=search_path))
+
+ return {"required": {"model_path": (paths,), }}
+ RETURN_TYPES = ("MODEL", "CLIP", "VAE")
+ FUNCTION = "load_checkpoint"
+
+ CATEGORY = "advanced/loaders/deprecated"
+
+ def load_checkpoint(self, model_path, output_vae=True, output_clip=True):
+ for search_path in folder_paths.get_folder_paths("diffusers"):
+ if os.path.exists(search_path):
+ path = os.path.join(search_path, model_path)
+ if os.path.exists(path):
+ model_path = path
+ break
+
+ return comfy.diffusers_load.load_diffusers(model_path, output_vae=output_vae, output_clip=output_clip, embedding_directory=folder_paths.get_folder_paths("embeddings"))
+
+
+class unCLIPCheckpointLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "ckpt_name": (folder_paths.get_filename_list("checkpoints"), ),
+ }}
+ RETURN_TYPES = ("MODEL", "CLIP", "VAE", "CLIP_VISION")
+ FUNCTION = "load_checkpoint"
+
+ CATEGORY = "loaders"
+
+ def load_checkpoint(self, ckpt_name, output_vae=True, output_clip=True):
+ ckpt_path = folder_paths.get_full_path_or_raise("checkpoints", ckpt_name)
+ out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, output_clipvision=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
+ return out
+
+class CLIPSetLastLayer:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "clip": ("CLIP", ),
+ "stop_at_clip_layer": ("INT", {"default": -1, "min": -24, "max": -1, "step": 1}),
+ }}
+ RETURN_TYPES = ("CLIP",)
+ FUNCTION = "set_last_layer"
+
+ CATEGORY = "conditioning"
+
+ def set_last_layer(self, clip, stop_at_clip_layer):
+ clip = clip.clone()
+ clip.clip_layer(stop_at_clip_layer)
+ return (clip,)
+
+class LoraLoader:
+ def __init__(self):
+ self.loaded_lora = None
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "model": ("MODEL", {"tooltip": "The diffusion model the LoRA will be applied to."}),
+ "clip": ("CLIP", {"tooltip": "The CLIP model the LoRA will be applied to."}),
+ "lora_name": (folder_paths.get_filename_list("loras"), {"tooltip": "The name of the LoRA."}),
+ "strength_model": ("FLOAT", {"default": 1.0, "min": -100.0, "max": 100.0, "step": 0.01, "tooltip": "How strongly to modify the diffusion model. This value can be negative."}),
+ "strength_clip": ("FLOAT", {"default": 1.0, "min": -100.0, "max": 100.0, "step": 0.01, "tooltip": "How strongly to modify the CLIP model. This value can be negative."}),
+ }
+ }
+
+ RETURN_TYPES = ("MODEL", "CLIP")
+ OUTPUT_TOOLTIPS = ("The modified diffusion model.", "The modified CLIP model.")
+ FUNCTION = "load_lora"
+
+ CATEGORY = "loaders"
+ DESCRIPTION = "LoRAs are used to modify diffusion and CLIP models, altering the way in which latents are denoised such as applying styles. Multiple LoRA nodes can be linked together."
+
+ def load_lora(self, model, clip, lora_name, strength_model, strength_clip):
+ if strength_model == 0 and strength_clip == 0:
+ return (model, clip)
+
+ lora_path = folder_paths.get_full_path_or_raise("loras", lora_name)
+ lora = None
+ if self.loaded_lora is not None:
+ if self.loaded_lora[0] == lora_path:
+ lora = self.loaded_lora[1]
+ else:
+ self.loaded_lora = None
+
+ if lora is None:
+ lora = comfy.utils.load_torch_file(lora_path, safe_load=True)
+ self.loaded_lora = (lora_path, lora)
+
+ model_lora, clip_lora = comfy.sd.load_lora_for_models(model, clip, lora, strength_model, strength_clip)
+ return (model_lora, clip_lora)
+
+class LoraLoaderModelOnly(LoraLoader):
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "model": ("MODEL",),
+ "lora_name": (folder_paths.get_filename_list("loras"), ),
+ "strength_model": ("FLOAT", {"default": 1.0, "min": -100.0, "max": 100.0, "step": 0.01}),
+ }}
+ RETURN_TYPES = ("MODEL",)
+ FUNCTION = "load_lora_model_only"
+
+ def load_lora_model_only(self, model, lora_name, strength_model):
+ return (self.load_lora(model, None, lora_name, strength_model, 0)[0],)
+
+class VAELoader:
+ @staticmethod
+ def vae_list():
+ vaes = folder_paths.get_filename_list("vae")
+ approx_vaes = folder_paths.get_filename_list("vae_approx")
+ sdxl_taesd_enc = False
+ sdxl_taesd_dec = False
+ sd1_taesd_enc = False
+ sd1_taesd_dec = False
+ sd3_taesd_enc = False
+ sd3_taesd_dec = False
+ f1_taesd_enc = False
+ f1_taesd_dec = False
+
+ for v in approx_vaes:
+ if v.startswith("taesd_decoder."):
+ sd1_taesd_dec = True
+ elif v.startswith("taesd_encoder."):
+ sd1_taesd_enc = True
+ elif v.startswith("taesdxl_decoder."):
+ sdxl_taesd_dec = True
+ elif v.startswith("taesdxl_encoder."):
+ sdxl_taesd_enc = True
+ elif v.startswith("taesd3_decoder."):
+ sd3_taesd_dec = True
+ elif v.startswith("taesd3_encoder."):
+ sd3_taesd_enc = True
+ elif v.startswith("taef1_encoder."):
+ f1_taesd_dec = True
+ elif v.startswith("taef1_decoder."):
+ f1_taesd_enc = True
+ if sd1_taesd_dec and sd1_taesd_enc:
+ vaes.append("taesd")
+ if sdxl_taesd_dec and sdxl_taesd_enc:
+ vaes.append("taesdxl")
+ if sd3_taesd_dec and sd3_taesd_enc:
+ vaes.append("taesd3")
+ if f1_taesd_dec and f1_taesd_enc:
+ vaes.append("taef1")
+ vaes.append("pixel_space")
+ return vaes
+
+ @staticmethod
+ def load_taesd(name):
+ sd = {}
+ approx_vaes = folder_paths.get_filename_list("vae_approx")
+
+ encoder = next(filter(lambda a: a.startswith("{}_encoder.".format(name)), approx_vaes))
+ decoder = next(filter(lambda a: a.startswith("{}_decoder.".format(name)), approx_vaes))
+
+ enc = comfy.utils.load_torch_file(folder_paths.get_full_path_or_raise("vae_approx", encoder))
+ for k in enc:
+ sd["taesd_encoder.{}".format(k)] = enc[k]
+
+ dec = comfy.utils.load_torch_file(folder_paths.get_full_path_or_raise("vae_approx", decoder))
+ for k in dec:
+ sd["taesd_decoder.{}".format(k)] = dec[k]
+
+ if name == "taesd":
+ sd["vae_scale"] = torch.tensor(0.18215)
+ sd["vae_shift"] = torch.tensor(0.0)
+ elif name == "taesdxl":
+ sd["vae_scale"] = torch.tensor(0.13025)
+ sd["vae_shift"] = torch.tensor(0.0)
+ elif name == "taesd3":
+ sd["vae_scale"] = torch.tensor(1.5305)
+ sd["vae_shift"] = torch.tensor(0.0609)
+ elif name == "taef1":
+ sd["vae_scale"] = torch.tensor(0.3611)
+ sd["vae_shift"] = torch.tensor(0.1159)
+ return sd
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "vae_name": (s.vae_list(), )}}
+ RETURN_TYPES = ("VAE",)
+ FUNCTION = "load_vae"
+
+ CATEGORY = "loaders"
+
+ #TODO: scale factor?
+ def load_vae(self, vae_name):
+ if vae_name == "pixel_space":
+ sd = {}
+ sd["pixel_space_vae"] = torch.tensor(1.0)
+ elif vae_name in ["taesd", "taesdxl", "taesd3", "taef1"]:
+ sd = self.load_taesd(vae_name)
+ else:
+ vae_path = folder_paths.get_full_path_or_raise("vae", vae_name)
+ sd = comfy.utils.load_torch_file(vae_path)
+ vae = comfy.sd.VAE(sd=sd)
+ vae.throw_exception_if_invalid()
+ return (vae,)
+
+class ControlNetLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "control_net_name": (folder_paths.get_filename_list("controlnet"), )}}
+
+ RETURN_TYPES = ("CONTROL_NET",)
+ FUNCTION = "load_controlnet"
+
+ CATEGORY = "loaders"
+
+ def load_controlnet(self, control_net_name):
+ controlnet_path = folder_paths.get_full_path_or_raise("controlnet", control_net_name)
+ controlnet = comfy.controlnet.load_controlnet(controlnet_path)
+ if controlnet is None:
+ raise RuntimeError("ERROR: controlnet file is invalid and does not contain a valid controlnet model.")
+ return (controlnet,)
+
+class DiffControlNetLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "model": ("MODEL",),
+ "control_net_name": (folder_paths.get_filename_list("controlnet"), )}}
+
+ RETURN_TYPES = ("CONTROL_NET",)
+ FUNCTION = "load_controlnet"
+
+ CATEGORY = "loaders"
+
+ def load_controlnet(self, model, control_net_name):
+ controlnet_path = folder_paths.get_full_path_or_raise("controlnet", control_net_name)
+ controlnet = comfy.controlnet.load_controlnet(controlnet_path, model)
+ return (controlnet,)
+
+
+class ControlNetApply:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "control_net": ("CONTROL_NET", ),
+ "image": ("IMAGE", ),
+ "strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01})
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "apply_controlnet"
+
+ DEPRECATED = True
+ CATEGORY = "conditioning/controlnet"
+
+ def apply_controlnet(self, conditioning, control_net, image, strength):
+ if strength == 0:
+ return (conditioning, )
+
+ c = []
+ control_hint = image.movedim(-1,1)
+ for t in conditioning:
+ n = [t[0], t[1].copy()]
+ c_net = control_net.copy().set_cond_hint(control_hint, strength)
+ if 'control' in t[1]:
+ c_net.set_previous_controlnet(t[1]['control'])
+ n[1]['control'] = c_net
+ n[1]['control_apply_to_uncond'] = True
+ c.append(n)
+ return (c, )
+
+
+class ControlNetApplyAdvanced:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"positive": ("CONDITIONING", ),
+ "negative": ("CONDITIONING", ),
+ "control_net": ("CONTROL_NET", ),
+ "image": ("IMAGE", ),
+ "strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
+ "start_percent": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 1.0, "step": 0.001}),
+ "end_percent": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.001})
+ },
+ "optional": {"vae": ("VAE", ),
+ }
+ }
+
+ RETURN_TYPES = ("CONDITIONING","CONDITIONING")
+ RETURN_NAMES = ("positive", "negative")
+ FUNCTION = "apply_controlnet"
+
+ CATEGORY = "conditioning/controlnet"
+
+ def apply_controlnet(self, positive, negative, control_net, image, strength, start_percent, end_percent, vae=None, extra_concat=[]):
+ if strength == 0:
+ return (positive, negative)
+
+ control_hint = image.movedim(-1,1)
+ cnets = {}
+
+ out = []
+ for conditioning in [positive, negative]:
+ c = []
+ for t in conditioning:
+ d = t[1].copy()
+
+ prev_cnet = d.get('control', None)
+ if prev_cnet in cnets:
+ c_net = cnets[prev_cnet]
+ else:
+ c_net = control_net.copy().set_cond_hint(control_hint, strength, (start_percent, end_percent), vae=vae, extra_concat=extra_concat)
+ c_net.set_previous_controlnet(prev_cnet)
+ cnets[prev_cnet] = c_net
+
+ d['control'] = c_net
+ d['control_apply_to_uncond'] = False
+ n = [t[0], d]
+ c.append(n)
+ out.append(c)
+ return (out[0], out[1])
+
+
+class UNETLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "unet_name": (folder_paths.get_filename_list("diffusion_models"), ),
+ "weight_dtype": (["default", "fp8_e4m3fn", "fp8_e4m3fn_fast", "fp8_e5m2"],)
+ }}
+ RETURN_TYPES = ("MODEL",)
+ FUNCTION = "load_unet"
+
+ CATEGORY = "advanced/loaders"
+
+ def load_unet(self, unet_name, weight_dtype):
+ model_options = {}
+ if weight_dtype == "fp8_e4m3fn":
+ model_options["dtype"] = torch.float8_e4m3fn
+ elif weight_dtype == "fp8_e4m3fn_fast":
+ model_options["dtype"] = torch.float8_e4m3fn
+ model_options["fp8_optimizations"] = True
+ elif weight_dtype == "fp8_e5m2":
+ model_options["dtype"] = torch.float8_e5m2
+
+ unet_path = folder_paths.get_full_path_or_raise("diffusion_models", unet_name)
+ model = comfy.sd.load_diffusion_model(unet_path, model_options=model_options)
+ return (model,)
+
+class CLIPLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "clip_name": (folder_paths.get_filename_list("text_encoders"), ),
+ "type": (["stable_diffusion", "stable_cascade", "sd3", "stable_audio", "mochi", "ltxv", "pixart", "cosmos", "lumina2", "wan", "hidream", "chroma", "ace", "omnigen2", "qwen_image", "hunyuan_image"], ),
+ },
+ "optional": {
+ "device": (["default", "cpu"], {"advanced": True}),
+ }}
+ RETURN_TYPES = ("CLIP",)
+ FUNCTION = "load_clip"
+
+ CATEGORY = "advanced/loaders"
+
+ DESCRIPTION = "[Recipes]\n\nstable_diffusion: clip-l\nstable_cascade: clip-g\nsd3: t5 xxl/ clip-g / clip-l\nstable_audio: t5 base\nmochi: t5 xxl\ncosmos: old t5 xxl\nlumina2: gemma 2 2B\nwan: umt5 xxl\n hidream: llama-3.1 (Recommend) or t5\nomnigen2: qwen vl 2.5 3B"
+
+ def load_clip(self, clip_name, type="stable_diffusion", device="default"):
+ clip_type = getattr(comfy.sd.CLIPType, type.upper(), comfy.sd.CLIPType.STABLE_DIFFUSION)
+
+ model_options = {}
+ if device == "cpu":
+ model_options["load_device"] = model_options["offload_device"] = torch.device("cpu")
+
+ clip_path = folder_paths.get_full_path_or_raise("text_encoders", clip_name)
+ clip = comfy.sd.load_clip(ckpt_paths=[clip_path], embedding_directory=folder_paths.get_folder_paths("embeddings"), clip_type=clip_type, model_options=model_options)
+ return (clip,)
+
+class DualCLIPLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "clip_name1": (folder_paths.get_filename_list("text_encoders"), ),
+ "clip_name2": (folder_paths.get_filename_list("text_encoders"), ),
+ "type": (["sdxl", "sd3", "flux", "hunyuan_video", "hidream", "hunyuan_image", "hunyuan_video_15"], ),
+ },
+ "optional": {
+ "device": (["default", "cpu"], {"advanced": True}),
+ }}
+ RETURN_TYPES = ("CLIP",)
+ FUNCTION = "load_clip"
+
+ CATEGORY = "advanced/loaders"
+
+ DESCRIPTION = "[Recipes]\n\nsdxl: clip-l, clip-g\nsd3: clip-l, clip-g / clip-l, t5 / clip-g, t5\nflux: clip-l, t5\nhidream: at least one of t5 or llama, recommended t5 and llama\nhunyuan_image: qwen2.5vl 7b and byt5 small"
+
+ def load_clip(self, clip_name1, clip_name2, type, device="default"):
+ clip_type = getattr(comfy.sd.CLIPType, type.upper(), comfy.sd.CLIPType.STABLE_DIFFUSION)
+
+ clip_path1 = folder_paths.get_full_path_or_raise("text_encoders", clip_name1)
+ clip_path2 = folder_paths.get_full_path_or_raise("text_encoders", clip_name2)
+
+ model_options = {}
+ if device == "cpu":
+ model_options["load_device"] = model_options["offload_device"] = torch.device("cpu")
+
+ clip = comfy.sd.load_clip(ckpt_paths=[clip_path1, clip_path2], embedding_directory=folder_paths.get_folder_paths("embeddings"), clip_type=clip_type, model_options=model_options)
+ return (clip,)
+
+class CLIPVisionLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "clip_name": (folder_paths.get_filename_list("clip_vision"), ),
+ }}
+ RETURN_TYPES = ("CLIP_VISION",)
+ FUNCTION = "load_clip"
+
+ CATEGORY = "loaders"
+
+ def load_clip(self, clip_name):
+ clip_path = folder_paths.get_full_path_or_raise("clip_vision", clip_name)
+ clip_vision = comfy.clip_vision.load(clip_path)
+ if clip_vision is None:
+ raise RuntimeError("ERROR: clip vision file is invalid and does not contain a valid vision model.")
+ return (clip_vision,)
+
+class CLIPVisionEncode:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "clip_vision": ("CLIP_VISION",),
+ "image": ("IMAGE",),
+ "crop": (["center", "none"],)
+ }}
+ RETURN_TYPES = ("CLIP_VISION_OUTPUT",)
+ FUNCTION = "encode"
+
+ CATEGORY = "conditioning"
+
+ def encode(self, clip_vision, image, crop):
+ crop_image = True
+ if crop != "center":
+ crop_image = False
+ output = clip_vision.encode_image(image, crop=crop_image)
+ return (output,)
+
+class StyleModelLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "style_model_name": (folder_paths.get_filename_list("style_models"), )}}
+
+ RETURN_TYPES = ("STYLE_MODEL",)
+ FUNCTION = "load_style_model"
+
+ CATEGORY = "loaders"
+
+ def load_style_model(self, style_model_name):
+ style_model_path = folder_paths.get_full_path_or_raise("style_models", style_model_name)
+ style_model = comfy.sd.load_style_model(style_model_path)
+ return (style_model,)
+
+
+class StyleModelApply:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "style_model": ("STYLE_MODEL", ),
+ "clip_vision_output": ("CLIP_VISION_OUTPUT", ),
+ "strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.001}),
+ "strength_type": (["multiply", "attn_bias"], ),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "apply_stylemodel"
+
+ CATEGORY = "conditioning/style_model"
+
+ def apply_stylemodel(self, conditioning, style_model, clip_vision_output, strength, strength_type):
+ cond = style_model.get_cond(clip_vision_output).flatten(start_dim=0, end_dim=1).unsqueeze(dim=0)
+ if strength_type == "multiply":
+ cond *= strength
+
+ n = cond.shape[1]
+ c_out = []
+ for t in conditioning:
+ (txt, keys) = t
+ keys = keys.copy()
+ # even if the strength is 1.0 (i.e, no change), if there's already a mask, we have to add to it
+ if "attention_mask" in keys or (strength_type == "attn_bias" and strength != 1.0):
+ # math.log raises an error if the argument is zero
+ # torch.log returns -inf, which is what we want
+ attn_bias = torch.log(torch.Tensor([strength if strength_type == "attn_bias" else 1.0]))
+ # get the size of the mask image
+ mask_ref_size = keys.get("attention_mask_img_shape", (1, 1))
+ n_ref = mask_ref_size[0] * mask_ref_size[1]
+ n_txt = txt.shape[1]
+ # grab the existing mask
+ mask = keys.get("attention_mask", None)
+ # create a default mask if it doesn't exist
+ if mask is None:
+ mask = torch.zeros((txt.shape[0], n_txt + n_ref, n_txt + n_ref), dtype=torch.float16)
+ # convert the mask dtype, because it might be boolean
+ # we want it to be interpreted as a bias
+ if mask.dtype == torch.bool:
+ # log(True) = log(1) = 0
+ # log(False) = log(0) = -inf
+ mask = torch.log(mask.to(dtype=torch.float16))
+ # now we make the mask bigger to add space for our new tokens
+ new_mask = torch.zeros((txt.shape[0], n_txt + n + n_ref, n_txt + n + n_ref), dtype=torch.float16)
+ # copy over the old mask, in quandrants
+ new_mask[:, :n_txt, :n_txt] = mask[:, :n_txt, :n_txt]
+ new_mask[:, :n_txt, n_txt+n:] = mask[:, :n_txt, n_txt:]
+ new_mask[:, n_txt+n:, :n_txt] = mask[:, n_txt:, :n_txt]
+ new_mask[:, n_txt+n:, n_txt+n:] = mask[:, n_txt:, n_txt:]
+ # now fill in the attention bias to our redux tokens
+ new_mask[:, :n_txt, n_txt:n_txt+n] = attn_bias
+ new_mask[:, n_txt+n:, n_txt:n_txt+n] = attn_bias
+ keys["attention_mask"] = new_mask.to(txt.device)
+ keys["attention_mask_img_shape"] = mask_ref_size
+
+ c_out.append([torch.cat((txt, cond), dim=1), keys])
+
+ return (c_out,)
+
+class unCLIPConditioning:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "clip_vision_output": ("CLIP_VISION_OUTPUT", ),
+ "strength": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
+ "noise_augmentation": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 1.0, "step": 0.01}),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "apply_adm"
+
+ CATEGORY = "conditioning"
+
+ def apply_adm(self, conditioning, clip_vision_output, strength, noise_augmentation):
+ if strength == 0:
+ return (conditioning, )
+
+ c = node_helpers.conditioning_set_values(conditioning, {"unclip_conditioning": [{"clip_vision_output": clip_vision_output, "strength": strength, "noise_augmentation": noise_augmentation}]}, append=True)
+ return (c, )
+
+class GLIGENLoader:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "gligen_name": (folder_paths.get_filename_list("gligen"), )}}
+
+ RETURN_TYPES = ("GLIGEN",)
+ FUNCTION = "load_gligen"
+
+ CATEGORY = "loaders"
+
+ def load_gligen(self, gligen_name):
+ gligen_path = folder_paths.get_full_path_or_raise("gligen", gligen_name)
+ gligen = comfy.sd.load_gligen(gligen_path)
+ return (gligen,)
+
+class GLIGENTextBoxApply:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning_to": ("CONDITIONING", ),
+ "clip": ("CLIP", ),
+ "gligen_textbox_model": ("GLIGEN", ),
+ "text": ("STRING", {"multiline": True, "dynamicPrompts": True}),
+ "width": ("INT", {"default": 64, "min": 8, "max": MAX_RESOLUTION, "step": 8}),
+ "height": ("INT", {"default": 64, "min": 8, "max": MAX_RESOLUTION, "step": 8}),
+ "x": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "y": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "append"
+
+ CATEGORY = "conditioning/gligen"
+
+ def append(self, conditioning_to, clip, gligen_textbox_model, text, width, height, x, y):
+ c = []
+ cond, cond_pooled = clip.encode_from_tokens(clip.tokenize(text), return_pooled="unprojected")
+ for t in conditioning_to:
+ n = [t[0], t[1].copy()]
+ position_params = [(cond_pooled, height // 8, width // 8, y // 8, x // 8)]
+ prev = []
+ if "gligen" in n[1]:
+ prev = n[1]['gligen'][2]
+
+ n[1]['gligen'] = ("position", gligen_textbox_model, prev + position_params)
+ c.append(n)
+ return (c, )
+
+class EmptyLatentImage:
+ def __init__(self):
+ self.device = comfy.model_management.intermediate_device()
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "width": ("INT", {"default": 512, "min": 16, "max": MAX_RESOLUTION, "step": 8, "tooltip": "The width of the latent images in pixels."}),
+ "height": ("INT", {"default": 512, "min": 16, "max": MAX_RESOLUTION, "step": 8, "tooltip": "The height of the latent images in pixels."}),
+ "batch_size": ("INT", {"default": 1, "min": 1, "max": 4096, "tooltip": "The number of latent images in the batch."})
+ }
+ }
+ RETURN_TYPES = ("LATENT",)
+ OUTPUT_TOOLTIPS = ("The empty latent image batch.",)
+ FUNCTION = "generate"
+
+ CATEGORY = "latent"
+ DESCRIPTION = "Create a new batch of empty latent images to be denoised via sampling."
+
+ def generate(self, width, height, batch_size=1):
+ latent = torch.zeros([batch_size, 4, height // 8, width // 8], device=self.device)
+ return ({"samples":latent}, )
+
+
+class LatentFromBatch:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT",),
+ "batch_index": ("INT", {"default": 0, "min": 0, "max": 63}),
+ "length": ("INT", {"default": 1, "min": 1, "max": 64}),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "frombatch"
+
+ CATEGORY = "latent/batch"
+
+ def frombatch(self, samples, batch_index, length):
+ s = samples.copy()
+ s_in = samples["samples"]
+ batch_index = min(s_in.shape[0] - 1, batch_index)
+ length = min(s_in.shape[0] - batch_index, length)
+ s["samples"] = s_in[batch_index:batch_index + length].clone()
+ if "noise_mask" in samples:
+ masks = samples["noise_mask"]
+ if masks.shape[0] == 1:
+ s["noise_mask"] = masks.clone()
+ else:
+ if masks.shape[0] < s_in.shape[0]:
+ masks = masks.repeat(math.ceil(s_in.shape[0] / masks.shape[0]), 1, 1, 1)[:s_in.shape[0]]
+ s["noise_mask"] = masks[batch_index:batch_index + length].clone()
+ if "batch_index" not in s:
+ s["batch_index"] = [x for x in range(batch_index, batch_index+length)]
+ else:
+ s["batch_index"] = samples["batch_index"][batch_index:batch_index + length]
+ return (s,)
+
+class RepeatLatentBatch:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT",),
+ "amount": ("INT", {"default": 1, "min": 1, "max": 64}),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "repeat"
+
+ CATEGORY = "latent/batch"
+
+ def repeat(self, samples, amount):
+ s = samples.copy()
+ s_in = samples["samples"]
+
+ s["samples"] = s_in.repeat((amount,) + ((1,) * (s_in.ndim - 1)))
+ if "noise_mask" in samples and samples["noise_mask"].shape[0] > 1:
+ masks = samples["noise_mask"]
+ if masks.shape[0] < s_in.shape[0]:
+ masks = masks.repeat((math.ceil(s_in.shape[0] / masks.shape[0]),) + ((1,) * (masks.ndim - 1)))[:s_in.shape[0]]
+ s["noise_mask"] = samples["noise_mask"].repeat((amount,) + ((1,) * (samples["noise_mask"].ndim - 1)))
+ if "batch_index" in s:
+ offset = max(s["batch_index"]) - min(s["batch_index"]) + 1
+ s["batch_index"] = s["batch_index"] + [x + (i * offset) for i in range(1, amount) for x in s["batch_index"]]
+ return (s,)
+
+class LatentUpscale:
+ upscale_methods = ["nearest-exact", "bilinear", "area", "bicubic", "bislerp"]
+ crop_methods = ["disabled", "center"]
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT",), "upscale_method": (s.upscale_methods,),
+ "width": ("INT", {"default": 512, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "height": ("INT", {"default": 512, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "crop": (s.crop_methods,)}}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "upscale"
+
+ CATEGORY = "latent"
+
+ def upscale(self, samples, upscale_method, width, height, crop):
+ if width == 0 and height == 0:
+ s = samples
+ else:
+ s = samples.copy()
+
+ if width == 0:
+ height = max(64, height)
+ width = max(64, round(samples["samples"].shape[-1] * height / samples["samples"].shape[-2]))
+ elif height == 0:
+ width = max(64, width)
+ height = max(64, round(samples["samples"].shape[-2] * width / samples["samples"].shape[-1]))
+ else:
+ width = max(64, width)
+ height = max(64, height)
+
+ s["samples"] = comfy.utils.common_upscale(samples["samples"], width // 8, height // 8, upscale_method, crop)
+ return (s,)
+
+class LatentUpscaleBy:
+ upscale_methods = ["nearest-exact", "bilinear", "area", "bicubic", "bislerp"]
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT",), "upscale_method": (s.upscale_methods,),
+ "scale_by": ("FLOAT", {"default": 1.5, "min": 0.01, "max": 8.0, "step": 0.01}),}}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "upscale"
+
+ CATEGORY = "latent"
+
+ def upscale(self, samples, upscale_method, scale_by):
+ s = samples.copy()
+ width = round(samples["samples"].shape[-1] * scale_by)
+ height = round(samples["samples"].shape[-2] * scale_by)
+ s["samples"] = comfy.utils.common_upscale(samples["samples"], width, height, upscale_method, "disabled")
+ return (s,)
+
+class LatentRotate:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT",),
+ "rotation": (["none", "90 degrees", "180 degrees", "270 degrees"],),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "rotate"
+
+ CATEGORY = "latent/transform"
+
+ def rotate(self, samples, rotation):
+ s = samples.copy()
+ rotate_by = 0
+ if rotation.startswith("90"):
+ rotate_by = 1
+ elif rotation.startswith("180"):
+ rotate_by = 2
+ elif rotation.startswith("270"):
+ rotate_by = 3
+
+ s["samples"] = torch.rot90(samples["samples"], k=rotate_by, dims=[3, 2])
+ return (s,)
+
+class LatentFlip:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT",),
+ "flip_method": (["x-axis: vertically", "y-axis: horizontally"],),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "flip"
+
+ CATEGORY = "latent/transform"
+
+ def flip(self, samples, flip_method):
+ s = samples.copy()
+ if flip_method.startswith("x"):
+ s["samples"] = torch.flip(samples["samples"], dims=[2])
+ elif flip_method.startswith("y"):
+ s["samples"] = torch.flip(samples["samples"], dims=[3])
+
+ return (s,)
+
+class LatentComposite:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples_to": ("LATENT",),
+ "samples_from": ("LATENT",),
+ "x": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "y": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "feather": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "composite"
+
+ CATEGORY = "latent"
+
+ def composite(self, samples_to, samples_from, x, y, composite_method="normal", feather=0):
+ x = x // 8
+ y = y // 8
+ feather = feather // 8
+ samples_out = samples_to.copy()
+ s = samples_to["samples"].clone()
+ samples_to = samples_to["samples"]
+ samples_from = samples_from["samples"]
+ if feather == 0:
+ s[:,:,y:y+samples_from.shape[2],x:x+samples_from.shape[3]] = samples_from[:,:,:samples_to.shape[2] - y, :samples_to.shape[3] - x]
+ else:
+ samples_from = samples_from[:,:,:samples_to.shape[2] - y, :samples_to.shape[3] - x]
+ mask = torch.ones_like(samples_from)
+ for t in range(feather):
+ if y != 0:
+ mask[:,:,t:1+t,:] *= ((1.0/feather) * (t + 1))
+
+ if y + samples_from.shape[2] < samples_to.shape[2]:
+ mask[:,:,mask.shape[2] -1 -t: mask.shape[2]-t,:] *= ((1.0/feather) * (t + 1))
+ if x != 0:
+ mask[:,:,:,t:1+t] *= ((1.0/feather) * (t + 1))
+ if x + samples_from.shape[3] < samples_to.shape[3]:
+ mask[:,:,:,mask.shape[3]- 1 - t: mask.shape[3]- t] *= ((1.0/feather) * (t + 1))
+ rev_mask = torch.ones_like(mask) - mask
+ s[:,:,y:y+samples_from.shape[2],x:x+samples_from.shape[3]] = samples_from[:,:,:samples_to.shape[2] - y, :samples_to.shape[3] - x] * mask + s[:,:,y:y+samples_from.shape[2],x:x+samples_from.shape[3]] * rev_mask
+ samples_out["samples"] = s
+ return (samples_out,)
+
+class LatentBlend:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {
+ "samples1": ("LATENT",),
+ "samples2": ("LATENT",),
+ "blend_factor": ("FLOAT", {
+ "default": 0.5,
+ "min": 0,
+ "max": 1,
+ "step": 0.01
+ }),
+ }}
+
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "blend"
+
+ CATEGORY = "_for_testing"
+
+ def blend(self, samples1, samples2, blend_factor:float, blend_mode: str="normal"):
+
+ samples_out = samples1.copy()
+ samples1 = samples1["samples"]
+ samples2 = samples2["samples"]
+
+ if samples1.shape != samples2.shape:
+ samples2.permute(0, 3, 1, 2)
+ samples2 = comfy.utils.common_upscale(samples2, samples1.shape[3], samples1.shape[2], 'bicubic', crop='center')
+ samples2.permute(0, 2, 3, 1)
+
+ samples_blended = self.blend_mode(samples1, samples2, blend_mode)
+ samples_blended = samples1 * blend_factor + samples_blended * (1 - blend_factor)
+ samples_out["samples"] = samples_blended
+ return (samples_out,)
+
+ def blend_mode(self, img1, img2, mode):
+ if mode == "normal":
+ return img2
+ else:
+ raise ValueError(f"Unsupported blend mode: {mode}")
+
+class LatentCrop:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT",),
+ "width": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
+ "height": ("INT", {"default": 512, "min": 64, "max": MAX_RESOLUTION, "step": 8}),
+ "x": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "y": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "crop"
+
+ CATEGORY = "latent/transform"
+
+ def crop(self, samples, width, height, x, y):
+ s = samples.copy()
+ samples = samples['samples']
+ x = x // 8
+ y = y // 8
+
+ #enfonce minimum size of 64
+ if x > (samples.shape[3] - 8):
+ x = samples.shape[3] - 8
+ if y > (samples.shape[2] - 8):
+ y = samples.shape[2] - 8
+
+ new_height = height // 8
+ new_width = width // 8
+ to_x = new_width + x
+ to_y = new_height + y
+ s['samples'] = samples[:,:,y:to_y, x:to_x]
+ return (s,)
+
+class SetLatentNoiseMask:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "samples": ("LATENT",),
+ "mask": ("MASK",),
+ }}
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "set_mask"
+
+ CATEGORY = "latent/inpaint"
+
+ def set_mask(self, samples, mask):
+ s = samples.copy()
+ s["noise_mask"] = mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1]))
+ return (s,)
+
+def common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent, denoise=1.0, disable_noise=False, start_step=None, last_step=None, force_full_denoise=False):
+ latent_image = latent["samples"]
+ latent_image = comfy.sample.fix_empty_latent_channels(model, latent_image)
+
+ if disable_noise:
+ noise = torch.zeros(latent_image.size(), dtype=latent_image.dtype, layout=latent_image.layout, device="cpu")
+ else:
+ batch_inds = latent["batch_index"] if "batch_index" in latent else None
+ noise = comfy.sample.prepare_noise(latent_image, seed, batch_inds)
+
+ noise_mask = None
+ if "noise_mask" in latent:
+ noise_mask = latent["noise_mask"]
+
+ callback = latent_preview.prepare_callback(model, steps)
+ disable_pbar = not comfy.utils.PROGRESS_BAR_ENABLED
+ samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
+ denoise=denoise, disable_noise=disable_noise, start_step=start_step, last_step=last_step,
+ force_full_denoise=force_full_denoise, noise_mask=noise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
+ out = latent.copy()
+ out["samples"] = samples
+ return (out, )
+
+class KSampler:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "model": ("MODEL", {"tooltip": "The model used for denoising the input latent."}),
+ "seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff, "control_after_generate": True, "tooltip": "The random seed used for creating the noise."}),
+ "steps": ("INT", {"default": 20, "min": 1, "max": 10000, "tooltip": "The number of steps used in the denoising process."}),
+ "cfg": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0, "step":0.1, "round": 0.01, "tooltip": "The Classifier-Free Guidance scale balances creativity and adherence to the prompt. Higher values result in images more closely matching the prompt however too high values will negatively impact quality."}),
+ "sampler_name": (comfy.samplers.KSampler.SAMPLERS, {"tooltip": "The algorithm used when sampling, this can affect the quality, speed, and style of the generated output."}),
+ "scheduler": (comfy.samplers.KSampler.SCHEDULERS, {"tooltip": "The scheduler controls how noise is gradually removed to form the image."}),
+ "positive": ("CONDITIONING", {"tooltip": "The conditioning describing the attributes you want to include in the image."}),
+ "negative": ("CONDITIONING", {"tooltip": "The conditioning describing the attributes you want to exclude from the image."}),
+ "latent_image": ("LATENT", {"tooltip": "The latent image to denoise."}),
+ "denoise": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01, "tooltip": "The amount of denoising applied, lower values will maintain the structure of the initial image allowing for image to image sampling."}),
+ }
+ }
+
+ RETURN_TYPES = ("LATENT",)
+ OUTPUT_TOOLTIPS = ("The denoised latent.",)
+ FUNCTION = "sample"
+
+ CATEGORY = "sampling"
+ DESCRIPTION = "Uses the provided model, positive and negative conditioning to denoise the latent image."
+
+ def sample(self, model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=1.0):
+ return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
+
+class KSamplerAdvanced:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required":
+ {"model": ("MODEL",),
+ "add_noise": (["enable", "disable"], ),
+ "noise_seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff, "control_after_generate": True}),
+ "steps": ("INT", {"default": 20, "min": 1, "max": 10000}),
+ "cfg": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0, "step":0.1, "round": 0.01}),
+ "sampler_name": (comfy.samplers.KSampler.SAMPLERS, ),
+ "scheduler": (comfy.samplers.KSampler.SCHEDULERS, ),
+ "positive": ("CONDITIONING", ),
+ "negative": ("CONDITIONING", ),
+ "latent_image": ("LATENT", ),
+ "start_at_step": ("INT", {"default": 0, "min": 0, "max": 10000}),
+ "end_at_step": ("INT", {"default": 10000, "min": 0, "max": 10000}),
+ "return_with_leftover_noise": (["disable", "enable"], ),
+ }
+ }
+
+ RETURN_TYPES = ("LATENT",)
+ FUNCTION = "sample"
+
+ CATEGORY = "sampling"
+
+ def sample(self, model, add_noise, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, start_at_step, end_at_step, return_with_leftover_noise, denoise=1.0):
+ force_full_denoise = True
+ if return_with_leftover_noise == "enable":
+ force_full_denoise = False
+ disable_noise = False
+ if add_noise == "disable":
+ disable_noise = True
+ return common_ksampler(model, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise, disable_noise=disable_noise, start_step=start_at_step, last_step=end_at_step, force_full_denoise=force_full_denoise)
+
+class SaveImage:
+ def __init__(self):
+ self.output_dir = folder_paths.get_output_directory()
+ self.type = "output"
+ self.prefix_append = ""
+ self.compress_level = 4
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "images": ("IMAGE", {"tooltip": "The images to save."}),
+ "filename_prefix": ("STRING", {"default": "ComfyUI", "tooltip": "The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes."})
+ },
+ "hidden": {
+ "prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"
+ },
+ }
+
+ RETURN_TYPES = ()
+ FUNCTION = "save_images"
+
+ OUTPUT_NODE = True
+
+ CATEGORY = "image"
+ DESCRIPTION = "Saves the input images to your ComfyUI output directory."
+
+ def save_images(self, images, filename_prefix="ComfyUI", prompt=None, extra_pnginfo=None):
+ filename_prefix += self.prefix_append
+ full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(filename_prefix, self.output_dir, images[0].shape[1], images[0].shape[0])
+ results = list()
+ for (batch_number, image) in enumerate(images):
+ i = 255. * image.cpu().numpy()
+ img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
+ metadata = None
+ if not args.disable_metadata:
+ metadata = PngInfo()
+ if prompt is not None:
+ metadata.add_text("prompt", json.dumps(prompt))
+ if extra_pnginfo is not None:
+ for x in extra_pnginfo:
+ metadata.add_text(x, json.dumps(extra_pnginfo[x]))
+
+ filename_with_batch_num = filename.replace("%batch_num%", str(batch_number))
+ file = f"{filename_with_batch_num}_{counter:05}_.png"
+ img.save(os.path.join(full_output_folder, file), pnginfo=metadata, compress_level=self.compress_level)
+ results.append({
+ "filename": file,
+ "subfolder": subfolder,
+ "type": self.type
+ })
+ counter += 1
+
+ return { "ui": { "images": results } }
+
+class PreviewImage(SaveImage):
+ def __init__(self):
+ self.output_dir = folder_paths.get_temp_directory()
+ self.type = "temp"
+ self.prefix_append = "_temp_" + ''.join(random.choice("abcdefghijklmnopqrstupvxyz") for x in range(5))
+ self.compress_level = 1
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required":
+ {"images": ("IMAGE", ), },
+ "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
+ }
+
+class LoadImage:
+ @classmethod
+ def INPUT_TYPES(s):
+ input_dir = folder_paths.get_input_directory()
+ files = [f for f in os.listdir(input_dir) if os.path.isfile(os.path.join(input_dir, f))]
+ files = folder_paths.filter_files_content_types(files, ["image"])
+ return {"required":
+ {"image": (sorted(files), {"image_upload": True})},
+ }
+
+ CATEGORY = "image"
+
+ RETURN_TYPES = ("IMAGE", "MASK")
+ FUNCTION = "load_image"
+ def load_image(self, image):
+ image_path = folder_paths.get_annotated_filepath(image)
+
+ img = node_helpers.pillow(Image.open, image_path)
+
+ output_images = []
+ output_masks = []
+ w, h = None, None
+
+ excluded_formats = ['MPO']
+
+ for i in ImageSequence.Iterator(img):
+ i = node_helpers.pillow(ImageOps.exif_transpose, i)
+
+ if i.mode == 'I':
+ i = i.point(lambda i: i * (1 / 255))
+ image = i.convert("RGB")
+
+ if len(output_images) == 0:
+ w = image.size[0]
+ h = image.size[1]
+
+ if image.size[0] != w or image.size[1] != h:
+ continue
+
+ image = np.array(image).astype(np.float32) / 255.0
+ image = torch.from_numpy(image)[None,]
+ if 'A' in i.getbands():
+ mask = np.array(i.getchannel('A')).astype(np.float32) / 255.0
+ mask = 1. - torch.from_numpy(mask)
+ elif i.mode == 'P' and 'transparency' in i.info:
+ mask = np.array(i.convert('RGBA').getchannel('A')).astype(np.float32) / 255.0
+ mask = 1. - torch.from_numpy(mask)
+ else:
+ mask = torch.zeros((64,64), dtype=torch.float32, device="cpu")
+ output_images.append(image)
+ output_masks.append(mask.unsqueeze(0))
+
+ if len(output_images) > 1 and img.format not in excluded_formats:
+ output_image = torch.cat(output_images, dim=0)
+ output_mask = torch.cat(output_masks, dim=0)
+ else:
+ output_image = output_images[0]
+ output_mask = output_masks[0]
+
+ return (output_image, output_mask)
+
+ @classmethod
+ def IS_CHANGED(s, image):
+ image_path = folder_paths.get_annotated_filepath(image)
+ m = hashlib.sha256()
+ with open(image_path, 'rb') as f:
+ m.update(f.read())
+ return m.digest().hex()
+
+ @classmethod
+ def VALIDATE_INPUTS(s, image):
+ if not folder_paths.exists_annotated_filepath(image):
+ return "Invalid image file: {}".format(image)
+
+ return True
+
+class LoadImageMask:
+ _color_channels = ["alpha", "red", "green", "blue"]
+ @classmethod
+ def INPUT_TYPES(s):
+ input_dir = folder_paths.get_input_directory()
+ files = [f for f in os.listdir(input_dir) if os.path.isfile(os.path.join(input_dir, f))]
+ return {"required":
+ {"image": (sorted(files), {"image_upload": True}),
+ "channel": (s._color_channels, ), }
+ }
+
+ CATEGORY = "mask"
+
+ RETURN_TYPES = ("MASK",)
+ FUNCTION = "load_image"
+ def load_image(self, image, channel):
+ image_path = folder_paths.get_annotated_filepath(image)
+ i = node_helpers.pillow(Image.open, image_path)
+ i = node_helpers.pillow(ImageOps.exif_transpose, i)
+ if i.getbands() != ("R", "G", "B", "A"):
+ if i.mode == 'I':
+ i = i.point(lambda i: i * (1 / 255))
+ i = i.convert("RGBA")
+ mask = None
+ c = channel[0].upper()
+ if c in i.getbands():
+ mask = np.array(i.getchannel(c)).astype(np.float32) / 255.0
+ mask = torch.from_numpy(mask)
+ if c == 'A':
+ mask = 1. - mask
+ else:
+ mask = torch.zeros((64,64), dtype=torch.float32, device="cpu")
+ return (mask.unsqueeze(0),)
+
+ @classmethod
+ def IS_CHANGED(s, image, channel):
+ image_path = folder_paths.get_annotated_filepath(image)
+ m = hashlib.sha256()
+ with open(image_path, 'rb') as f:
+ m.update(f.read())
+ return m.digest().hex()
+
+ @classmethod
+ def VALIDATE_INPUTS(s, image):
+ if not folder_paths.exists_annotated_filepath(image):
+ return "Invalid image file: {}".format(image)
+
+ return True
+
+
+class LoadImageOutput(LoadImage):
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "image": ("COMBO", {
+ "image_upload": True,
+ "image_folder": "output",
+ "remote": {
+ "route": "/internal/files/output",
+ "refresh_button": True,
+ "control_after_refresh": "first",
+ },
+ }),
+ }
+ }
+
+ DESCRIPTION = "Load an image from the output folder. When the refresh button is clicked, the node will update the image list and automatically select the first image, allowing for easy iteration."
+ EXPERIMENTAL = True
+ FUNCTION = "load_image"
+
+
+class ImageScale:
+ upscale_methods = ["nearest-exact", "bilinear", "area", "bicubic", "lanczos"]
+ crop_methods = ["disabled", "center"]
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "image": ("IMAGE",), "upscale_method": (s.upscale_methods,),
+ "width": ("INT", {"default": 512, "min": 0, "max": MAX_RESOLUTION, "step": 1}),
+ "height": ("INT", {"default": 512, "min": 0, "max": MAX_RESOLUTION, "step": 1}),
+ "crop": (s.crop_methods,)}}
+ RETURN_TYPES = ("IMAGE",)
+ FUNCTION = "upscale"
+
+ CATEGORY = "image/upscaling"
+
+ def upscale(self, image, upscale_method, width, height, crop):
+ if width == 0 and height == 0:
+ s = image
+ else:
+ samples = image.movedim(-1,1)
+
+ if width == 0:
+ width = max(1, round(samples.shape[3] * height / samples.shape[2]))
+ elif height == 0:
+ height = max(1, round(samples.shape[2] * width / samples.shape[3]))
+
+ s = comfy.utils.common_upscale(samples, width, height, upscale_method, crop)
+ s = s.movedim(1,-1)
+ return (s,)
+
+class ImageScaleBy:
+ upscale_methods = ["nearest-exact", "bilinear", "area", "bicubic", "lanczos"]
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "image": ("IMAGE",), "upscale_method": (s.upscale_methods,),
+ "scale_by": ("FLOAT", {"default": 1.0, "min": 0.01, "max": 8.0, "step": 0.01}),}}
+ RETURN_TYPES = ("IMAGE",)
+ FUNCTION = "upscale"
+
+ CATEGORY = "image/upscaling"
+
+ def upscale(self, image, upscale_method, scale_by):
+ samples = image.movedim(-1,1)
+ width = round(samples.shape[3] * scale_by)
+ height = round(samples.shape[2] * scale_by)
+ s = comfy.utils.common_upscale(samples, width, height, upscale_method, "disabled")
+ s = s.movedim(1,-1)
+ return (s,)
+
+class ImageInvert:
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "image": ("IMAGE",)}}
+
+ RETURN_TYPES = ("IMAGE",)
+ FUNCTION = "invert"
+
+ CATEGORY = "image"
+
+ def invert(self, image):
+ s = 1.0 - image
+ return (s,)
+
+class ImageBatch:
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "image1": ("IMAGE",), "image2": ("IMAGE",)}}
+
+ RETURN_TYPES = ("IMAGE",)
+ FUNCTION = "batch"
+
+ CATEGORY = "image"
+
+ def batch(self, image1, image2):
+ if image1.shape[-1] != image2.shape[-1]:
+ if image1.shape[-1] > image2.shape[-1]:
+ image2 = torch.nn.functional.pad(image2, (0,1), mode='constant', value=1.0)
+ else:
+ image1 = torch.nn.functional.pad(image1, (0,1), mode='constant', value=1.0)
+ if image1.shape[1:] != image2.shape[1:]:
+ image2 = comfy.utils.common_upscale(image2.movedim(-1,1), image1.shape[2], image1.shape[1], "bilinear", "center").movedim(1,-1)
+ s = torch.cat((image1, image2), dim=0)
+ return (s,)
+
+class EmptyImage:
+ def __init__(self, device="cpu"):
+ self.device = device
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": { "width": ("INT", {"default": 512, "min": 1, "max": MAX_RESOLUTION, "step": 1}),
+ "height": ("INT", {"default": 512, "min": 1, "max": MAX_RESOLUTION, "step": 1}),
+ "batch_size": ("INT", {"default": 1, "min": 1, "max": 4096}),
+ "color": ("INT", {"default": 0, "min": 0, "max": 0xFFFFFF, "step": 1, "display": "color"}),
+ }}
+ RETURN_TYPES = ("IMAGE",)
+ FUNCTION = "generate"
+
+ CATEGORY = "image"
+
+ def generate(self, width, height, batch_size=1, color=0):
+ r = torch.full([batch_size, height, width, 1], ((color >> 16) & 0xFF) / 0xFF)
+ g = torch.full([batch_size, height, width, 1], ((color >> 8) & 0xFF) / 0xFF)
+ b = torch.full([batch_size, height, width, 1], ((color) & 0xFF) / 0xFF)
+ return (torch.cat((r, g, b), dim=-1), )
+
+class ImagePadForOutpaint:
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "image": ("IMAGE",),
+ "left": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "top": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "right": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "bottom": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 8}),
+ "feathering": ("INT", {"default": 40, "min": 0, "max": MAX_RESOLUTION, "step": 1}),
+ }
+ }
+
+ RETURN_TYPES = ("IMAGE", "MASK")
+ FUNCTION = "expand_image"
+
+ CATEGORY = "image"
+
+ def expand_image(self, image, left, top, right, bottom, feathering):
+ d1, d2, d3, d4 = image.size()
+
+ new_image = torch.ones(
+ (d1, d2 + top + bottom, d3 + left + right, d4),
+ dtype=torch.float32,
+ ) * 0.5
+
+ new_image[:, top:top + d2, left:left + d3, :] = image
+
+ mask = torch.ones(
+ (d2 + top + bottom, d3 + left + right),
+ dtype=torch.float32,
+ )
+
+ t = torch.zeros(
+ (d2, d3),
+ dtype=torch.float32
+ )
+
+ if feathering > 0 and feathering * 2 < d2 and feathering * 2 < d3:
+
+ for i in range(d2):
+ for j in range(d3):
+ dt = i if top != 0 else d2
+ db = d2 - i if bottom != 0 else d2
+
+ dl = j if left != 0 else d3
+ dr = d3 - j if right != 0 else d3
+
+ d = min(dt, db, dl, dr)
+
+ if d >= feathering:
+ continue
+
+ v = (feathering - d) / feathering
+
+ t[i, j] = v * v
+
+ mask[top:top + d2, left:left + d3] = t
+
+ return (new_image, mask.unsqueeze(0))
+
+
+NODE_CLASS_MAPPINGS = {
+ "KSampler": KSampler,
+ "CheckpointLoaderSimple": CheckpointLoaderSimple,
+ "CLIPTextEncode": CLIPTextEncode,
+ "CLIPSetLastLayer": CLIPSetLastLayer,
+ "VAEDecode": VAEDecode,
+ "VAEEncode": VAEEncode,
+ "VAEEncodeForInpaint": VAEEncodeForInpaint,
+ "VAELoader": VAELoader,
+ "EmptyLatentImage": EmptyLatentImage,
+ "LatentUpscale": LatentUpscale,
+ "LatentUpscaleBy": LatentUpscaleBy,
+ "LatentFromBatch": LatentFromBatch,
+ "RepeatLatentBatch": RepeatLatentBatch,
+ "SaveImage": SaveImage,
+ "PreviewImage": PreviewImage,
+ "LoadImage": LoadImage,
+ "LoadImageMask": LoadImageMask,
+ "LoadImageOutput": LoadImageOutput,
+ "ImageScale": ImageScale,
+ "ImageScaleBy": ImageScaleBy,
+ "ImageInvert": ImageInvert,
+ "ImageBatch": ImageBatch,
+ "ImagePadForOutpaint": ImagePadForOutpaint,
+ "EmptyImage": EmptyImage,
+ "ConditioningAverage": ConditioningAverage ,
+ "ConditioningCombine": ConditioningCombine,
+ "ConditioningConcat": ConditioningConcat,
+ "ConditioningSetArea": ConditioningSetArea,
+ "ConditioningSetAreaPercentage": ConditioningSetAreaPercentage,
+ "ConditioningSetAreaStrength": ConditioningSetAreaStrength,
+ "ConditioningSetMask": ConditioningSetMask,
+ "KSamplerAdvanced": KSamplerAdvanced,
+ "SetLatentNoiseMask": SetLatentNoiseMask,
+ "LatentComposite": LatentComposite,
+ "LatentBlend": LatentBlend,
+ "LatentRotate": LatentRotate,
+ "LatentFlip": LatentFlip,
+ "LatentCrop": LatentCrop,
+ "LoraLoader": LoraLoader,
+ "CLIPLoader": CLIPLoader,
+ "UNETLoader": UNETLoader,
+ "DualCLIPLoader": DualCLIPLoader,
+ "CLIPVisionEncode": CLIPVisionEncode,
+ "StyleModelApply": StyleModelApply,
+ "unCLIPConditioning": unCLIPConditioning,
+ "ControlNetApply": ControlNetApply,
+ "ControlNetApplyAdvanced": ControlNetApplyAdvanced,
+ "ControlNetLoader": ControlNetLoader,
+ "DiffControlNetLoader": DiffControlNetLoader,
+ "StyleModelLoader": StyleModelLoader,
+ "CLIPVisionLoader": CLIPVisionLoader,
+ "VAEDecodeTiled": VAEDecodeTiled,
+ "VAEEncodeTiled": VAEEncodeTiled,
+ "unCLIPCheckpointLoader": unCLIPCheckpointLoader,
+ "GLIGENLoader": GLIGENLoader,
+ "GLIGENTextBoxApply": GLIGENTextBoxApply,
+ "InpaintModelConditioning": InpaintModelConditioning,
+
+ "CheckpointLoader": CheckpointLoader,
+ "DiffusersLoader": DiffusersLoader,
+
+ "LoadLatent": LoadLatent,
+ "SaveLatent": SaveLatent,
+
+ "ConditioningZeroOut": ConditioningZeroOut,
+ "ConditioningSetTimestepRange": ConditioningSetTimestepRange,
+ "LoraLoaderModelOnly": LoraLoaderModelOnly,
+}
+
+NODE_DISPLAY_NAME_MAPPINGS = {
+ # Sampling
+ "KSampler": "KSampler",
+ "KSamplerAdvanced": "KSampler (Advanced)",
+ # Loaders
+ "CheckpointLoader": "Load Checkpoint With Config (DEPRECATED)",
+ "CheckpointLoaderSimple": "Load Checkpoint",
+ "VAELoader": "Load VAE",
+ "LoraLoader": "Load LoRA",
+ "CLIPLoader": "Load CLIP",
+ "ControlNetLoader": "Load ControlNet Model",
+ "DiffControlNetLoader": "Load ControlNet Model (diff)",
+ "StyleModelLoader": "Load Style Model",
+ "CLIPVisionLoader": "Load CLIP Vision",
+ "UNETLoader": "Load Diffusion Model",
+ # Conditioning
+ "CLIPVisionEncode": "CLIP Vision Encode",
+ "StyleModelApply": "Apply Style Model",
+ "CLIPTextEncode": "CLIP Text Encode (Prompt)",
+ "CLIPSetLastLayer": "CLIP Set Last Layer",
+ "ConditioningCombine": "Conditioning (Combine)",
+ "ConditioningAverage ": "Conditioning (Average)",
+ "ConditioningConcat": "Conditioning (Concat)",
+ "ConditioningSetArea": "Conditioning (Set Area)",
+ "ConditioningSetAreaPercentage": "Conditioning (Set Area with Percentage)",
+ "ConditioningSetMask": "Conditioning (Set Mask)",
+ "ControlNetApply": "Apply ControlNet (OLD)",
+ "ControlNetApplyAdvanced": "Apply ControlNet",
+ # Latent
+ "VAEEncodeForInpaint": "VAE Encode (for Inpainting)",
+ "SetLatentNoiseMask": "Set Latent Noise Mask",
+ "VAEDecode": "VAE Decode",
+ "VAEEncode": "VAE Encode",
+ "LatentRotate": "Rotate Latent",
+ "LatentFlip": "Flip Latent",
+ "LatentCrop": "Crop Latent",
+ "EmptyLatentImage": "Empty Latent Image",
+ "LatentUpscale": "Upscale Latent",
+ "LatentUpscaleBy": "Upscale Latent By",
+ "LatentComposite": "Latent Composite",
+ "LatentBlend": "Latent Blend",
+ "LatentFromBatch" : "Latent From Batch",
+ "RepeatLatentBatch": "Repeat Latent Batch",
+ # Image
+ "SaveImage": "Save Image",
+ "PreviewImage": "Preview Image",
+ "LoadImage": "Load Image",
+ "LoadImageMask": "Load Image (as Mask)",
+ "LoadImageOutput": "Load Image (from Outputs)",
+ "ImageScale": "Upscale Image",
+ "ImageScaleBy": "Upscale Image By",
+ "ImageInvert": "Invert Image",
+ "ImagePadForOutpaint": "Pad Image for Outpainting",
+ "ImageBatch": "Batch Images",
+ "ImageCrop": "Image Crop",
+ "ImageStitch": "Image Stitch",
+ "ImageBlend": "Image Blend",
+ "ImageBlur": "Image Blur",
+ "ImageQuantize": "Image Quantize",
+ "ImageSharpen": "Image Sharpen",
+ "ImageScaleToTotalPixels": "Scale Image to Total Pixels",
+ "GetImageSize": "Get Image Size",
+ # _for_testing
+ "VAEDecodeTiled": "VAE Decode (Tiled)",
+ "VAEEncodeTiled": "VAE Encode (Tiled)",
+}
+
+EXTENSION_WEB_DIRS = {}
+
+# Dictionary of successfully loaded module names and associated directories.
+LOADED_MODULE_DIRS = {}
+
+
+def get_module_name(module_path: str) -> str:
+ """
+ Returns the module name based on the given module path.
+ Examples:
+ get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node.py") -> "my_custom_node"
+ get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node") -> "my_custom_node"
+ get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node/") -> "my_custom_node"
+ get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node/__init__.py") -> "my_custom_node"
+ get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node/__init__") -> "my_custom_node"
+ get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node/__init__/") -> "my_custom_node"
+ get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node.disabled") -> "custom_nodes
+ Args:
+ module_path (str): The path of the module.
+ Returns:
+ str: The module name.
+ """
+ base_path = os.path.basename(module_path)
+ if os.path.isfile(module_path):
+ base_path = os.path.splitext(base_path)[0]
+ return base_path
+
+
+async def load_custom_node(module_path: str, ignore=set(), module_parent="custom_nodes") -> bool:
+ module_name = get_module_name(module_path)
+ if os.path.isfile(module_path):
+ sp = os.path.splitext(module_path)
+ module_name = sp[0]
+ sys_module_name = module_name
+ elif os.path.isdir(module_path):
+ sys_module_name = module_path.replace(".", "_x_")
+
+ try:
+ logging.debug("Trying to load custom node {}".format(module_path))
+ if os.path.isfile(module_path):
+ module_spec = importlib.util.spec_from_file_location(sys_module_name, module_path)
+ module_dir = os.path.split(module_path)[0]
+ else:
+ module_spec = importlib.util.spec_from_file_location(sys_module_name, os.path.join(module_path, "__init__.py"))
+ module_dir = module_path
+
+ module = importlib.util.module_from_spec(module_spec)
+ sys.modules[sys_module_name] = module
+ module_spec.loader.exec_module(module)
+
+ LOADED_MODULE_DIRS[module_name] = os.path.abspath(module_dir)
+
+ try:
+ from comfy_config import config_parser
+
+ project_config = config_parser.extract_node_configuration(module_path)
+
+ web_dir_name = project_config.tool_comfy.web
+
+ if web_dir_name:
+ web_dir_path = os.path.join(module_path, web_dir_name)
+
+ if os.path.isdir(web_dir_path):
+ project_name = project_config.project.name
+
+ EXTENSION_WEB_DIRS[project_name] = web_dir_path
+
+ logging.info("Automatically register web folder {} for {}".format(web_dir_name, project_name))
+ except Exception as e:
+ logging.warning(f"Unable to parse pyproject.toml due to lack dependency pydantic-settings, please run 'pip install -r requirements.txt': {e}")
+
+ if hasattr(module, "WEB_DIRECTORY") and getattr(module, "WEB_DIRECTORY") is not None:
+ web_dir = os.path.abspath(os.path.join(module_dir, getattr(module, "WEB_DIRECTORY")))
+ if os.path.isdir(web_dir):
+ EXTENSION_WEB_DIRS[module_name] = web_dir
+
+ # V1 node definition
+ if hasattr(module, "NODE_CLASS_MAPPINGS") and getattr(module, "NODE_CLASS_MAPPINGS") is not None:
+ for name, node_cls in module.NODE_CLASS_MAPPINGS.items():
+ if name not in ignore:
+ NODE_CLASS_MAPPINGS[name] = node_cls
+ node_cls.RELATIVE_PYTHON_MODULE = "{}.{}".format(module_parent, get_module_name(module_path))
+ if hasattr(module, "NODE_DISPLAY_NAME_MAPPINGS") and getattr(module, "NODE_DISPLAY_NAME_MAPPINGS") is not None:
+ NODE_DISPLAY_NAME_MAPPINGS.update(module.NODE_DISPLAY_NAME_MAPPINGS)
+ return True
+ # V3 Extension Definition
+ elif hasattr(module, "comfy_entrypoint"):
+ entrypoint = getattr(module, "comfy_entrypoint")
+ if not callable(entrypoint):
+ logging.warning(f"comfy_entrypoint in {module_path} is not callable, skipping.")
+ return False
+ try:
+ if inspect.iscoroutinefunction(entrypoint):
+ extension = await entrypoint()
+ else:
+ extension = entrypoint()
+ if not isinstance(extension, ComfyExtension):
+ logging.warning(f"comfy_entrypoint in {module_path} did not return a ComfyExtension, skipping.")
+ return False
+ node_list = await extension.get_node_list()
+ if not isinstance(node_list, list):
+ logging.warning(f"comfy_entrypoint in {module_path} did not return a list of nodes, skipping.")
+ return False
+ for node_cls in node_list:
+ node_cls: io.ComfyNode
+ schema = node_cls.GET_SCHEMA()
+ if schema.node_id not in ignore:
+ NODE_CLASS_MAPPINGS[schema.node_id] = node_cls
+ node_cls.RELATIVE_PYTHON_MODULE = "{}.{}".format(module_parent, get_module_name(module_path))
+ if schema.display_name is not None:
+ NODE_DISPLAY_NAME_MAPPINGS[schema.node_id] = schema.display_name
+ return True
+ except Exception as e:
+ logging.warning(f"Error while calling comfy_entrypoint in {module_path}: {e}")
+ return False
+ else:
+ logging.warning(f"Skip {module_path} module for custom nodes due to the lack of NODE_CLASS_MAPPINGS or NODES_LIST (need one).")
+ return False
+ except Exception as e:
+ logging.warning(traceback.format_exc())
+ logging.warning(f"Cannot import {module_path} module for custom nodes: {e}")
+ return False
+
+async def init_external_custom_nodes():
+ """
+ Initializes the external custom nodes.
+
+ This function loads custom nodes from the specified folder paths and imports them into the application.
+ It measures the import times for each custom node and logs the results.
+
+ Returns:
+ None
+ """
+ base_node_names = set(NODE_CLASS_MAPPINGS.keys())
+ node_paths = folder_paths.get_folder_paths("custom_nodes")
+ node_import_times = []
+ for custom_node_path in node_paths:
+ possible_modules = os.listdir(os.path.realpath(custom_node_path))
+ if "__pycache__" in possible_modules:
+ possible_modules.remove("__pycache__")
+
+ for possible_module in possible_modules:
+ module_path = os.path.join(custom_node_path, possible_module)
+ if os.path.isfile(module_path) and os.path.splitext(module_path)[1] != ".py": continue
+ if module_path.endswith(".disabled"): continue
+ if args.disable_all_custom_nodes and possible_module not in args.whitelist_custom_nodes:
+ logging.info(f"Skipping {possible_module} due to disable_all_custom_nodes and whitelist_custom_nodes")
+ continue
+ time_before = time.perf_counter()
+ success = await load_custom_node(module_path, base_node_names, module_parent="custom_nodes")
+ node_import_times.append((time.perf_counter() - time_before, module_path, success))
+
+ if len(node_import_times) > 0:
+ logging.info("\nImport times for custom nodes:")
+ for n in sorted(node_import_times):
+ if n[2]:
+ import_message = ""
+ else:
+ import_message = " (IMPORT FAILED)"
+ logging.info("{:6.1f} seconds{}: {}".format(n[0], import_message, n[1]))
+ logging.info("")
+
+async def init_builtin_extra_nodes():
+ """
+ Initializes the built-in extra nodes in ComfyUI.
+
+ This function loads the extra node files located in the "comfy_extras" directory and imports them into ComfyUI.
+ If any of the extra node files fail to import, a warning message is logged.
+
+ Returns:
+ None
+ """
+ extras_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "comfy_extras")
+ extras_files = [
+ "nodes_latent.py",
+ "nodes_hypernetwork.py",
+ "nodes_upscale_model.py",
+ "nodes_post_processing.py",
+ "nodes_mask.py",
+ "nodes_compositing.py",
+ "nodes_rebatch.py",
+ "nodes_model_merging.py",
+ "nodes_tomesd.py",
+ "nodes_clip_sdxl.py",
+ "nodes_canny.py",
+ "nodes_freelunch.py",
+ "nodes_custom_sampler.py",
+ "nodes_hypertile.py",
+ "nodes_model_advanced.py",
+ "nodes_model_downscale.py",
+ "nodes_images.py",
+ "nodes_video_model.py",
+ "nodes_train.py",
+ "nodes_sag.py",
+ "nodes_perpneg.py",
+ "nodes_stable3d.py",
+ "nodes_sdupscale.py",
+ "nodes_photomaker.py",
+ "nodes_pixart.py",
+ "nodes_cond.py",
+ "nodes_morphology.py",
+ "nodes_stable_cascade.py",
+ "nodes_differential_diffusion.py",
+ "nodes_ip2p.py",
+ "nodes_model_merging_model_specific.py",
+ "nodes_pag.py",
+ "nodes_align_your_steps.py",
+ "nodes_attention_multiply.py",
+ "nodes_advanced_samplers.py",
+ "nodes_webcam.py",
+ "nodes_audio.py",
+ "nodes_sd3.py",
+ "nodes_gits.py",
+ "nodes_controlnet.py",
+ "nodes_hunyuan.py",
+ "nodes_eps.py",
+ "nodes_flux.py",
+ "nodes_lora_extract.py",
+ "nodes_torch_compile.py",
+ "nodes_mochi.py",
+ "nodes_slg.py",
+ "nodes_mahiro.py",
+ "nodes_lt.py",
+ "nodes_hooks.py",
+ "nodes_load_3d.py",
+ "nodes_cosmos.py",
+ "nodes_video.py",
+ "nodes_lumina2.py",
+ "nodes_wan.py",
+ "nodes_lotus.py",
+ "nodes_hunyuan3d.py",
+ "nodes_primitive.py",
+ "nodes_cfg.py",
+ "nodes_optimalsteps.py",
+ "nodes_hidream.py",
+ "nodes_fresca.py",
+ "nodes_apg.py",
+ "nodes_preview_any.py",
+ "nodes_ace.py",
+ "nodes_string.py",
+ "nodes_camera_trajectory.py",
+ "nodes_edit_model.py",
+ "nodes_tcfg.py",
+ "nodes_context_windows.py",
+ "nodes_qwen.py",
+ "nodes_chroma_radiance.py",
+ "nodes_model_patch.py",
+ "nodes_easycache.py",
+ "nodes_audio_encoder.py",
+ "nodes_rope.py",
+ "nodes_nop.py",
+ ]
+
+ import_failed = []
+ for node_file in extras_files:
+ if not await load_custom_node(os.path.join(extras_dir, node_file), module_parent="comfy_extras"):
+ import_failed.append(node_file)
+
+ return import_failed
+
+
+async def init_builtin_api_nodes():
+ api_nodes_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "comfy_api_nodes")
+ api_nodes_files = [
+ "nodes_ideogram.py",
+ "nodes_openai.py",
+ "nodes_minimax.py",
+ "nodes_veo2.py",
+ "nodes_kling.py",
+ "nodes_bfl.py",
+ "nodes_bytedance.py",
+ "nodes_ltxv.py",
+ "nodes_luma.py",
+ "nodes_recraft.py",
+ "nodes_pixverse.py",
+ "nodes_stability.py",
+ "nodes_pika.py",
+ "nodes_runway.py",
+ "nodes_sora.py",
+ "nodes_topaz.py",
+ "nodes_tripo.py",
+ "nodes_moonvalley.py",
+ "nodes_rodin.py",
+ "nodes_gemini.py",
+ "nodes_vidu.py",
+ "nodes_wan.py",
+ ]
+
+ if not await load_custom_node(os.path.join(api_nodes_dir, "canary.py"), module_parent="comfy_api_nodes"):
+ return api_nodes_files
+
+ import_failed = []
+ for node_file in api_nodes_files:
+ if not await load_custom_node(os.path.join(api_nodes_dir, node_file), module_parent="comfy_api_nodes"):
+ import_failed.append(node_file)
+
+ return import_failed
+
+async def init_public_apis():
+ register_versions([
+ ComfyAPIWithVersion(
+ version=getattr(v, "VERSION"),
+ api_class=v
+ ) for v in supported_versions
+ ])
+
+async def init_extra_nodes(init_custom_nodes=True, init_api_nodes=True):
+ await init_public_apis()
+
+ import_failed = await init_builtin_extra_nodes()
+
+ import_failed_api = []
+ if init_api_nodes:
+ import_failed_api = await init_builtin_api_nodes()
+
+ if init_custom_nodes:
+ await init_external_custom_nodes()
+ else:
+ logging.info("Skipping loading of custom nodes")
+
+ if len(import_failed_api) > 0:
+ logging.warning("WARNING: some comfy_api_nodes/ nodes did not import correctly. This may be because they are missing some dependencies.\n")
+ for node in import_failed_api:
+ logging.warning("IMPORT FAILED: {}".format(node))
+ logging.warning("\nThis issue might be caused by new missing dependencies added the last time you updated ComfyUI.")
+ if args.windows_standalone_build:
+ logging.warning("Please run the update script: update/update_comfyui.bat")
+ else:
+ logging.warning("Please do a: pip install -r requirements.txt")
+ logging.warning("")
+
+ if len(import_failed) > 0:
+ logging.warning("WARNING: some comfy_extras/ nodes did not import correctly. This may be because they are missing some dependencies.\n")
+ for node in import_failed:
+ logging.warning("IMPORT FAILED: {}".format(node))
+ logging.warning("\nThis issue might be caused by new missing dependencies added the last time you updated ComfyUI.")
+ if args.windows_standalone_build:
+ logging.warning("Please run the update script: update/update_comfyui.bat")
+ else:
+ logging.warning("Please do a: pip install -r requirements.txt")
+ logging.warning("")
+
+ return import_failed
diff --git a/docs/hel-892/separation-reference/core-tag-0.3.68.json b/docs/hel-892/separation-reference/core-tag-0.3.68.json
new file mode 100644
index 00000000..eb8b27ab
--- /dev/null
+++ b/docs/hel-892/separation-reference/core-tag-0.3.68.json
@@ -0,0 +1 @@
+{"ref":"refs/tags/v0.3.68","node_id":"REF_kwDOIygeJrFyZWZzL3RhZ3MvdjAuMy42OA","url":"https://api.github.com/repos/Comfy-Org/ComfyUI/git/refs/tags/v0.3.68","object":{"sha":"265adad858e1f31b66cd3523a02b16f5d34ced52","type":"commit","url":"https://api.github.com/repos/Comfy-Org/ComfyUI/git/commits/265adad858e1f31b66cd3523a02b16f5d34ced52"}}
\ No newline at end of file
diff --git a/docs/hel-892/separation-reference/core-tag-0.3.71.json b/docs/hel-892/separation-reference/core-tag-0.3.71.json
new file mode 100644
index 00000000..ef638ea6
--- /dev/null
+++ b/docs/hel-892/separation-reference/core-tag-0.3.71.json
@@ -0,0 +1 @@
+{"ref":"refs/tags/v0.3.71","node_id":"REF_kwDOIygeJrFyZWZzL3RhZ3MvdjAuMy43MQ","url":"https://api.github.com/repos/Comfy-Org/ComfyUI/git/refs/tags/v0.3.71","object":{"sha":"c55fd7481626d8bee8044ea7512ea996d13a1b90","type":"commit","url":"https://api.github.com/repos/Comfy-Org/ComfyUI/git/commits/c55fd7481626d8bee8044ea7512ea996d13a1b90"}}
\ No newline at end of file
diff --git a/docs/hel-892/separation-reference/discovery.json b/docs/hel-892/separation-reference/discovery.json
new file mode 100644
index 00000000..f19724cf
--- /dev/null
+++ b/docs/hel-892/separation-reference/discovery.json
@@ -0,0 +1,200 @@
+{
+ "metadata_reads": {
+ "core-tag-0.3.71.json": {
+ "sha256": "3588681ee2c7b92b05b9767e690c6e802de2b1fa2de77fb00e31bdbaef319a1a",
+ "retrieved_at": "2026-10-29T19:06:42.244329+00:00",
+ "url": "https://api.github.com/repos/Comfy-Org/ComfyUI/git/ref/tags/v0.3.71"
+ },
+ "plugin-tags.json": {
+ "sha256": "d0bdabdba74cf146507a160b6558f80bc88bf4a67800ccf53d45b0ba0dc7c935",
+ "retrieved_at": "2026-10-29T19:06:45.152354+00:00",
+ "url": "https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/tags"
+ },
+ "plugin-history.json": {
+ "sha256": "b087b4b15e1b0360df6909ec56548287170cd0df2a2d90ad79a13aed84b69ebe",
+ "retrieved_at": "2026-10-29T19:06:46.080362+00:00",
+ "url": "https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits?path=pyproject.toml&per_page=100"
+ },
+ "plugin-1.4.0-commit.json": {
+ "sha256": "5859409573569b8411e2a528cd1700119526f4d51699ab3978b88b39a5b83ed3",
+ "retrieved_at": "2026-10-29T19:07:48.396794+00:00",
+ "url": "https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/5291831d7c321ab7a5192374482f9848dffee75b"
+ },
+ "plugin-1.4.0-tree.json": {
+ "sha256": "f3f823d1c09c27eb837e297778530295dc88001ff565fdcf91cded7aec345e09",
+ "retrieved_at": "2026-10-29T19:07:48.888796+00:00",
+ "url": "https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/5291831d7c321ab7a5192374482f9848dffee75b?recursive=1"
+ },
+ "core-tag-0.3.68.json": {
+ "sha256": "742b174239fec657e2d22cc8b8ab7c106dff817dcc9c0839c83bfdabb2edae84",
+ "retrieved_at": "2026-10-29T19:06:39.284304+00:00",
+ "url": "https://api.github.com/repos/Comfy-Org/ComfyUI/git/ref/tags/v0.3.68"
+ },
+ "registry-1.4.0.json": {
+ "sha256": "fc57451975c27edad1799dab5f22178516425f6dfdf2ffb9ba08f8c2c09eac8f",
+ "retrieved_at": "2026-10-29T19:06:46.648367+00:00",
+ "url": "https://api.comfy.org/nodes/audio-separation-nodes-comfyui/versions/1.4.0"
+ }
+ },
+ "search_bounds": "original repo tags (only v2.0.0), 17 pyproject commits in one page; sampled six historical pyprojects; chose 5291831d with 1.4.0, then checked registry API and package; no repeated missing-material requests",
+ "registry_artifact": {
+ "registry_metadata": {
+ "sha256": "fc57451975c27edad1799dab5f22178516425f6dfdf2ffb9ba08f8c2c09eac8f",
+ "retrieved_at": "2026-10-29T19:06:46.648367+00:00",
+ "url": "https://api.comfy.org/nodes/audio-separation-nodes-comfyui/versions/1.4.0"
+ },
+ "download_url": "https://cdn.comfy.org/christian-byrne/audio-separation-nodes-comfyui/1.4.0/node.zip",
+ "sha256": "0d39cf047e26f2d5fa08c64561af06d5479278eef15d773a38573a28e398d8c4",
+ "retrieved_at": "2026-10-29T19:06:47.792376+00:00",
+ "published_at": "2025-01-05T19:11:07.919704Z",
+ "registry_exposes_commit": false,
+ "artifact_installed_or_imported": false,
+ "members": [
+ {
+ "path": ".github/dependabot.yml",
+ "sha256": "5fde656a6bd4df28fd72a57a054929feb13ab7a0feda9b79cd89d5341c1eab8f"
+ },
+ {
+ "path": ".github/workflows/publish.yml",
+ "sha256": "fcc303b0b70778d3053f9ebf3c058f8d2e1062153f3504410bead4e5446c4ee9"
+ },
+ {
+ "path": ".gitignore",
+ "sha256": "8af92c9f9fbbec40889722e8413ce8fb189258fdb5d54509678ed2bdc5d637bd"
+ },
+ {
+ "path": "README.md",
+ "sha256": "686ef502d7dfec641b2f690142f36903fb1d2f8952bf252e754bf8ac1a11963d"
+ },
+ {
+ "path": "__init__.py",
+ "sha256": "7968717a19aa0aa9b3c4b2daaeef8ae64196ac0f0fb402d418a2809a9bd22663"
+ },
+ {
+ "path": "example_workflows/Extract Instrumental from Song.jpg",
+ "sha256": "9b8b860690a36e25b4c19c04e594cce6264c8a8ae2fd48c24cd7a4c6d54fca8f"
+ },
+ {
+ "path": "example_workflows/Extract Instrumental from Song.json",
+ "sha256": "db483ac9b80485a883c1f3edc40b367c1270ebfe3d93d18fc07813b1611e965c"
+ },
+ {
+ "path": "example_workflows/Isolate Vocals from Audio.jpg",
+ "sha256": "404e4e1909d5b1930a5aa18609359e72fb1647f4dddbbe756650726702eb3b01"
+ },
+ {
+ "path": "example_workflows/Isolate Vocals from Audio.json",
+ "sha256": "8a1e7777d3d62faf8508ab5d7e84c8a887b134369bac5191fa0d91185bf9a008"
+ },
+ {
+ "path": "example_workflows/Isolate Vocals from Video.jpg",
+ "sha256": "8cb216c1d5aad352b9a8b68d64372bff7252d7c01d5e79c44d4c5500925d1e6c"
+ },
+ {
+ "path": "example_workflows/Isolate Vocals from Video.json",
+ "sha256": "f64d56730ab7ea0f056dbdc6f2e2b282075697eb9dfc0144250787732c761915"
+ },
+ {
+ "path": "example_workflows/Remix Song.jpg",
+ "sha256": "b423aa643c8c7db5da8fea5e6ddd88e953b0ddd46c41cea72e576da4c35239ad"
+ },
+ {
+ "path": "example_workflows/Remix Song.json",
+ "sha256": "44d146ce0b80299bb1a7503af83c20571d2440fe12766987d1f3f8d861369481"
+ },
+ {
+ "path": "example_workflows/Replace BGM with Stable-Audio-Generated Music.jpg",
+ "sha256": "3b851a3b48c158ef8d5f37a985ef2dc52184ca8d3e154c74098a48abe65dc23e"
+ },
+ {
+ "path": "example_workflows/Replace BGM with Stable-Audio-Generated Music.json",
+ "sha256": "6f4d761e10aedc108c256324fd2139fc158743bd89b28ecb3be428b445d96df6"
+ },
+ {
+ "path": "pyproject.toml",
+ "sha256": "87acc158dbdc300127bc9154e4ca1b905c139c9434726797995d2b3629d7b0a1"
+ },
+ {
+ "path": "requirements.txt",
+ "sha256": "e93998169bb747c852c5b5307415e7ae2d4dcdd4f29cee77c9b0c8b0819b7de3"
+ },
+ {
+ "path": "src/__init__.py",
+ "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
+ },
+ {
+ "path": "src/_types.py",
+ "sha256": "c9c81f4325733514e10ce0efdbb4432680ae93366337ae5ebaa4039ac27586b1"
+ },
+ {
+ "path": "src/combine.py",
+ "sha256": "33f09616ae3460c812a6a2a6af4384ec54a4f58fdd48f24de7a52be17b06b293"
+ },
+ {
+ "path": "src/combine_video_with_audio.py",
+ "sha256": "ff96f6f73fac08fcecd08c9319e7c919cfbdb4a07b02d1869d7c141bb38afaea"
+ },
+ {
+ "path": "src/crop.py",
+ "sha256": "a2ac02bd7b42efd6de665c51edd7c698bb3ba97939574a9e06a99917a614f56c"
+ },
+ {
+ "path": "src/get_tempo.py",
+ "sha256": "f5a85914c6d81110ea5e7d048772615beaf2cd35f84d51a0170b7c8a3996a4c6"
+ },
+ {
+ "path": "src/resample.py",
+ "sha256": "6cdc1dd1fcbfccade49a032fe9775bf9290f8113cb6e7c239bafec85cc56f304"
+ },
+ {
+ "path": "src/separation.py",
+ "sha256": "08605b797d8f086c7692f6af1df716af692e77a0c810277e2b0467c45ac66ed0"
+ },
+ {
+ "path": "src/tempo_match.py",
+ "sha256": "926bd0f9c6a77fc150d133a5e1330f18432506ba1ed319bfb61b48d2f0771793"
+ },
+ {
+ "path": "src/time_shift.py",
+ "sha256": "a8f5e22aab83fa1c4e58381d04742d6e07dcc500067696b86c575e0ce82ff8c6"
+ },
+ {
+ "path": "src/utils.py",
+ "sha256": "eac3eda009fce6592880100f55d9cbab5f64c8721b98a8fc059d3e27638f02dc"
+ }
+ ],
+ "matching_selected_sources": {
+ "commit": "5291831d7c321ab7a5192374482f9848dffee75b",
+ "files": [
+ {
+ "file": "pyproject.toml",
+ "sha256": "87acc158dbdc300127bc9154e4ca1b905c139c9434726797995d2b3629d7b0a1",
+ "registry_member_equal": true
+ },
+ {
+ "file": "__init__.py",
+ "sha256": "7968717a19aa0aa9b3c4b2daaeef8ae64196ac0f0fb402d418a2809a9bd22663",
+ "registry_member_equal": true
+ },
+ {
+ "file": "src/separation.py",
+ "sha256": "08605b797d8f086c7692f6af1df716af692e77a0c810277e2b0467c45ac66ed0",
+ "registry_member_equal": true
+ },
+ {
+ "file": ".github/workflows/publish.yml",
+ "sha256": "fcc303b0b70778d3053f9ebf3c058f8d2e1062153f3504410bead4e5446c4ee9",
+ "registry_member_equal": true
+ },
+ {
+ "file": "README.md",
+ "sha256": "686ef502d7dfec641b2f690142f36903fb1d2f8952bf252e754bf8ac1a11963d",
+ "registry_member_equal": true
+ }
+ ],
+ "registry_commit_binding": "not exposed by registry API; matching selected source bytes is not a signed release mapping",
+ "license": "pyproject names LICENSE, but no license file in this commit/package; unknown. MIT only added later at 504248bd, not retroactively assigned"
+ },
+ "target_installation_match": "unknown"
+ }
+}
diff --git a/docs/hel-892/separation-reference/plugin-1.4.0-commit.json b/docs/hel-892/separation-reference/plugin-1.4.0-commit.json
new file mode 100644
index 00000000..9b6d4c32
--- /dev/null
+++ b/docs/hel-892/separation-reference/plugin-1.4.0-commit.json
@@ -0,0 +1 @@
+{"sha":"5291831d7c321ab7a5192374482f9848dffee75b","node_id":"C_kwDOMRYcBtoAKDUyOTE4MzFkN2MzMjFhYjdhNTE5MjM3NDQ4MmY5ODQ4ZGZmZWU3NWI","commit":{"author":{"name":"christian-byrne","email":"abolkonsky.rem@gmail.com","date":"2025-01-05T19:10:38Z"},"committer":{"name":"christian-byrne","email":"abolkonsky.rem@gmail.com","date":"2025-01-05T19:10:38Z"},"message":"Use example_workflows new frontend feature","tree":{"sha":"1a36eb50ac08d03c062efdc3e81d31d080ea570e","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/1a36eb50ac08d03c062efdc3e81d31d080ea570e"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/5291831d7c321ab7a5192374482f9848dffee75b","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/5291831d7c321ab7a5192374482f9848dffee75b","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/5291831d7c321ab7a5192374482f9848dffee75b","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/5291831d7c321ab7a5192374482f9848dffee75b/comments","author":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"4d38c6f0b5cfb08e9375665dbbcd1e910b6ebe82","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/4d38c6f0b5cfb08e9375665dbbcd1e910b6ebe82","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/4d38c6f0b5cfb08e9375665dbbcd1e910b6ebe82"}],"stats":{"total":3928,"additions":3927,"deletions":1},"files":[{"sha":"361bf09323b7383148a669dfbdd824bc8db47353","filename":"example_workflows/Extract Instrumental from Song.jpg","status":"added","additions":0,"deletions":0,"changes":0,"blob_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FExtract%20Instrumental%20from%20Song.jpg","raw_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/raw/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FExtract%20Instrumental%20from%20Song.jpg","contents_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/contents/example_workflows%2FExtract%20Instrumental%20from%20Song.jpg?ref=5291831d7c321ab7a5192374482f9848dffee75b"},{"sha":"bcc67a1edff86e68f43413f2d4aa81c6976b507e","filename":"example_workflows/Extract Instrumental from Song.json","status":"added","additions":278,"deletions":0,"changes":278,"blob_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FExtract%20Instrumental%20from%20Song.json","raw_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/raw/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FExtract%20Instrumental%20from%20Song.json","contents_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/contents/example_workflows%2FExtract%20Instrumental%20from%20Song.json?ref=5291831d7c321ab7a5192374482f9848dffee75b","patch":"@@ -0,0 +1,278 @@\n+{\n+ \"last_node_id\": 21,\n+ \"last_link_id\": 26,\n+ \"nodes\": [\n+ {\n+ \"id\": 11,\n+ \"type\": \"AudioSeparation\",\n+ \"pos\": [\n+ 45,\n+ 494\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 166\n+ },\n+ \"flags\": {},\n+ \"order\": 1,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 25\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"Bass\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 20\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ },\n+ {\n+ \"name\": \"Drums\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 21\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 1\n+ },\n+ {\n+ \"name\": \"Other\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 23\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 2\n+ },\n+ {\n+ \"name\": \"Vocals\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [],\n+ \"shape\": 3,\n+ \"slot_index\": 3\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioSeparation\"\n+ },\n+ \"widgets_values\": [\n+ \"half_sine\",\n+ 16,\n+ 0.1\n+ ]\n+ },\n+ {\n+ \"id\": 19,\n+ \"type\": \"AudioCombine\",\n+ \"pos\": [\n+ 474,\n+ 503\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 78\n+ },\n+ \"flags\": {},\n+ \"order\": 2,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 20\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 21\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 22\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"add\"\n+ ]\n+ },\n+ {\n+ \"id\": 10,\n+ \"type\": \"LoadAudio\",\n+ \"pos\": [\n+ -441,\n+ 496\n+ ],\n+ \"size\": {\n+ \"0\": 381.5714111328125,\n+ \"1\": 144\n+ },\n+ \"flags\": {},\n+ \"order\": 0,\n+ \"mode\": 0,\n+ \"inputs\": [],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 25\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"LoadAudio\"\n+ },\n+ \"widgets_values\": [\n+ \"06 Madonna.mp3\",\n+ null,\n+ \"\"\n+ ]\n+ },\n+ {\n+ \"id\": 20,\n+ \"type\": \"AudioCombine\",\n+ \"pos\": [\n+ 859,\n+ 584\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 78\n+ },\n+ \"flags\": {},\n+ \"order\": 3,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 22\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 23\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 26\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"add\"\n+ ]\n+ },\n+ {\n+ \"id\": 21,\n+ \"type\": \"SaveAudio\",\n+ \"pos\": [\n+ 1255,\n+ 585\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 100\n+ },\n+ \"flags\": {},\n+ \"order\": 4,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 26\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"SaveAudio\"\n+ },\n+ \"widgets_values\": [\n+ \"audio/instrumentals/track\",\n+ null\n+ ]\n+ }\n+ ],\n+ \"links\": [\n+ [\n+ 20,\n+ 11,\n+ 0,\n+ 19,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 21,\n+ 11,\n+ 1,\n+ 19,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 22,\n+ 19,\n+ 0,\n+ 20,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 23,\n+ 11,\n+ 2,\n+ 20,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 25,\n+ 10,\n+ 0,\n+ 11,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 26,\n+ 20,\n+ 0,\n+ 21,\n+ 0,\n+ \"AUDIO\"\n+ ]\n+ ],\n+ \"groups\": [],\n+ \"config\": {},\n+ \"extra\": {},\n+ \"version\": 0.4\n+}\n\\ No newline at end of file"},{"sha":"22a8ec47f50c2856b9dab16e8b00a3d358a612d2","filename":"example_workflows/Isolate Vocals from Audio.jpg","status":"added","additions":0,"deletions":0,"changes":0,"blob_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FIsolate%20Vocals%20from%20Audio.jpg","raw_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/raw/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FIsolate%20Vocals%20from%20Audio.jpg","contents_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/contents/example_workflows%2FIsolate%20Vocals%20from%20Audio.jpg?ref=5291831d7c321ab7a5192374482f9848dffee75b"},{"sha":"44b9cdff2cd19117f51ce984dba20616f60f776a","filename":"example_workflows/Isolate Vocals from Audio.json","status":"added","additions":198,"deletions":0,"changes":198,"blob_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FIsolate%20Vocals%20from%20Audio.json","raw_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/raw/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FIsolate%20Vocals%20from%20Audio.json","contents_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/contents/example_workflows%2FIsolate%20Vocals%20from%20Audio.json?ref=5291831d7c321ab7a5192374482f9848dffee75b","patch":"@@ -0,0 +1,198 @@\n+{\n+ \"last_node_id\": 18,\n+ \"last_link_id\": 19,\n+ \"nodes\": [\n+ {\n+ \"id\": 10,\n+ \"type\": \"LoadAudio\",\n+ \"pos\": [\n+ -765,\n+ 507\n+ ],\n+ \"size\": {\n+ \"0\": 381.5714111328125,\n+ \"1\": 144\n+ },\n+ \"flags\": {},\n+ \"order\": 0,\n+ \"mode\": 0,\n+ \"inputs\": [],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 18\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"LoadAudio\"\n+ },\n+ \"widgets_values\": [\n+ \"Whitney Houston - I Will Always Love You (Official 4K Video) [3JWTaaS7LdU].mp4\",\n+ null,\n+ \"\"\n+ ]\n+ },\n+ {\n+ \"id\": 18,\n+ \"type\": \"AudioCrop\",\n+ \"pos\": [\n+ -322,\n+ 508\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 82\n+ },\n+ \"flags\": {},\n+ \"order\": 1,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 18\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 19\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCrop\"\n+ },\n+ \"widgets_values\": [\n+ \"0:00\",\n+ \"1:00\"\n+ ]\n+ },\n+ {\n+ \"id\": 11,\n+ \"type\": \"AudioSeparation\",\n+ \"pos\": [\n+ 45,\n+ 494\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 166\n+ },\n+ \"flags\": {},\n+ \"order\": 2,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 19\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"Bass\",\n+ \"type\": \"AUDIO\",\n+ \"links\": null,\n+ \"shape\": 3\n+ },\n+ {\n+ \"name\": \"Drums\",\n+ \"type\": \"AUDIO\",\n+ \"links\": null,\n+ \"shape\": 3\n+ },\n+ {\n+ \"name\": \"Other\",\n+ \"type\": \"AUDIO\",\n+ \"links\": null,\n+ \"shape\": 3\n+ },\n+ {\n+ \"name\": \"Vocals\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 15\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 3\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioSeparation\"\n+ },\n+ \"widgets_values\": [\n+ \"half_sine\",\n+ 16,\n+ 0.1\n+ ]\n+ },\n+ {\n+ \"id\": 15,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 416,\n+ 514\n+ ],\n+ \"size\": [\n+ 318.9408688964845,\n+ 76\n+ ],\n+ \"flags\": {},\n+ \"order\": 3,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 15\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ }\n+ ],\n+ \"links\": [\n+ [\n+ 15,\n+ 11,\n+ 3,\n+ 15,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 18,\n+ 10,\n+ 0,\n+ 18,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 19,\n+ 18,\n+ 0,\n+ 11,\n+ 0,\n+ \"AUDIO\"\n+ ]\n+ ],\n+ \"groups\": [],\n+ \"config\": {},\n+ \"extra\": {},\n+ \"version\": 0.4\n+}\n\\ No newline at end of file"},{"sha":"bd95b9e3e9addb6ef33cba419a36bdc51ff05b4f","filename":"example_workflows/Isolate Vocals from Video.jpg","status":"added","additions":0,"deletions":0,"changes":0,"blob_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FIsolate%20Vocals%20from%20Video.jpg","raw_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/raw/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FIsolate%20Vocals%20from%20Video.jpg","contents_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/contents/example_workflows%2FIsolate%20Vocals%20from%20Video.jpg?ref=5291831d7c321ab7a5192374482f9848dffee75b"},{"sha":"38008088ad5d8e48bfab793277c5783fefed8163","filename":"example_workflows/Isolate Vocals from Video.json","status":"added","additions":198,"deletions":0,"changes":198,"blob_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FIsolate%20Vocals%20from%20Video.json","raw_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/raw/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FIsolate%20Vocals%20from%20Video.json","contents_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/contents/example_workflows%2FIsolate%20Vocals%20from%20Video.json?ref=5291831d7c321ab7a5192374482f9848dffee75b","patch":"@@ -0,0 +1,198 @@\n+{\n+ \"last_node_id\": 16,\n+ \"last_link_id\": 17,\n+ \"nodes\": [\n+ {\n+ \"id\": 10,\n+ \"type\": \"LoadAudio\",\n+ \"pos\": [\n+ -417,\n+ 574\n+ ],\n+ \"size\": {\n+ \"0\": 381.5714111328125,\n+ \"1\": 144\n+ },\n+ \"flags\": {},\n+ \"order\": 0,\n+ \"mode\": 0,\n+ \"inputs\": [],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 14\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"LoadAudio\"\n+ },\n+ \"widgets_values\": [\n+ \"Whitney Houston - I Will Always Love You (Official 4K Video) [3JWTaaS7LdU].mp4\",\n+ null,\n+ \"\"\n+ ]\n+ },\n+ {\n+ \"id\": 15,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 432,\n+ 490\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 76.00000762939453\n+ },\n+ \"flags\": {},\n+ \"order\": 2,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 15\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 11,\n+ \"type\": \"AudioSeparation\",\n+ \"pos\": [\n+ 37,\n+ 493\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 166\n+ },\n+ \"flags\": {},\n+ \"order\": 1,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 14\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"Bass\",\n+ \"type\": \"AUDIO\",\n+ \"links\": null,\n+ \"shape\": 3\n+ },\n+ {\n+ \"name\": \"Drums\",\n+ \"type\": \"AUDIO\",\n+ \"links\": null,\n+ \"shape\": 3\n+ },\n+ {\n+ \"name\": \"Other\",\n+ \"type\": \"AUDIO\",\n+ \"links\": null,\n+ \"shape\": 3\n+ },\n+ {\n+ \"name\": \"Vocals\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 15,\n+ 17\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 3\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioSeparation\"\n+ },\n+ \"widgets_values\": [\n+ \"half_sine\",\n+ 20,\n+ 0.2\n+ ]\n+ },\n+ {\n+ \"id\": 14,\n+ \"type\": \"AudioVideoCombine\",\n+ \"pos\": [\n+ 439,\n+ 656\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 130\n+ },\n+ \"flags\": {},\n+ \"order\": 3,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 17\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"saved_video_path\",\n+ \"type\": \"STRING\",\n+ \"links\": null,\n+ \"shape\": 3\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioVideoCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"/home/user/temp/Whitney Houston - I Will Always Love You (World Music Awards, 1994) [mK4hweZRU0k].mp4\",\n+ \"0:00\",\n+ \"4:34\",\n+ true\n+ ]\n+ }\n+ ],\n+ \"links\": [\n+ [\n+ 14,\n+ 10,\n+ 0,\n+ 11,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 15,\n+ 11,\n+ 3,\n+ 15,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 17,\n+ 11,\n+ 3,\n+ 14,\n+ 0,\n+ \"AUDIO\"\n+ ]\n+ ],\n+ \"groups\": [],\n+ \"config\": {},\n+ \"extra\": {},\n+ \"version\": 0.4\n+}\n\\ No newline at end of file"},{"sha":"0519ae812fdef389d930fe227777a213e90e0640","filename":"example_workflows/Remix Song.jpg","status":"added","additions":0,"deletions":0,"changes":0,"blob_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FRemix%20Song.jpg","raw_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/raw/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FRemix%20Song.jpg","contents_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/contents/example_workflows%2FRemix%20Song.jpg?ref=5291831d7c321ab7a5192374482f9848dffee75b"},{"sha":"eecd1685d0a95d7274e7c074a85d719fc04bba91","filename":"example_workflows/Remix Song.json","status":"added","additions":2006,"deletions":0,"changes":2006,"blob_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FRemix%20Song.json","raw_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/raw/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FRemix%20Song.json","contents_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/contents/example_workflows%2FRemix%20Song.json?ref=5291831d7c321ab7a5192374482f9848dffee75b","patch":"@@ -0,0 +1,2006 @@\n+{\n+ \"last_node_id\": 78,\n+ \"last_link_id\": 153,\n+ \"nodes\": [\n+ {\n+ \"id\": 4,\n+ \"type\": \"CheckpointLoaderSimple\",\n+ \"pos\": [\n+ -478.99468526611383,\n+ -103.56476081848126\n+ ],\n+ \"size\": {\n+ \"0\": 336,\n+ \"1\": 98\n+ },\n+ \"flags\": {},\n+ \"order\": 0,\n+ \"mode\": 0,\n+ \"outputs\": [\n+ {\n+ \"name\": \"MODEL\",\n+ \"type\": \"MODEL\",\n+ \"links\": [\n+ 18\n+ ],\n+ \"slot_index\": 0\n+ },\n+ {\n+ \"name\": \"CLIP\",\n+ \"type\": \"CLIP\",\n+ \"links\": [],\n+ \"slot_index\": 1\n+ },\n+ {\n+ \"name\": \"VAE\",\n+ \"type\": \"VAE\",\n+ \"links\": [\n+ 14,\n+ 28\n+ ],\n+ \"slot_index\": 2\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"CheckpointLoaderSimple\"\n+ },\n+ \"widgets_values\": [\n+ \"stable_audio_open_1.0.safetensors\"\n+ ]\n+ },\n+ {\n+ \"id\": 59,\n+ \"type\": \"AudioCombine\",\n+ \"pos\": [\n+ 2165.044339439087,\n+ 34.173244738464504\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 78\n+ },\n+ \"flags\": {},\n+ \"order\": 21,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 119\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 120,\n+ \"slot_index\": 1\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 123,\n+ 124\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"add\"\n+ ]\n+ },\n+ {\n+ \"id\": 63,\n+ \"type\": \"AudioCombine\",\n+ \"pos\": [\n+ 2167.2830541027847,\n+ 194.2891423605349\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 78\n+ },\n+ \"flags\": {},\n+ \"order\": 27,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 124\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 125\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 142\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"add\"\n+ ]\n+ },\n+ {\n+ \"id\": 45,\n+ \"type\": \"AudioCombine\",\n+ \"pos\": [\n+ 2769.2961894445793,\n+ 933.0202940130633\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 78\n+ },\n+ \"flags\": {},\n+ \"order\": 23,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 93\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 95,\n+ \"slot_index\": 1\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 102,\n+ 140,\n+ 143\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"add\"\n+ ]\n+ },\n+ {\n+ \"id\": 50,\n+ \"type\": \"AudioCombine\",\n+ \"pos\": [\n+ 2949.2961894445793,\n+ 1123.020294013063\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 78\n+ },\n+ \"flags\": {},\n+ \"order\": 28,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 102\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 128\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 103,\n+ 144\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"add\"\n+ ]\n+ },\n+ {\n+ \"id\": 46,\n+ \"type\": \"AudioCombine\",\n+ \"pos\": [\n+ 3089.2961894445793,\n+ 1273.020294013063\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 78\n+ },\n+ \"flags\": {},\n+ \"order\": 33,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 103\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 129\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 131,\n+ 145\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"add\"\n+ ]\n+ },\n+ {\n+ \"id\": 65,\n+ \"type\": \"AudioCombine\",\n+ \"pos\": [\n+ 3239.2961894445793,\n+ 1463.020294013063\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 78\n+ },\n+ \"flags\": {},\n+ \"order\": 36,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 131\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 132\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 146\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"add\"\n+ ]\n+ },\n+ {\n+ \"id\": 68,\n+ \"type\": \"AudioCombine\",\n+ \"pos\": [\n+ 2349.2961894445793,\n+ 1503.020294013063\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 78\n+ },\n+ \"flags\": {},\n+ \"order\": 29,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 140\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 137\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 147\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"add\"\n+ ]\n+ },\n+ {\n+ \"id\": 75,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 2719.2961894445793,\n+ 1513.020294013063\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 76\n+ },\n+ \"flags\": {},\n+ \"order\": 35,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 147\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 70,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 3589.2961894445793,\n+ 1463.020294013063\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 76\n+ },\n+ \"flags\": {},\n+ \"order\": 38,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 146\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 61,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 2533.044339439087,\n+ 37.173244738464504\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 76.0000228881836\n+ },\n+ \"flags\": {},\n+ \"order\": 26,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 123\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 74,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 2548.2830541027847,\n+ 196.2891423605349\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 76\n+ },\n+ \"flags\": {},\n+ \"order\": 32,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 142\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 40,\n+ \"type\": \"AudioCrop\",\n+ \"pos\": [\n+ 387.76071461151156,\n+ 1344.405792161253\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 82\n+ },\n+ \"flags\": {},\n+ \"order\": 6,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 69\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 70,\n+ 109\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCrop\"\n+ },\n+ \"widgets_values\": [\n+ \"0:45\",\n+ \"1:30\"\n+ ]\n+ },\n+ {\n+ \"id\": 44,\n+ \"type\": \"AudioTempoMatch\",\n+ \"pos\": [\n+ 2369.2961894445793,\n+ 733.0202940130623\n+ ],\n+ \"size\": {\n+ \"0\": 210,\n+ \"1\": 46\n+ },\n+ \"flags\": {},\n+ \"order\": 18,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 86\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 109\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 93,\n+ 122,\n+ 141\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ },\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [],\n+ \"shape\": 3,\n+ \"slot_index\": 1\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioTempoMatch\"\n+ }\n+ },\n+ {\n+ \"id\": 58,\n+ \"type\": \"AudioTempoMatch\",\n+ \"pos\": [\n+ 2379.2961894445793,\n+ 623.0202940130621\n+ ],\n+ \"size\": {\n+ \"0\": 210,\n+ \"1\": 46\n+ },\n+ \"flags\": {},\n+ \"order\": 20,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 117\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 114\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 139\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ },\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [],\n+ \"shape\": 3,\n+ \"slot_index\": 1\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioTempoMatch\"\n+ }\n+ },\n+ {\n+ \"id\": 67,\n+ \"type\": \"AudioTempoMatch\",\n+ \"pos\": [\n+ 2379.2961894445793,\n+ 843.020294013063\n+ ],\n+ \"size\": {\n+ \"0\": 210,\n+ \"1\": 46\n+ },\n+ \"flags\": {},\n+ \"order\": 22,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 133\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 135\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ },\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 137\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 1\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioTempoMatch\"\n+ }\n+ },\n+ {\n+ \"id\": 19,\n+ \"type\": \"VAEEncodeAudio\",\n+ \"pos\": [\n+ 711.0053147338859,\n+ 166.43523918151925\n+ ],\n+ \"size\": {\n+ \"0\": 210,\n+ \"1\": 46\n+ },\n+ \"flags\": {},\n+ \"order\": 14,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 152\n+ },\n+ {\n+ \"name\": \"vae\",\n+ \"type\": \"VAE\",\n+ \"link\": 28\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"LATENT\",\n+ \"type\": \"LATENT\",\n+ \"links\": [\n+ 68\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"VAEEncodeAudio\"\n+ }\n+ },\n+ {\n+ \"id\": 10,\n+ \"type\": \"CLIPLoader\",\n+ \"pos\": [\n+ -478.99468526611383,\n+ -253.56476081848115\n+ ],\n+ \"size\": {\n+ \"0\": 335.6534118652344,\n+ \"1\": 82\n+ },\n+ \"flags\": {},\n+ \"order\": 1,\n+ \"mode\": 0,\n+ \"outputs\": [\n+ {\n+ \"name\": \"CLIP\",\n+ \"type\": \"CLIP\",\n+ \"links\": [\n+ 25,\n+ 26\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"CLIPLoader\"\n+ },\n+ \"widgets_values\": [\n+ \"t5_base.safetensors\",\n+ \"stable_audio\"\n+ ]\n+ },\n+ {\n+ \"id\": 41,\n+ \"type\": \"Note\",\n+ \"pos\": [\n+ -103.99468526611356,\n+ -378.5647608184821\n+ ],\n+ \"size\": {\n+ \"0\": 470.54241943359375,\n+ \"1\": 594.5072021484375\n+ },\n+ \"flags\": {},\n+ \"order\": 2,\n+ \"mode\": 0,\n+ \"properties\": {\n+ \"text\": \"\"\n+ },\n+ \"widgets_values\": [\n+ \"Stable Audio Prompt Library (these prompts work well, they are from StableAudio website)\\n\\n-----------------\\n\\n\\nTrance\\n\\nTrance, Ibiza, Beach, Sun, 4 AM, Progressive, Synthesizer, 909, Dramatic Chords, Choir, Euphoric, Nostalgic, Dynamic, Flowing\\n\\nUpbeat\\n\\n3/4, in 3, 3 beat, guitar, drums, bright, happy, claps\\n\\nSynthpop\\n\\nSynthpop, Big Reverbed Synthesizer Pad Chords, Driving Gated Drum Machine, Atmospheric, Moody, Nostalgic, Cool, Club, Striped-back, Pop Instrumental, 100 BPM\\n\\nEpic Rock\\n\\nPost-Rock, Guitars, Drum Kit, Bass, Strings, Euphoric, Up-Lifting, Moody, Flowing, Raw, Epic, Sentimental, 125 BPM\\n\\n\\nAmbient\\n\\nAmbient Techno, meditation, Scandinavian Forest, 808 drum machine, 808 kick, claps, shaker, synthesizer, synth bass, Synth Drones, beautiful, peaceful, Ethereal, Natural, 122 BPM, Instrumental\\n\\n\\nPop\\n\\nPop, Pop-Electronic, Ballad, Billboard, Drum Machine, Bass, Lush Synthesizer Pads, Synthesizer Arp, Synth Bass, Vocal Sample Chops, Percussion, Honest, Heart-Felt, Melancholic, Vibe, Cool, Modern, Atmospheric, 115 BPM\\n\\n\\nChillhop\\n\\nLofi hip hop beat, chillhop\\n\\nTechno\\n\\nTechno, Berlin Techno, Rave, Tresnor, Drum Machine, Thumping Kick, Rumble Kick, Synthesizer Arp, Modular Synthesis, Reverbed Percussion Hits, Percussion, Dark, Moody, Serious, Vibe, Hypnotic, Evolving, 135 BPM\\n\\nDisco\\n\\nDisco, Driving Drum Machine, Synthesizer, Bass, Piano, Guitars, Instrumental, Clubby, Euphoric, Chicago, New York, 115 BPM\\n\\nModern\\n\\nAmbient house, new age, meditation, advertisement, 808 drum machine, 808 kick, claps, shaker, synthesizer, synth bass, soaring lead heavily reverbed, modern, sleek, beautiful, inspiring, futuristic\\n\\nCalmn\\n\\nCalm meditation music to play in a spa lobby\\n\\nHouse\\n\\nHouse, Ibiza, Drum Machine, Synthesizer, Percussion, Synth Bass, Synthesizer Arp, Clubby, Dancy, Euphoric, Feel-Good, Vibey, Cool, Clean, 125 BPM\\n\\nClassic Rock\\n\\nClassic Rock, Drum Kit, Electric Guitar, Bass, Raw, Uplifting, Anthem, Moody, Melancholic, Melodic, 130 BPM\\n\\nTrip Hop\\n\\nTrip Hop, Cinematic, soundtrack, Bristol, Drum Kit, Bass, Rhodes, Choir, Cool, Moody, Melancholic, Atmospheric, Dreamy, groovy, introspective, thoughtful, beautiful, 85 BPM\\n\\nNew Age\\n\\nNew-Age Electronic, Synthesizer, Choir, Bass, Ambient, Atmospheric, Peaceful, Meditative, Relaxing, Laid-Back, 50 BPM\\n\\nPop\\n\\nPop, Pop-Electronic, Ballad, Billboard, Drum Machine, Bass, Lush Synthesizer Pads, Synthesizer Arp, Synth Bass, Vocal Sample Chops, Percussion, Honest, Heart-Felt, Melancholic, Vibe, Cool, Modern, Atmospheric, 115 BPM\\n\\n\\n\"\n+ ],\n+ \"color\": \"#222\",\n+ \"bgcolor\": \"#000\"\n+ },\n+ {\n+ \"id\": 6,\n+ \"type\": \"CLIPTextEncode\",\n+ \"pos\": [\n+ 399.0053147338872,\n+ -294.5647608184816\n+ ],\n+ \"size\": {\n+ \"0\": 420.2683410644531,\n+ \"1\": 159.3562469482422\n+ },\n+ \"flags\": {},\n+ \"order\": 4,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"clip\",\n+ \"type\": \"CLIP\",\n+ \"link\": 25\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"CONDITIONING\",\n+ \"type\": \"CONDITIONING\",\n+ \"links\": [\n+ 4\n+ ],\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"CLIPTextEncode\"\n+ },\n+ \"widgets_values\": [\n+ \"Lofi hip hop beat, chillhop, 94 BPM\"\n+ ],\n+ \"color\": \"#232\",\n+ \"bgcolor\": \"#353\"\n+ },\n+ {\n+ \"id\": 7,\n+ \"type\": \"CLIPTextEncode\",\n+ \"pos\": [\n+ 407.0053147338872,\n+ -77.5647608184813\n+ ],\n+ \"size\": {\n+ \"0\": 414.9990234375,\n+ \"1\": 111.2406997680664\n+ },\n+ \"flags\": {},\n+ \"order\": 5,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"clip\",\n+ \"type\": \"CLIP\",\n+ \"link\": 26\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"CONDITIONING\",\n+ \"type\": \"CONDITIONING\",\n+ \"links\": [\n+ 6\n+ ],\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"CLIPTextEncode\"\n+ },\n+ \"widgets_values\": [\n+ \"distorted, low quality\"\n+ ],\n+ \"color\": \"#322\",\n+ \"bgcolor\": \"#533\"\n+ },\n+ {\n+ \"id\": 3,\n+ \"type\": \"KSampler\",\n+ \"pos\": [\n+ 874.0053147338859,\n+ -284.56476081848143\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 262\n+ },\n+ \"flags\": {},\n+ \"order\": 16,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"model\",\n+ \"type\": \"MODEL\",\n+ \"link\": 18\n+ },\n+ {\n+ \"name\": \"positive\",\n+ \"type\": \"CONDITIONING\",\n+ \"link\": 4\n+ },\n+ {\n+ \"name\": \"negative\",\n+ \"type\": \"CONDITIONING\",\n+ \"link\": 6\n+ },\n+ {\n+ \"name\": \"latent_image\",\n+ \"type\": \"LATENT\",\n+ \"link\": 68,\n+ \"slot_index\": 3\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"LATENT\",\n+ \"type\": \"LATENT\",\n+ \"links\": [\n+ 13\n+ ],\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"KSampler\"\n+ },\n+ \"widgets_values\": [\n+ 662958613279377,\n+ \"randomize\",\n+ 70,\n+ 5,\n+ \"dpmpp_3m_sde_gpu\",\n+ \"exponential\",\n+ 0.78\n+ ]\n+ },\n+ {\n+ \"id\": 12,\n+ \"type\": \"VAEDecodeAudio\",\n+ \"pos\": [\n+ 1254.005314733888,\n+ -255.56476081848115\n+ ],\n+ \"size\": {\n+ \"0\": 210,\n+ \"1\": 46\n+ },\n+ \"flags\": {},\n+ \"order\": 17,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"samples\",\n+ \"type\": \"LATENT\",\n+ \"link\": 13\n+ },\n+ {\n+ \"name\": \"vae\",\n+ \"type\": \"VAE\",\n+ \"link\": 14,\n+ \"slot_index\": 1\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 86,\n+ 99,\n+ 114,\n+ 119,\n+ 133\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"VAEDecodeAudio\"\n+ }\n+ },\n+ {\n+ \"id\": 48,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 1242.005314733888,\n+ -57.56476081848145\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 76.00000762939453\n+ },\n+ \"flags\": {},\n+ \"order\": 19,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 99\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 27,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 513.5805325506594,\n+ 1620.2087054052708\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 76.00003814697266\n+ },\n+ \"flags\": {},\n+ \"order\": 8,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 58\n+ }\n+ ],\n+ \"title\": \"Bass\",\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 28,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 872.5805325506577,\n+ 1606.2087054052708\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 76.00003814697266\n+ },\n+ \"flags\": {},\n+ \"order\": 9,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 59\n+ }\n+ ],\n+ \"title\": \"Drums\",\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 29,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 1223.580532550659,\n+ 1616.2087054052708\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 76.00003814697266\n+ },\n+ \"flags\": {},\n+ \"order\": 11,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 60\n+ }\n+ ],\n+ \"title\": \"Other\",\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 30,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 1572.5805325506587,\n+ 1615.2087054052708\n+ ],\n+ \"size\": {\n+ \"0\": 319.77947998046875,\n+ \"1\": 76.00003814697266\n+ },\n+ \"flags\": {},\n+ \"order\": 12,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 61\n+ }\n+ ],\n+ \"title\": \"Vocals\",\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 56,\n+ \"type\": \"AudioCombine\",\n+ \"pos\": [\n+ 2689,\n+ 763\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 78\n+ },\n+ \"flags\": {},\n+ \"order\": 25,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 139\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 141,\n+ \"slot_index\": 1\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 112\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"add\"\n+ ]\n+ },\n+ {\n+ \"id\": 35,\n+ \"type\": \"AudioSeparation\",\n+ \"pos\": [\n+ 843,\n+ 1276\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 166\n+ },\n+ \"flags\": {},\n+ \"order\": 7,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 70\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"Bass\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 58,\n+ 132,\n+ 135,\n+ 148\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ },\n+ {\n+ \"name\": \"Drums\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 59,\n+ 129,\n+ 149\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 1\n+ },\n+ {\n+ \"name\": \"Other\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 60,\n+ 125,\n+ 128,\n+ 151\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 2\n+ },\n+ {\n+ \"name\": \"Vocals\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 61,\n+ 95,\n+ 117,\n+ 120\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 3\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioSeparation\"\n+ },\n+ \"widgets_values\": [\n+ \"linear\",\n+ 20,\n+ 0.1\n+ ]\n+ },\n+ {\n+ \"id\": 76,\n+ \"type\": \"AudioCombine\",\n+ \"pos\": [\n+ 725.1678726196284,\n+ 520.3888599853516\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 78\n+ },\n+ \"flags\": {},\n+ \"order\": 13,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 151\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 150,\n+ \"slot_index\": 1\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 152,\n+ 153\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"add\"\n+ ]\n+ },\n+ {\n+ \"id\": 77,\n+ \"type\": \"AudioCombine\",\n+ \"pos\": [\n+ 583.1678726196284,\n+ 670.3888599853516\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 78\n+ },\n+ \"flags\": {},\n+ \"order\": 10,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 148\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 149,\n+ \"slot_index\": 1\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 150\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"add\"\n+ ]\n+ },\n+ {\n+ \"id\": 78,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 1033.1678726196283,\n+ 679.3888599853516\n+ ],\n+ \"size\": [\n+ 304.38883653046173,\n+ 76.00002384185791\n+ ],\n+ \"flags\": {},\n+ \"order\": 15,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 153\n+ }\n+ ],\n+ \"title\": \"Vocals Removed\",\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 20,\n+ \"type\": \"LoadAudio\",\n+ \"pos\": [\n+ -192.23928538848884,\n+ 1314.4057921612534\n+ ],\n+ \"size\": {\n+ \"0\": 498.1937561035156,\n+ \"1\": 164.7704315185547\n+ },\n+ \"flags\": {},\n+ \"order\": 3,\n+ \"mode\": 0,\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 69\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"LoadAudio\"\n+ },\n+ \"widgets_values\": [\n+ \"Etta James - I'd Rather Go Blind.mp3\",\n+ null,\n+ \"\"\n+ ]\n+ },\n+ {\n+ \"id\": 57,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 3039.2961894445793,\n+ 763.0202940130628\n+ ],\n+ \"size\": {\n+ \"0\": 309.6981201171875,\n+ \"1\": 76\n+ },\n+ \"flags\": {},\n+ \"order\": 31,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 112\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 62,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 2769.2961894445793,\n+ 583.0202940130621\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 76.0000228881836\n+ },\n+ \"flags\": {},\n+ \"order\": 24,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 122\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 73,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 3119.2961894445793,\n+ 933.0202940130633\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 76\n+ },\n+ \"flags\": {},\n+ \"order\": 30,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 143\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 72,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 3299.2961894445793,\n+ 1113.020294013063\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 76\n+ },\n+ \"flags\": {},\n+ \"order\": 34,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 144\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 71,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 3439.2961894445793,\n+ 1283.020294013063\n+ ],\n+ \"size\": [\n+ 312.57118067264173,\n+ 75.99996948242188\n+ ],\n+ \"flags\": {},\n+ \"order\": 37,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 145\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ }\n+ ],\n+ \"links\": [\n+ [\n+ 4,\n+ 6,\n+ 0,\n+ 3,\n+ 1,\n+ \"CONDITIONING\"\n+ ],\n+ [\n+ 6,\n+ 7,\n+ 0,\n+ 3,\n+ 2,\n+ \"CONDITIONING\"\n+ ],\n+ [\n+ 13,\n+ 3,\n+ 0,\n+ 12,\n+ 0,\n+ \"LATENT\"\n+ ],\n+ [\n+ 14,\n+ 4,\n+ 2,\n+ 12,\n+ 1,\n+ \"VAE\"\n+ ],\n+ [\n+ 18,\n+ 4,\n+ 0,\n+ 3,\n+ 0,\n+ \"MODEL\"\n+ ],\n+ [\n+ 25,\n+ 10,\n+ 0,\n+ 6,\n+ 0,\n+ \"CLIP\"\n+ ],\n+ [\n+ 26,\n+ 10,\n+ 0,\n+ 7,\n+ 0,\n+ \"CLIP\"\n+ ],\n+ [\n+ 28,\n+ 4,\n+ 2,\n+ 19,\n+ 1,\n+ \"VAE\"\n+ ],\n+ [\n+ 58,\n+ 35,\n+ 0,\n+ 27,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 59,\n+ 35,\n+ 1,\n+ 28,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 60,\n+ 35,\n+ 2,\n+ 29,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 61,\n+ 35,\n+ 3,\n+ 30,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 68,\n+ 19,\n+ 0,\n+ 3,\n+ 3,\n+ \"LATENT\"\n+ ],\n+ [\n+ 69,\n+ 20,\n+ 0,\n+ 40,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 70,\n+ 40,\n+ 0,\n+ 35,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 86,\n+ 12,\n+ 0,\n+ 44,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 93,\n+ 44,\n+ 0,\n+ 45,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 95,\n+ 35,\n+ 3,\n+ 45,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 99,\n+ 12,\n+ 0,\n+ 48,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 102,\n+ 45,\n+ 0,\n+ 50,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 103,\n+ 50,\n+ 0,\n+ 46,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 109,\n+ 40,\n+ 0,\n+ 44,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 112,\n+ 56,\n+ 0,\n+ 57,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 114,\n+ 12,\n+ 0,\n+ 58,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 117,\n+ 35,\n+ 3,\n+ 58,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 119,\n+ 12,\n+ 0,\n+ 59,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 120,\n+ 35,\n+ 3,\n+ 59,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 122,\n+ 44,\n+ 0,\n+ 62,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 123,\n+ 59,\n+ 0,\n+ 61,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 124,\n+ 59,\n+ 0,\n+ 63,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 125,\n+ 35,\n+ 2,\n+ 63,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 128,\n+ 35,\n+ 2,\n+ 50,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 129,\n+ 35,\n+ 1,\n+ 46,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 131,\n+ 46,\n+ 0,\n+ 65,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 132,\n+ 35,\n+ 0,\n+ 65,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 133,\n+ 12,\n+ 0,\n+ 67,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 135,\n+ 35,\n+ 0,\n+ 67,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 137,\n+ 67,\n+ 1,\n+ 68,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 139,\n+ 58,\n+ 0,\n+ 56,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 140,\n+ 45,\n+ 0,\n+ 68,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 141,\n+ 44,\n+ 0,\n+ 56,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 142,\n+ 63,\n+ 0,\n+ 74,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 143,\n+ 45,\n+ 0,\n+ 73,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 144,\n+ 50,\n+ 0,\n+ 72,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 145,\n+ 46,\n+ 0,\n+ 71,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 146,\n+ 65,\n+ 0,\n+ 70,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 147,\n+ 68,\n+ 0,\n+ 75,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 148,\n+ 35,\n+ 0,\n+ 77,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 149,\n+ 35,\n+ 1,\n+ 77,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 150,\n+ 77,\n+ 0,\n+ 76,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 151,\n+ 35,\n+ 2,\n+ 76,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 152,\n+ 76,\n+ 0,\n+ 19,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 153,\n+ 76,\n+ 0,\n+ 78,\n+ 0,\n+ \"AUDIO\"\n+ ]\n+ ],\n+ \"groups\": [\n+ {\n+ \"title\": \"Simple Combine (No Tempo Changes)\",\n+ \"bounding\": [\n+ 2086,\n+ -77,\n+ 846,\n+ 419\n+ ],\n+ \"color\": \"#88A\",\n+ \"font_size\": 24\n+ },\n+ {\n+ \"title\": \"Create New Audio\",\n+ \"bounding\": [\n+ -539,\n+ -528,\n+ 2504,\n+ 806\n+ ],\n+ \"color\": \"#8AA\",\n+ \"font_size\": 24\n+ },\n+ {\n+ \"title\": \"Separate Audio Stems\",\n+ \"bounding\": [\n+ -307,\n+ 917,\n+ 2239,\n+ 872\n+ ],\n+ \"color\": \"#3f789e\",\n+ \"font_size\": 24\n+ },\n+ {\n+ \"title\": \"Test Combinations of New and Old with Tempo Matching\",\n+ \"bounding\": [\n+ 2085,\n+ 396,\n+ 1870,\n+ 1264\n+ ],\n+ \"color\": \"#88A\",\n+ \"font_size\": 24\n+ },\n+ {\n+ \"title\": \"Recombine All but Vocals\",\n+ \"bounding\": [\n+ 476,\n+ 368,\n+ 964,\n+ 464\n+ ],\n+ \"color\": \"#3f789e\",\n+ \"font_size\": 24\n+ }\n+ ],\n+ \"config\": {},\n+ \"extra\": {\n+ \"ds\": {\n+ \"scale\": 0.5131581182307071,\n+ \"offset\": {\n+ \"0\": 535.9907906214594,\n+ \"1\": 924.0200318758029\n+ }\n+ }\n+ },\n+ \"version\": 0.4\n+}\n\\ No newline at end of file"},{"sha":"46728354aca16a60b4fb916ce83d54128d1a1ba8","filename":"example_workflows/Replace BGM with Stable-Audio-Generated Music.jpg","status":"added","additions":0,"deletions":0,"changes":0,"blob_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FReplace%20BGM%20with%20Stable-Audio-Generated%20Music.jpg","raw_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/raw/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FReplace%20BGM%20with%20Stable-Audio-Generated%20Music.jpg","contents_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/contents/example_workflows%2FReplace%20BGM%20with%20Stable-Audio-Generated%20Music.jpg?ref=5291831d7c321ab7a5192374482f9848dffee75b"},{"sha":"d3c813774f020b998c1a0ac94f208e4446ec11b0","filename":"example_workflows/Replace BGM with Stable-Audio-Generated Music.json","status":"added","additions":1246,"deletions":0,"changes":1246,"blob_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FReplace%20BGM%20with%20Stable-Audio-Generated%20Music.json","raw_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/raw/5291831d7c321ab7a5192374482f9848dffee75b/example_workflows%2FReplace%20BGM%20with%20Stable-Audio-Generated%20Music.json","contents_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/contents/example_workflows%2FReplace%20BGM%20with%20Stable-Audio-Generated%20Music.json?ref=5291831d7c321ab7a5192374482f9848dffee75b","patch":"@@ -0,0 +1,1246 @@\n+{\n+ \"last_node_id\": 94,\n+ \"last_link_id\": 173,\n+ \"nodes\": [\n+ {\n+ \"id\": 7,\n+ \"type\": \"CLIPTextEncode\",\n+ \"pos\": [\n+ 606.5174630170885,\n+ 416.9215694855039\n+ ],\n+ \"size\": {\n+ \"0\": 417.080078125,\n+ \"1\": 122.07127380371094\n+ },\n+ \"flags\": {},\n+ \"order\": 7,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"clip\",\n+ \"type\": \"CLIP\",\n+ \"link\": 26\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"CONDITIONING\",\n+ \"type\": \"CONDITIONING\",\n+ \"links\": [\n+ 6\n+ ],\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"CLIPTextEncode\"\n+ },\n+ \"widgets_values\": [\n+ \"distorted, low quality\"\n+ ],\n+ \"color\": \"#322\",\n+ \"bgcolor\": \"#533\"\n+ },\n+ {\n+ \"id\": 57,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 2974.753588262695,\n+ 1153.3026287800308\n+ ],\n+ \"size\": {\n+ \"0\": 357.0879211425781,\n+ \"1\": 116.27761840820312\n+ },\n+ \"flags\": {},\n+ \"order\": 23,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 112\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 3,\n+ \"type\": \"KSampler\",\n+ \"pos\": [\n+ 1096.5174630170895,\n+ 246.92156948550402\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 262\n+ },\n+ \"flags\": {},\n+ \"order\": 17,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"model\",\n+ \"type\": \"MODEL\",\n+ \"link\": 18\n+ },\n+ {\n+ \"name\": \"positive\",\n+ \"type\": \"CONDITIONING\",\n+ \"link\": 4\n+ },\n+ {\n+ \"name\": \"negative\",\n+ \"type\": \"CONDITIONING\",\n+ \"link\": 6\n+ },\n+ {\n+ \"name\": \"latent_image\",\n+ \"type\": \"LATENT\",\n+ \"link\": 68,\n+ \"slot_index\": 3\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"LATENT\",\n+ \"type\": \"LATENT\",\n+ \"links\": [\n+ 13\n+ ],\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"KSampler\"\n+ },\n+ \"widgets_values\": [\n+ 973858906308462,\n+ \"randomize\",\n+ 25,\n+ 4.5,\n+ \"dpmpp_3m_sde_gpu\",\n+ \"exponential\",\n+ 0.98\n+ ]\n+ },\n+ {\n+ \"id\": 41,\n+ \"type\": \"Note\",\n+ \"pos\": [\n+ 146.51746301708997,\n+ 146.9215694855043\n+ ],\n+ \"size\": {\n+ \"0\": 439.3000183105469,\n+ \"1\": 395.3994445800781\n+ },\n+ \"flags\": {},\n+ \"order\": 0,\n+ \"mode\": 0,\n+ \"properties\": {\n+ \"text\": \"\"\n+ },\n+ \"widgets_values\": [\n+ \"Stable Audio Prompt Library (these prompts work well, they are from StableAudio website)\\n\\n\\nTrance\\n\\nTrance, Ibiza, Beach, Sun, 4 AM, Progressive, Synthesizer, 909, Dramatic Chords, Choir, Euphoric, Nostalgic, Dynamic, Flowing\\n\\nUpbeat\\n\\n3/4, in 3, 3 beat, guitar, drums, bright, happy, claps\\n\\nSynthpop\\n\\nSynthpop, Big Reverbed Synthesizer Pad Chords, Driving Gated Drum Machine, Atmospheric, Moody, Nostalgic, Cool, Club, Striped-back, Pop Instrumental, 100 BPM\\n\\nEpic Rock\\n\\nPost-Rock, Guitars, Drum Kit, Bass, Strings, Euphoric, Up-Lifting, Moody, Flowing, Raw, Epic, Sentimental, 125 BPM\\n\\n\\nAmbient\\n\\nAmbient Techno, meditation, Scandinavian Forest, 808 drum machine, 808 kick, claps, shaker, synthesizer, synth bass, Synth Drones, beautiful, peaceful, Ethereal, Natural, 122 BPM, Instrumental\\n\\n\\nPop\\n\\nPop, Pop-Electronic, Ballad, Billboard, Drum Machine, Bass, Lush Synthesizer Pads, Synthesizer Arp, Synth Bass, Vocal Sample Chops, Percussion, Honest, Heart-Felt, Melancholic, Vibe, Cool, Modern, Atmospheric, 115 BPM\\n\\n\\nChillhop\\n\\nLofi hip hop beat, chillhop\\n\\nTechno\\n\\nTechno, Berlin Techno, Rave, Tresnor, Drum Machine, Thumping Kick, Rumble Kick, Synthesizer Arp, Modular Synthesis, Reverbed Percussion Hits, Percussion, Dark, Moody, Serious, Vibe, Hypnotic, Evolving, 135 BPM\\n\\nDisco\\n\\nDisco, Driving Drum Machine, Synthesizer, Bass, Piano, Guitars, Instrumental, Clubby, Euphoric, Chicago, New York, 115 BPM\\n\\nModern\\n\\nAmbient house, new age, meditation, advertisement, 808 drum machine, 808 kick, claps, shaker, synthesizer, synth bass, soaring lead heavily reverbed, modern, sleek, beautiful, inspiring, futuristic\\n\\nCalmn\\n\\nCalm meditation music to play in a spa lobby\\n\\nHouse\\n\\nHouse, Ibiza, Drum Machine, Synthesizer, Percussion, Synth Bass, Synthesizer Arp, Clubby, Dancy, Euphoric, Feel-Good, Vibey, Cool, Clean, 125 BPM\\n\\nClassic Rock\\n\\nClassic Rock, Drum Kit, Electric Guitar, Bass, Raw, Uplifting, Anthem, Moody, Melancholic, Melodic, 130 BPM\\n\\nTrip Hop\\n\\nTrip Hop, Cinematic, soundtrack, Bristol, Drum Kit, Bass, Rhodes, Choir, Cool, Moody, Melancholic, Atmospheric, Dreamy, groovy, introspective, thoughtful, beautiful, 85 BPM\\n\\nNew Age\\n\\nNew-Age Electronic, Synthesizer, Choir, Bass, Ambient, Atmospheric, Peaceful, Meditative, Relaxing, Laid-Back, 50 BPM\\n\\nPop\\n\\nPop, Pop-Electronic, Ballad, Billboard, Drum Machine, Bass, Lush Synthesizer Pads, Synthesizer Arp, Synth Bass, Vocal Sample Chops, Percussion, Honest, Heart-Felt, Melancholic, Vibe, Cool, Modern, Atmospheric, 115 BPM\\n\\n\\n\"\n+ ],\n+ \"color\": \"#222\",\n+ \"bgcolor\": \"#000\"\n+ },\n+ {\n+ \"id\": 4,\n+ \"type\": \"CheckpointLoaderSimple\",\n+ \"pos\": [\n+ -303.4825369829104,\n+ 386.9215694855039\n+ ],\n+ \"size\": {\n+ \"0\": 357.7110900878906,\n+ \"1\": 98.69783020019531\n+ },\n+ \"flags\": {},\n+ \"order\": 1,\n+ \"mode\": 0,\n+ \"outputs\": [\n+ {\n+ \"name\": \"MODEL\",\n+ \"type\": \"MODEL\",\n+ \"links\": [\n+ 18\n+ ],\n+ \"slot_index\": 0\n+ },\n+ {\n+ \"name\": \"CLIP\",\n+ \"type\": \"CLIP\",\n+ \"links\": [],\n+ \"slot_index\": 1\n+ },\n+ {\n+ \"name\": \"VAE\",\n+ \"type\": \"VAE\",\n+ \"links\": [\n+ 14,\n+ 28\n+ ],\n+ \"slot_index\": 2\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"CheckpointLoaderSimple\"\n+ },\n+ \"widgets_values\": [\n+ \"stable_audio_open_1.0.safetensors\"\n+ ]\n+ },\n+ {\n+ \"id\": 6,\n+ \"type\": \"CLIPTextEncode\",\n+ \"pos\": [\n+ 606.5174630170885,\n+ 236.92156948550405\n+ ],\n+ \"size\": {\n+ \"0\": 420.080078125,\n+ \"1\": 122.67131042480469\n+ },\n+ \"flags\": {},\n+ \"order\": 6,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"clip\",\n+ \"type\": \"CLIP\",\n+ \"link\": 25\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"CONDITIONING\",\n+ \"type\": \"CONDITIONING\",\n+ \"links\": [\n+ 4\n+ ],\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"CLIPTextEncode\"\n+ },\n+ \"widgets_values\": [\n+ \"New-Age Electronic, Synthesizer, Choir, Bass, Ambient, Atmospheric, Peaceful, Meditative, Relaxing, Laid-Back, 50 BPM\\n\"\n+ ],\n+ \"color\": \"#232\",\n+ \"bgcolor\": \"#353\"\n+ },\n+ {\n+ \"id\": 20,\n+ \"type\": \"LoadAudio\",\n+ \"pos\": [\n+ -495.5700338942366,\n+ 1805.3184771760143\n+ ],\n+ \"size\": {\n+ \"0\": 498.1937561035156,\n+ \"1\": 164.7704315185547\n+ },\n+ \"flags\": {},\n+ \"order\": 2,\n+ \"mode\": 0,\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 69\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"LoadAudio\"\n+ },\n+ \"widgets_values\": [\n+ \"westworld.webm\",\n+ null,\n+ \"\"\n+ ]\n+ },\n+ {\n+ \"id\": 68,\n+ \"type\": \"AudioCombine\",\n+ \"pos\": [\n+ 2264.753588262695,\n+ 1153.3026287800308\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 78\n+ },\n+ \"flags\": {},\n+ \"order\": 19,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 153\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 162\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 147,\n+ 155\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"add\"\n+ ]\n+ },\n+ {\n+ \"id\": 35,\n+ \"type\": \"AudioSeparation\",\n+ \"pos\": [\n+ 474.1852589524428,\n+ 1799.4936311310917\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 166\n+ },\n+ \"flags\": {},\n+ \"order\": 8,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 70\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"Bass\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 58,\n+ 162,\n+ 166\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ },\n+ {\n+ \"name\": \"Drums\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 164,\n+ 167\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 1\n+ },\n+ {\n+ \"name\": \"Other\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 165,\n+ 168\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 2\n+ },\n+ {\n+ \"name\": \"Vocals\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 61,\n+ 156\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 3\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioSeparation\"\n+ },\n+ \"widgets_values\": [\n+ \"linear\",\n+ 20,\n+ 0.1\n+ ],\n+ \"color\": \"#233\",\n+ \"bgcolor\": \"#355\"\n+ },\n+ {\n+ \"id\": 89,\n+ \"type\": \"AudioCombine\",\n+ \"pos\": [\n+ 717.0453763801272,\n+ 1219.5315789311524\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 78\n+ },\n+ \"flags\": {},\n+ \"order\": 11,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 166\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 167\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 169\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"add\"\n+ ]\n+ },\n+ {\n+ \"id\": 88,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 1427.6807945922972,\n+ 2065.7185909772816\n+ ],\n+ \"size\": {\n+ \"0\": 343.0451965332031,\n+ \"1\": 78.96603393554688\n+ },\n+ \"flags\": {},\n+ \"order\": 12,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 165\n+ }\n+ ],\n+ \"title\": \"Isolated Other\",\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 87,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 1427.7700527710085,\n+ 1923.4593848005256\n+ ],\n+ \"size\": {\n+ \"0\": 343.0451965332031,\n+ \"1\": 78.96603393554688\n+ },\n+ \"flags\": {},\n+ \"order\": 10,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 164\n+ }\n+ ],\n+ \"title\": \"Isolated Drums\",\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 27,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 1039.6807945922967,\n+ 1916.7185909772834\n+ ],\n+ \"size\": {\n+ \"0\": 337.02545166015625,\n+ \"1\": 79.1675033569336\n+ },\n+ \"flags\": {},\n+ \"order\": 9,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 58\n+ }\n+ ],\n+ \"title\": \"Isolated Bass\",\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 30,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 1028.6807945922965,\n+ 2064.7185909772816\n+ ],\n+ \"size\": {\n+ \"0\": 343.0451965332031,\n+ \"1\": 78.96603393554688\n+ },\n+ \"flags\": {},\n+ \"order\": 13,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 61\n+ }\n+ ],\n+ \"title\": \"Isolated Vocals\",\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 90,\n+ \"type\": \"AudioCombine\",\n+ \"pos\": [\n+ 717.0453763801272,\n+ 1049.5315789311524\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 78\n+ },\n+ \"flags\": {},\n+ \"order\": 14,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 168\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 169\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 170,\n+ 171\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"add\"\n+ ]\n+ },\n+ {\n+ \"id\": 19,\n+ \"type\": \"VAEEncodeAudio\",\n+ \"pos\": [\n+ 791.8950567304682,\n+ 629.5174619346927\n+ ],\n+ \"size\": {\n+ \"0\": 210,\n+ \"1\": 46\n+ },\n+ \"flags\": {},\n+ \"order\": 16,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 171\n+ },\n+ {\n+ \"name\": \"vae\",\n+ \"type\": \"VAE\",\n+ \"link\": 28\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"LATENT\",\n+ \"type\": \"LATENT\",\n+ \"links\": [\n+ 68\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"VAEEncodeAudio\"\n+ }\n+ },\n+ {\n+ \"id\": 92,\n+ \"type\": \"Note\",\n+ \"pos\": [\n+ 86.70424642041016,\n+ 1676.3310729947511\n+ ],\n+ \"size\": {\n+ \"0\": 303.4900207519531,\n+ \"1\": 94.80523681640625\n+ },\n+ \"flags\": {},\n+ \"order\": 3,\n+ \"mode\": 0,\n+ \"properties\": {\n+ \"text\": \"\"\n+ },\n+ \"widgets_values\": [\n+ \"Make sure to crop the video to the same length in the AudioVideoCombine Node\"\n+ ],\n+ \"color\": \"#432\",\n+ \"bgcolor\": \"#653\"\n+ },\n+ {\n+ \"id\": 91,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 1097.045376380127,\n+ 1119.5315789311524\n+ ],\n+ \"size\": {\n+ \"0\": 337.02545166015625,\n+ \"1\": 79.1675033569336\n+ },\n+ \"flags\": {},\n+ \"order\": 15,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 170\n+ }\n+ ],\n+ \"title\": \"Everything But Vocals\",\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 75,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 2584.753588262695,\n+ 963.3026287800292\n+ ],\n+ \"size\": {\n+ \"0\": 337.9790344238281,\n+ \"1\": 124.55256652832031\n+ },\n+ \"flags\": {},\n+ \"order\": 21,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 147\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 12,\n+ \"type\": \"VAEDecodeAudio\",\n+ \"pos\": [\n+ 1451.8950567304673,\n+ 252.51746193469236\n+ ],\n+ \"size\": {\n+ \"0\": 210,\n+ \"1\": 46\n+ },\n+ \"flags\": {},\n+ \"order\": 18,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"samples\",\n+ \"type\": \"LATENT\",\n+ \"link\": 13\n+ },\n+ {\n+ \"name\": \"vae\",\n+ \"type\": \"VAE\",\n+ \"link\": 14,\n+ \"slot_index\": 1\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 153,\n+ 172\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"VAEDecodeAudio\"\n+ }\n+ },\n+ {\n+ \"id\": 93,\n+ \"type\": \"PreviewAudio\",\n+ \"pos\": [\n+ 1480.8950567304673,\n+ 415.5174619346922\n+ ],\n+ \"size\": {\n+ \"0\": 344.9685974121094,\n+ \"1\": 79.7200698852539\n+ },\n+ \"flags\": {},\n+ \"order\": 20,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 172\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"PreviewAudio\"\n+ },\n+ \"widgets_values\": [\n+ null\n+ ]\n+ },\n+ {\n+ \"id\": 10,\n+ \"type\": \"CLIPLoader\",\n+ \"pos\": [\n+ -293.4825369829104,\n+ 246.92156948550402\n+ ],\n+ \"size\": {\n+ \"0\": 335.6534118652344,\n+ \"1\": 82\n+ },\n+ \"flags\": {},\n+ \"order\": 4,\n+ \"mode\": 0,\n+ \"outputs\": [\n+ {\n+ \"name\": \"CLIP\",\n+ \"type\": \"CLIP\",\n+ \"links\": [\n+ 25,\n+ 26\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"CLIPLoader\"\n+ },\n+ \"widgets_values\": [\n+ \"t5_base.safetensors\",\n+ \"stable_audio\"\n+ ]\n+ },\n+ {\n+ \"id\": 40,\n+ \"type\": \"AudioCrop\",\n+ \"pos\": [\n+ 78.42996610576392,\n+ 1837.3184771760143\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 82\n+ },\n+ \"flags\": {},\n+ \"order\": 5,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 69\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 70\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCrop\"\n+ },\n+ \"widgets_values\": [\n+ \"0\",\n+ \"1:00\"\n+ ],\n+ \"color\": \"#332922\",\n+ \"bgcolor\": \"#593930\"\n+ },\n+ {\n+ \"id\": 56,\n+ \"type\": \"AudioCombine\",\n+ \"pos\": [\n+ 2634.753588262695,\n+ 1353.3026287800308\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 78\n+ },\n+ \"flags\": {},\n+ \"order\": 22,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio_1\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 155\n+ },\n+ {\n+ \"name\": \"audio_2\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 156,\n+ \"slot_index\": 1\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"AUDIO\",\n+ \"type\": \"AUDIO\",\n+ \"links\": [\n+ 112,\n+ 173\n+ ],\n+ \"shape\": 3,\n+ \"slot_index\": 0\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"add\"\n+ ]\n+ },\n+ {\n+ \"id\": 94,\n+ \"type\": \"AudioVideoCombine\",\n+ \"pos\": [\n+ 3040,\n+ 1472\n+ ],\n+ \"size\": {\n+ \"0\": 315,\n+ \"1\": 130\n+ },\n+ \"flags\": {},\n+ \"order\": 24,\n+ \"mode\": 0,\n+ \"inputs\": [\n+ {\n+ \"name\": \"audio\",\n+ \"type\": \"AUDIO\",\n+ \"link\": 173\n+ }\n+ ],\n+ \"outputs\": [\n+ {\n+ \"name\": \"saved_video_path\",\n+ \"type\": \"STRING\",\n+ \"links\": null,\n+ \"shape\": 3\n+ }\n+ ],\n+ \"properties\": {\n+ \"Node name for S&R\": \"AudioVideoCombine\"\n+ },\n+ \"widgets_values\": [\n+ \"/home/c_byrne/projects/comfy-testing-environment/ComfyUI/input/westworld.webm\",\n+ \"0:00\",\n+ \"1:00\",\n+ true\n+ ]\n+ }\n+ ],\n+ \"links\": [\n+ [\n+ 4,\n+ 6,\n+ 0,\n+ 3,\n+ 1,\n+ \"CONDITIONING\"\n+ ],\n+ [\n+ 6,\n+ 7,\n+ 0,\n+ 3,\n+ 2,\n+ \"CONDITIONING\"\n+ ],\n+ [\n+ 13,\n+ 3,\n+ 0,\n+ 12,\n+ 0,\n+ \"LATENT\"\n+ ],\n+ [\n+ 14,\n+ 4,\n+ 2,\n+ 12,\n+ 1,\n+ \"VAE\"\n+ ],\n+ [\n+ 18,\n+ 4,\n+ 0,\n+ 3,\n+ 0,\n+ \"MODEL\"\n+ ],\n+ [\n+ 25,\n+ 10,\n+ 0,\n+ 6,\n+ 0,\n+ \"CLIP\"\n+ ],\n+ [\n+ 26,\n+ 10,\n+ 0,\n+ 7,\n+ 0,\n+ \"CLIP\"\n+ ],\n+ [\n+ 28,\n+ 4,\n+ 2,\n+ 19,\n+ 1,\n+ \"VAE\"\n+ ],\n+ [\n+ 58,\n+ 35,\n+ 0,\n+ 27,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 61,\n+ 35,\n+ 3,\n+ 30,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 68,\n+ 19,\n+ 0,\n+ 3,\n+ 3,\n+ \"LATENT\"\n+ ],\n+ [\n+ 69,\n+ 20,\n+ 0,\n+ 40,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 70,\n+ 40,\n+ 0,\n+ 35,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 112,\n+ 56,\n+ 0,\n+ 57,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 147,\n+ 68,\n+ 0,\n+ 75,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 153,\n+ 12,\n+ 0,\n+ 68,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 155,\n+ 68,\n+ 0,\n+ 56,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 156,\n+ 35,\n+ 3,\n+ 56,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 162,\n+ 35,\n+ 0,\n+ 68,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 164,\n+ 35,\n+ 1,\n+ 87,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 165,\n+ 35,\n+ 2,\n+ 88,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 166,\n+ 35,\n+ 0,\n+ 89,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 167,\n+ 35,\n+ 1,\n+ 89,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 168,\n+ 35,\n+ 2,\n+ 90,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 169,\n+ 89,\n+ 0,\n+ 90,\n+ 1,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 170,\n+ 90,\n+ 0,\n+ 91,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 171,\n+ 90,\n+ 0,\n+ 19,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 172,\n+ 12,\n+ 0,\n+ 93,\n+ 0,\n+ \"AUDIO\"\n+ ],\n+ [\n+ 173,\n+ 56,\n+ 0,\n+ 94,\n+ 0,\n+ \"AUDIO\"\n+ ]\n+ ],\n+ \"groups\": [\n+ {\n+ \"title\": \"Audio Stems Separation\",\n+ \"bounding\": [\n+ -546,\n+ 1472,\n+ 2451,\n+ 717\n+ ],\n+ \"color\": \"#3f789e\",\n+ \"font_size\": 24\n+ },\n+ {\n+ \"title\": \"Generate New BGM\",\n+ \"bounding\": [\n+ -366,\n+ 18,\n+ 2283,\n+ 746\n+ ],\n+ \"color\": \"#8AA\",\n+ \"font_size\": 24\n+ },\n+ {\n+ \"title\": \"Postprocess & Re-Combine\",\n+ \"bounding\": [\n+ 2056,\n+ 691,\n+ 1511,\n+ 1083\n+ ],\n+ \"color\": \"#444\",\n+ \"font_size\": 24\n+ },\n+ {\n+ \"title\": \"Recombine All Except Vocals\",\n+ \"bounding\": [\n+ 542,\n+ 888,\n+ 1007,\n+ 498\n+ ],\n+ \"color\": \"#444\",\n+ \"font_size\": 24\n+ }\n+ ],\n+ \"config\": {},\n+ \"extra\": {\n+ \"ds\": {\n+ \"scale\": 0.46650738020973354,\n+ \"offset\": {\n+ \"0\": 967.7999267578125,\n+ \"1\": 480.5008850097656\n+ }\n+ }\n+ },\n+ \"version\": 0.4\n+}\n\\ No newline at end of file"},{"sha":"0824da3f69d40a55f5c6a195492a5e987328cb45","filename":"pyproject.toml","status":"modified","additions":1,"deletions":1,"changes":2,"blob_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/pyproject.toml","raw_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/raw/5291831d7c321ab7a5192374482f9848dffee75b/pyproject.toml","contents_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/contents/pyproject.toml?ref=5291831d7c321ab7a5192374482f9848dffee75b","patch":"@@ -1,7 +1,7 @@\n [project]\n name = \"audio-separation-nodes-comfyui\"\n description = \"Separate audio track into stems (vocals, bass, drums, other). Along with tools to recombine, tempo match, slice/crop audio\"\n-version = \"1.3.1\"\n+version = \"1.4.0\"\n license = \"LICENSE\"\n dependencies = [\"librosa==0.10.2\", \"numpy\", \"torchaudio>=2.3.0\", \"moviepy\"]\n "}]}
\ No newline at end of file
diff --git a/docs/hel-892/separation-reference/plugin-1.4.0-tree.json b/docs/hel-892/separation-reference/plugin-1.4.0-tree.json
new file mode 100644
index 00000000..88dce275
--- /dev/null
+++ b/docs/hel-892/separation-reference/plugin-1.4.0-tree.json
@@ -0,0 +1 @@
+{"sha":"5291831d7c321ab7a5192374482f9848dffee75b","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/5291831d7c321ab7a5192374482f9848dffee75b","tree":[{"path":".github","mode":"040000","type":"tree","sha":"3696c0b3a6b6a487a142ee93f5db887227748b0b","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/3696c0b3a6b6a487a142ee93f5db887227748b0b"},{"path":".github/dependabot.yml","mode":"100644","type":"blob","sha":"1c373879100fdb7bca08623f6e80a41cf5d2e40f","size":759,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/1c373879100fdb7bca08623f6e80a41cf5d2e40f"},{"path":".github/workflows","mode":"040000","type":"tree","sha":"225a5c2154bbf93a70a5261c2752e5fe68a13f22","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/225a5c2154bbf93a70a5261c2752e5fe68a13f22"},{"path":".github/workflows/publish.yml","mode":"100644","type":"blob","sha":"d7334248801d0cdd1016da8368f99a2228793853","size":676,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/d7334248801d0cdd1016da8368f99a2228793853"},{"path":".gitignore","mode":"100644","type":"blob","sha":"d3040680097173dc3c9a6b4b541024ba165621c8","size":268,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/d3040680097173dc3c9a6b4b541024ba165621c8"},{"path":"README.md","mode":"100644","type":"blob","sha":"c3553fb93ca5c2f9932020bc504aae2de1c667c7","size":2677,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/c3553fb93ca5c2f9932020bc504aae2de1c667c7"},{"path":"__init__.py","mode":"100644","type":"blob","sha":"a9195868b2bd11a8e59fc17627d822c37025df79","size":561,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/a9195868b2bd11a8e59fc17627d822c37025df79"},{"path":"example_workflows","mode":"040000","type":"tree","sha":"c862065b6fa07ed82fae1f933637510eab49f365","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/c862065b6fa07ed82fae1f933637510eab49f365"},{"path":"example_workflows/Extract Instrumental from Song.jpg","mode":"100644","type":"blob","sha":"361bf09323b7383148a669dfbdd824bc8db47353","size":138435,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/361bf09323b7383148a669dfbdd824bc8db47353"},{"path":"example_workflows/Extract Instrumental from Song.json","mode":"100644","type":"blob","sha":"bcc67a1edff86e68f43413f2d4aa81c6976b507e","size":4425,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/bcc67a1edff86e68f43413f2d4aa81c6976b507e"},{"path":"example_workflows/Isolate Vocals from Audio.jpg","mode":"100644","type":"blob","sha":"22a8ec47f50c2856b9dab16e8b00a3d358a612d2","size":118069,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/22a8ec47f50c2856b9dab16e8b00a3d358a612d2"},{"path":"example_workflows/Isolate Vocals from Audio.json","mode":"100644","type":"blob","sha":"44b9cdff2cd19117f51ce984dba20616f60f776a","size":3255,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/44b9cdff2cd19117f51ce984dba20616f60f776a"},{"path":"example_workflows/Isolate Vocals from Video.jpg","mode":"100644","type":"blob","sha":"bd95b9e3e9addb6ef33cba419a36bdc51ff05b4f","size":624302,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/bd95b9e3e9addb6ef33cba419a36bdc51ff05b4f"},{"path":"example_workflows/Isolate Vocals from Video.json","mode":"100644","type":"blob","sha":"38008088ad5d8e48bfab793277c5783fefed8163","size":3386,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/38008088ad5d8e48bfab793277c5783fefed8163"},{"path":"example_workflows/Remix Song.jpg","mode":"100644","type":"blob","sha":"0519ae812fdef389d930fe227777a213e90e0640","size":230378,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/0519ae812fdef389d930fe227777a213e90e0640"},{"path":"example_workflows/Remix Song.json","mode":"100644","type":"blob","sha":"eecd1685d0a95d7274e7c074a85d719fc04bba91","size":35477,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/eecd1685d0a95d7274e7c074a85d719fc04bba91"},{"path":"example_workflows/Replace BGM with Stable-Audio-Generated Music.jpg","mode":"100644","type":"blob","sha":"46728354aca16a60b4fb916ce83d54128d1a1ba8","size":118160,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/46728354aca16a60b4fb916ce83d54128d1a1ba8"},{"path":"example_workflows/Replace BGM with Stable-Audio-Generated Music.json","mode":"100644","type":"blob","sha":"d3c813774f020b998c1a0ac94f208e4446ec11b0","size":23704,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/d3c813774f020b998c1a0ac94f208e4446ec11b0"},{"path":"pyproject.toml","mode":"100644","type":"blob","sha":"0824da3f69d40a55f5c6a195492a5e987328cb45","size":627,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/0824da3f69d40a55f5c6a195492a5e987328cb45"},{"path":"requirements.txt","mode":"100644","type":"blob","sha":"6203a638ce4ed4bdfe1d7a7c2363316ed46bbeef","size":48,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/6203a638ce4ed4bdfe1d7a7c2363316ed46bbeef"},{"path":"src","mode":"040000","type":"tree","sha":"eabf836508a2f4dbe5998e365ef17968d615e9ea","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/eabf836508a2f4dbe5998e365ef17968d615e9ea"},{"path":"src/__init__.py","mode":"100644","type":"blob","sha":"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391","size":0,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"},{"path":"src/_types.py","mode":"100644","type":"blob","sha":"700b956e201d17af971aba266744c2cfb66c0d55","size":325,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/700b956e201d17af971aba266744c2cfb66c0d55"},{"path":"src/combine.py","mode":"100644","type":"blob","sha":"5056fac39b3fe62acf80291dda98cd417dc5a913","size":2927,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/5056fac39b3fe62acf80291dda98cd417dc5a913"},{"path":"src/combine_video_with_audio.py","mode":"100644","type":"blob","sha":"7877d9ffcbb78a7076a76a8e136228abd14ca3ea","size":4905,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/7877d9ffcbb78a7076a76a8e136228abd14ca3ea"},{"path":"src/crop.py","mode":"100644","type":"blob","sha":"9f9e8554b6b76bd126c3fe14f2356bf0192608b3","size":2173,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/9f9e8554b6b76bd126c3fe14f2356bf0192608b3"},{"path":"src/get_tempo.py","mode":"100644","type":"blob","sha":"1640da42d7473c73b057b1ce1156bb64ace0e8fd","size":774,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/1640da42d7473c73b057b1ce1156bb64ace0e8fd"},{"path":"src/resample.py","mode":"100644","type":"blob","sha":"aefe0cc44377ace1117912d38c2198df30a890a2","size":3955,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/aefe0cc44377ace1117912d38c2198df30a890a2"},{"path":"src/separation.py","mode":"100644","type":"blob","sha":"625639c7fdb50909ee4c42aba86986d809aabb26","size":6215,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/625639c7fdb50909ee4c42aba86986d809aabb26"},{"path":"src/tempo_match.py","mode":"100644","type":"blob","sha":"c33c8df780905fc4764d42474d0e73d32f16c507","size":1590,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/c33c8df780905fc4764d42474d0e73d32f16c507"},{"path":"src/time_shift.py","mode":"100644","type":"blob","sha":"e9563b61456b2d63b94eef499cfda2f9cdf31477","size":1011,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/e9563b61456b2d63b94eef499cfda2f9cdf31477"},{"path":"src/utils.py","mode":"100644","type":"blob","sha":"4374474f78627a47b6a5c4736ebdc876df6d16af","size":4093,"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/blobs/4374474f78627a47b6a5c4736ebdc876df6d16af"}],"truncated":false}
\ No newline at end of file
diff --git a/docs/hel-892/separation-reference/plugin-256d51a2__pyproject.toml b/docs/hel-892/separation-reference/plugin-256d51a2__pyproject.toml
new file mode 100644
index 00000000..5036b8bf
--- /dev/null
+++ b/docs/hel-892/separation-reference/plugin-256d51a2__pyproject.toml
@@ -0,0 +1,22 @@
+[project]
+name = "audio-separation-nodes-comfyui"
+description = "Separate audio track into stems (vocals, bass, drums, other). Along with tools to recombine, tempo match, slice/crop audio"
+version = "1.4.1"
+license = { file = "LICENSE" }
+dependencies = ["librosa==0.10.2", "numpy", "torchaudio>=2.3.0", "moviepy"]
+
+[project.optional-dependencies]
+test = ["pytest"]
+dev = ["ruff"]
+
+[tool.ruff]
+target-version = "py39"
+
+[project.urls]
+Repository = "https://github.com/christian-byrne/audio-separation-nodes-comfyui"
+# Used by Comfy Registry https://comfyregistry.org
+
+[tool.comfy]
+PublisherId = "christian-byrne"
+DisplayName = "audio-separation-nodes-comfyui"
+Icon = "https://img.icons8.com/?size=100&id=gSULe4i1JTpL&format=png&color=000000"
diff --git a/docs/hel-892/separation-reference/plugin-504248bd__pyproject.toml b/docs/hel-892/separation-reference/plugin-504248bd__pyproject.toml
new file mode 100644
index 00000000..8ed76878
--- /dev/null
+++ b/docs/hel-892/separation-reference/plugin-504248bd__pyproject.toml
@@ -0,0 +1,22 @@
+[project]
+name = "audio-separation-nodes-comfyui"
+description = "Separate audio track into stems (vocals, bass, drums, other). Along with tools to recombine, tempo match, slice/crop audio"
+version = "1.5.0"
+license = { file = "LICENSE" }
+dependencies = ["librosa==0.10.2", "numpy", "torchaudio>=2.3.0", "moviepy"]
+
+[project.optional-dependencies]
+test = ["pytest"]
+dev = ["ruff"]
+
+[tool.ruff]
+target-version = "py39"
+
+[project.urls]
+Repository = "https://github.com/christian-byrne/audio-separation-nodes-comfyui"
+# Used by Comfy Registry https://comfyregistry.org
+
+[tool.comfy]
+PublisherId = "christian-byrne"
+DisplayName = "audio-separation-nodes-comfyui"
+Icon = "https://img.icons8.com/?size=100&id=gSULe4i1JTpL&format=png&color=000000"
diff --git a/docs/hel-892/separation-reference/plugin-5291831d__.github__workflows__publish.yml b/docs/hel-892/separation-reference/plugin-5291831d__.github__workflows__publish.yml
new file mode 100644
index 00000000..d7334248
--- /dev/null
+++ b/docs/hel-892/separation-reference/plugin-5291831d__.github__workflows__publish.yml
@@ -0,0 +1,23 @@
+name: Publish to Comfy registry
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - master
+ paths:
+ - "pyproject.toml"
+
+jobs:
+ publish-node:
+ name: Publish Custom Node to registry
+ runs-on: ubuntu-latest
+ # if this is a forked repository. Skipping the workflow.
+ if: github.event.repository.fork == false
+ steps:
+ - name: Check out code
+ uses: actions/checkout@v4
+ - name: Publish Custom Node
+ uses: Comfy-Org/publish-node-action@main
+ with:
+ ## Add your own personal access token to your Github Repository secrets and reference it here.
+ personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
diff --git a/docs/hel-892/separation-reference/plugin-5291831d__README.md b/docs/hel-892/separation-reference/plugin-5291831d__README.md
new file mode 100644
index 00000000..c3553fb9
--- /dev/null
+++ b/docs/hel-892/separation-reference/plugin-5291831d__README.md
@@ -0,0 +1,91 @@
+
+
+https://github.com/user-attachments/assets/c5cf20de-a17f-438d-81ac-0c392af669cf
+
+# Examples
+
+#### _`Separating Voices in a Video`_
+
+
+
+ Show
+
+> [!NOTE]
+>
+> In order to load videos into the LoadAudio Node, change [this line](https://github.com/comfyanonymous/ComfyUI/blob/faa57430b0ff882275b1afcf6610e8e9f8a5929b/comfy_extras/nodes_audio.py#L185) in your Comfy install to include the video's extension (e.g., `.mp4`)
+
+[workflow.json](./example_workflows/isolate-vocals-video.json)
+
+https://github.com/user-attachments/assets/c5af418e-7137-4c36-b86e-3352cf558ea8
+
+
+
+#### _`Replacing BGM with StableAudio-Generated BGM`_
+
+
+
+ Show
+
+> [!NOTE]
+>
+> In order to load videos into the LoadAudio Node, change [this line](https://github.com/comfyanonymous/ComfyUI/blob/faa57430b0ff882275b1afcf6610e8e9f8a5929b/comfy_extras/nodes_audio.py#L185) in your Comfy install to include the video's extension (e.g., `.mp4`)
+
+You can use this to replace copyrighted BGM in a video with new BGM. You can set the denoise low, so that the new BGM is still stimilar to the original.
+
+[workflow json](./example_workflows/replace-bgm.json)
+
+https://github.com/user-attachments/assets/a7d5656b-5f8b-439a-936f-6ebb6a0d538a
+
+
+
+#### _`Remixing Songs with StableAudio`_
+
+
+
+ Show
+
+- [workflow json](./example_workflows/remix-songs.json)
+- [example output (audio file) with embedded workflow](https://github.com/christian-byrne/audio-separation-nodes-comfyui/raw/refs/heads/demo-files/wiki/examples/ComfyUI_temp_iaepj_00001_.flac)
+- [example output (audio file) with embedded workflow](https://github.com/christian-byrne/audio-separation-nodes-comfyui/raw/refs/heads/demo-files/wiki/examples/ComfyUI_00002_.flac)
+
+
+
+#### _`Separating Song Vocals`_
+
+
+
+ Show
+
+[workflow.json](./example_workflows/isolate-vocals-song.json)
+
+https://github.com/user-attachments/assets/c5cf20de-a17f-438d-81ac-0c392af669cf
+
+
+
+#### _`Extracting Instrumentals from Songs`_
+
+
+
+ Show
+
+- [workflow json](./example_workflows/extract-instrumental.json)
+
+
+
+
+
+# Requirements
+
+```m
+librosa==0.10.2
+torchaudio>=2.3.0
+numpy
+moviepy
+```
+
+# Installation
+
+1. If you run ComfyUI inside of a virtual environment, make sure it is activated
+1. `git clone` this repository in `ComfyUI/custom_nodes` folder
+1. `cd` into the cloned repository
+1. `pip install -r requirements.txt`
diff --git a/docs/hel-892/separation-reference/plugin-5291831d____init__.py b/docs/hel-892/separation-reference/plugin-5291831d____init__.py
new file mode 100644
index 00000000..a9195868
--- /dev/null
+++ b/docs/hel-892/separation-reference/plugin-5291831d____init__.py
@@ -0,0 +1,18 @@
+from .src.separation import AudioSeparation
+from .src.tempo_match import TempoMatch
+from .src.crop import AudioCrop
+from .src.combine import AudioCombine
+from .src.combine_video_with_audio import AudioVideoCombine
+from .src.time_shift import TimeShift
+from .src.get_tempo import GetTempo
+
+
+NODE_CLASS_MAPPINGS = {
+ "AudioSeparation": AudioSeparation,
+ "AudioCrop": AudioCrop,
+ "AudioCombine": AudioCombine,
+ "AudioTempoMatch": TempoMatch,
+ "AudioVideoCombine": AudioVideoCombine,
+ "AudioSpeedShift": TimeShift,
+ "AudioGetTempo": GetTempo,
+}
\ No newline at end of file
diff --git a/docs/hel-892/separation-reference/plugin-5291831d__pyproject.toml b/docs/hel-892/separation-reference/plugin-5291831d__pyproject.toml
new file mode 100644
index 00000000..0824da3f
--- /dev/null
+++ b/docs/hel-892/separation-reference/plugin-5291831d__pyproject.toml
@@ -0,0 +1,15 @@
+[project]
+name = "audio-separation-nodes-comfyui"
+description = "Separate audio track into stems (vocals, bass, drums, other). Along with tools to recombine, tempo match, slice/crop audio"
+version = "1.4.0"
+license = "LICENSE"
+dependencies = ["librosa==0.10.2", "numpy", "torchaudio>=2.3.0", "moviepy"]
+
+[project.urls]
+Repository = "https://github.com/christian-byrne/audio-separation-nodes-comfyui"
+# Used by Comfy Registry https://comfyregistry.org
+
+[tool.comfy]
+PublisherId = "christian-byrne"
+DisplayName = "audio-separation-nodes-comfyui"
+Icon = "https://img.icons8.com/?size=100&id=gSULe4i1JTpL&format=png&color=000000"
diff --git a/docs/hel-892/separation-reference/plugin-5291831d__src__separation.py b/docs/hel-892/separation-reference/plugin-5291831d__src__separation.py
new file mode 100644
index 00000000..625639c7
--- /dev/null
+++ b/docs/hel-892/separation-reference/plugin-5291831d__src__separation.py
@@ -0,0 +1,171 @@
+"""Credit: https://pytorch.org/audio/stable/tutorials/hybrid_demucs_tutorial.html"""
+
+import torch
+from torchaudio.transforms import Fade, Resample
+from torchaudio.pipelines import HDEMUCS_HIGH_MUSDB_PLUS
+
+import comfy.model_management
+
+from typing import Dict, Tuple
+from ._types import AUDIO
+from .utils import ensure_stereo
+
+
+class AudioSeparation:
+ @classmethod
+ def INPUT_TYPES(cls):
+ return {
+ "required": {
+ "audio": ("AUDIO",),
+ },
+ "optional": {
+ "chunk_fade_shape": (
+ [
+ "linear",
+ "half_sine",
+ "logarithmic",
+ "exponential",
+ ],
+ {
+ "default": "linear",
+ "tooltip": "Audio is split into segments (chunks) with overlapping areas to ensure smooth transitions. This setting controls the fade effect at these overlaps. Choose Linear for even fading, Half-Sine for a smooth curve, Logarithmic for a quick fade out and slow fade in, or Exponential for a slow fade out and quick fade in.",
+ },
+ ),
+ "chunk_length": (
+ "FLOAT",
+ {
+ "default": 10.0,
+ "tooltip": "The length of each segment (chunk) in seconds. Longer chunks may require more memory and MIGHT produce better results.",
+ },
+ ),
+ "chunk_overlap": (
+ "FLOAT",
+ {
+ "default": 0.1,
+ "tooltip": "The overlap between each segment (chunk) in seconds. A higher overlap may be necessary if chunks are too short or the audio changes rapidly.",
+ },
+ ),
+ },
+ }
+
+ FUNCTION = "main"
+ RETURN_TYPES = ("AUDIO", "AUDIO", "AUDIO", "AUDIO")
+ RETURN_NAMES = ("Bass", "Drums", "Other", "Vocals")
+ CATEGORY = "audio"
+ DESCRIPTION = "Separate audio into four sources: bass, drums, other, and vocals."
+
+ def main(
+ self,
+ audio: AUDIO,
+ chunk_fade_shape: str = "linear",
+ chunk_length: float = 10.0,
+ chunk_overlap: float = 0.1,
+ ) -> Tuple[AUDIO, AUDIO, AUDIO, AUDIO]:
+
+ device: torch.device = comfy.model_management.get_torch_device()
+ waveform: torch.Tensor = audio["waveform"]
+ waveform = waveform.squeeze(0).to(device)
+ self.input_sample_rate_: int = audio["sample_rate"]
+
+ bundle = HDEMUCS_HIGH_MUSDB_PLUS
+ model: torch.nn.Module = bundle.get_model().to(device)
+ self.model_sample_rate = bundle.sample_rate
+
+ waveform = ensure_stereo(waveform)
+
+ # Resample to model's expected sample rate
+ if self.input_sample_rate_ != self.model_sample_rate:
+ resample = Resample(self.input_sample_rate_, self.model_sample_rate).to(
+ device
+ )
+ waveform = resample(waveform)
+
+ ref = waveform.mean(0)
+ waveform = (waveform - ref.mean()) / ref.std() # Zs
+
+ sources = self.separate_sources(
+ model,
+ waveform[None],
+ self.model_sample_rate,
+ segment=chunk_length,
+ overlap=chunk_overlap,
+ device=device,
+ chunk_fade_shape=chunk_fade_shape,
+ )[0]
+ sources = sources * ref.std() + ref.mean()
+ sources_list = model.sources
+ sources = list(sources)
+
+ return self.sources_to_tuple(dict(zip(sources_list, sources)))
+
+ def sources_to_tuple(
+ self, sources: Dict[str, torch.Tensor]
+ ) -> Tuple[AUDIO, AUDIO, AUDIO, AUDIO]:
+
+ output_order = ["bass", "drums", "other", "vocals"]
+ outputs = []
+ for source in output_order:
+ if source not in sources:
+ raise ValueError(f"Missing source {source} in the output")
+ outputs.append(
+ {
+ "waveform": sources[source].cpu().unsqueeze(0),
+ "sample_rate": self.model_sample_rate,
+ }
+ )
+ return tuple(outputs)
+
+ def separate_sources(
+ self,
+ model: torch.nn.Module,
+ mix: torch.Tensor,
+ sample_rate: int,
+ segment: float = 10.0,
+ overlap: float = 0.1,
+ device: torch.device = None,
+ chunk_fade_shape: str = "linear",
+ ) -> torch.Tensor:
+ """
+ From: https://pytorch.org/audio/stable/tutorials/hybrid_demucs_tutorial.html
+
+ Apply model to a given mixture. Use fade, and add segments together in order to add model segment by segment.
+
+ Args:
+ segment (int): segment length in seconds
+ device (torch.device, str, or None): if provided, device on which to
+ execute the computation, otherwise `mix.device` is assumed.
+ When `device` is different from `mix.device`, only local computations will
+ be on `device`, while the entire tracks will be stored on `mix.device`.
+ """
+ if device is None:
+ device = mix.device
+ else:
+ device = torch.device(device)
+
+ batch, channels, length = mix.shape
+
+ chunk_len = int(sample_rate * segment * (1 + overlap))
+ start = 0
+ end = chunk_len
+ overlap_frames = overlap * sample_rate
+ fade = Fade(
+ fade_in_len=0, fade_out_len=int(overlap_frames), fade_shape=chunk_fade_shape
+ )
+
+ final = torch.zeros(batch, len(model.sources), channels, length, device=device)
+
+ while start < length - overlap_frames:
+ chunk = mix[:, :, start:end]
+ with torch.no_grad():
+ out = model.forward(chunk)
+ out = fade(out)
+ final[:, :, :, start:end] += out
+ if start == 0:
+ fade.fade_in_len = int(overlap_frames)
+ start += int(chunk_len - overlap_frames)
+ else:
+ start += chunk_len
+ end += chunk_len
+ if end >= length:
+ fade.fade_out_len = 0
+ return final
diff --git a/docs/hel-892/separation-reference/plugin-8346a602__pyproject.toml b/docs/hel-892/separation-reference/plugin-8346a602__pyproject.toml
new file mode 100644
index 00000000..f9f7dedc
--- /dev/null
+++ b/docs/hel-892/separation-reference/plugin-8346a602__pyproject.toml
@@ -0,0 +1,15 @@
+[project]
+name = "audio-separation-nodes-comfyui"
+description = "Separate audio track into stems (vocals, bass, drums, other). Along with tools to recombine, tempo match, slice/crop audio"
+version = "1.4.1"
+license = "LICENSE"
+dependencies = ["librosa==0.10.2", "numpy", "torchaudio>=2.3.0", "moviepy"]
+
+[project.urls]
+Repository = "https://github.com/christian-byrne/audio-separation-nodes-comfyui"
+# Used by Comfy Registry https://comfyregistry.org
+
+[tool.comfy]
+PublisherId = "christian-byrne"
+DisplayName = "audio-separation-nodes-comfyui"
+Icon = "https://img.icons8.com/?size=100&id=gSULe4i1JTpL&format=png&color=000000"
diff --git a/docs/hel-892/separation-reference/plugin-a808c6ee__pyproject.toml b/docs/hel-892/separation-reference/plugin-a808c6ee__pyproject.toml
new file mode 100644
index 00000000..1b5c3a3e
--- /dev/null
+++ b/docs/hel-892/separation-reference/plugin-a808c6ee__pyproject.toml
@@ -0,0 +1,15 @@
+[project]
+name = "audio-separation-nodes-comfyui"
+description = "Separate audio track into stems (vocals, bass, drums, other). Along with tools to recombine, tempo match, slice/crop audio"
+version = "1.3.1"
+license = "LICENSE"
+dependencies = ["librosa==0.10.2", "numpy", "torchaudio>=2.3.0", "moviepy"]
+
+[project.urls]
+Repository = "https://github.com/christian-byrne/audio-separation-nodes-comfyui"
+# Used by Comfy Registry https://comfyregistry.org
+
+[tool.comfy]
+PublisherId = "christian-byrne"
+DisplayName = "audio-separation-nodes-comfyui"
+Icon = "https://img.icons8.com/?size=100&id=gSULe4i1JTpL&format=png&color=000000"
diff --git a/docs/hel-892/separation-reference/plugin-f0409dfa__pyproject.toml b/docs/hel-892/separation-reference/plugin-f0409dfa__pyproject.toml
new file mode 100644
index 00000000..3e93311b
--- /dev/null
+++ b/docs/hel-892/separation-reference/plugin-f0409dfa__pyproject.toml
@@ -0,0 +1,22 @@
+[project]
+name = "audio-separation-nodes-comfyui"
+description = "Separate audio track into stems (vocals, bass, drums, other). Along with tools to recombine, tempo match, slice/crop audio"
+version = "1.4.1"
+license = "LICENSE"
+dependencies = ["librosa==0.10.2", "numpy", "torchaudio>=2.3.0", "moviepy"]
+
+[project.optional-dependencies]
+test = ["pytest"]
+dev = ["ruff"]
+
+[tool.ruff]
+target-version = "py39"
+
+[project.urls]
+Repository = "https://github.com/christian-byrne/audio-separation-nodes-comfyui"
+# Used by Comfy Registry https://comfyregistry.org
+
+[tool.comfy]
+PublisherId = "christian-byrne"
+DisplayName = "audio-separation-nodes-comfyui"
+Icon = "https://img.icons8.com/?size=100&id=gSULe4i1JTpL&format=png&color=000000"
diff --git a/docs/hel-892/separation-reference/plugin-history.json b/docs/hel-892/separation-reference/plugin-history.json
new file mode 100644
index 00000000..23900f95
--- /dev/null
+++ b/docs/hel-892/separation-reference/plugin-history.json
@@ -0,0 +1 @@
+[{"sha":"ac339561973f0c1e56db2f9d40f11b0fddda6763","node_id":"C_kwDOMRYcBtoAKGFjMzM5NTYxOTczZjBjMWU1NmRiMmY5ZDQwZjExYjBmZGRkYTY3NjM","commit":{"author":{"name":"dependabot[bot]","email":"49699333+dependabot[bot]@users.noreply.github.com","date":"2026-04-14T02:42:58Z"},"committer":{"name":"GitHub","email":"noreply@github.com","date":"2026-04-14T02:42:58Z"},"message":"Update ruff requirement from >=0.14.0 to >=0.15.10 (#37)\n\nUpdates the requirements on [ruff](https://github.com/astral-sh/ruff) to permit the latest version.\n- [Release notes](https://github.com/astral-sh/ruff/releases)\n- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)\n- [Commits](https://github.com/astral-sh/ruff/compare/0.14.0...0.15.10)\n\n---\nupdated-dependencies:\n- dependency-name: ruff\n dependency-version: 0.15.10\n dependency-type: direct:development\n...\n\nSigned-off-by: dependabot[bot] \nCo-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","tree":{"sha":"a637980e13c11b43fe77f13aeffbeccfd54dd046","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/a637980e13c11b43fe77f13aeffbeccfd54dd046"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/ac339561973f0c1e56db2f9d40f11b0fddda6763","comment_count":0,"verification":{"verified":true,"reason":"valid","signature":"-----BEGIN PGP SIGNATURE-----\n\nwsFcBAABCAAQBQJp3amyCRC1aQ7uu5UhlAAAfbsQAFRkpsPKslOhJzIIXgy35i+a\n8oToXz2nGsqGb/4YlwUP15MeLsjir7bqKo+sR23KEthy1oSiE842M0bialfJ0kH4\ng39SrXpOqkuqb3ekJh4QUT+mvhRQdwTA/kX3NHSrPFiyzSz4aelK29/uBq8Y3DOx\n9e0LAzHEnPBiftFvOaVcJ/CjobihlPmmwwoMu1cSB/mG0F0ZinoYCiIlvF2VrJoP\nG2o8FUdowboU6AFJie6e8r2L//D4/yC28zN09jGppvbDmGX15+Y1KuF2SGijJ9vW\nO73EvflgP2JkcjMQxBE0sNVp8K0qX9QN/At7TxNTUcDsTvNbvSL5VYd6VmZNi6TQ\nTY4OyURjDmJfIqDiypLfaFake0sT215EUkHrk/VZ5PHvxkw++PUKw8zxt5chqo9A\nKixLnM12bImubetiz2cAG+z9ourCA7xpqoEQfrWom/WkV9KjApSAvu2CXfOzPj6B\n0DZnK0sUHmHAQA97FW2mMfR9pdUIzJHJB+Xd2PtMrWNT8T/wWV8DzLNUkKmbJhDX\nCfRfp/q0E4cXOnNvufjUjZwYoXhwpkv3wYLUo2rml0yb/zoUXEtFMI/CiJa5IjAn\noQ/+f1159BZJBeKqUoI1baIJhwRp3ENkzwZmndPE6VaBrITuS1eRNPTqH5S+Ol/Q\n+ewcNDpQXDDisiVnZZEI\n=YFHy\n-----END PGP SIGNATURE-----\n","payload":"tree a637980e13c11b43fe77f13aeffbeccfd54dd046\nparent bb42b2d210c0335986ed922cbe8231b10f0ffabb\nauthor dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1776134578 -0700\ncommitter GitHub 1776134578 -0700\n\nUpdate ruff requirement from >=0.14.0 to >=0.15.10 (#37)\n\nUpdates the requirements on [ruff](https://github.com/astral-sh/ruff) to permit the latest version.\n- [Release notes](https://github.com/astral-sh/ruff/releases)\n- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)\n- [Commits](https://github.com/astral-sh/ruff/compare/0.14.0...0.15.10)\n\n---\nupdated-dependencies:\n- dependency-name: ruff\n dependency-version: 0.15.10\n dependency-type: direct:development\n...\n\nSigned-off-by: dependabot[bot] \nCo-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>","verified_at":"2026-04-14T02:42:59Z"}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/ac339561973f0c1e56db2f9d40f11b0fddda6763","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/ac339561973f0c1e56db2f9d40f11b0fddda6763","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/ac339561973f0c1e56db2f9d40f11b0fddda6763/comments","author":{"login":"dependabot[bot]","id":49699333,"node_id":"MDM6Qm90NDk2OTkzMzM=","avatar_url":"https://avatars.githubusercontent.com/in/29110?v=4","gravatar_id":"","url":"https://api.github.com/users/dependabot%5Bbot%5D","html_url":"https://github.com/apps/dependabot","followers_url":"https://api.github.com/users/dependabot%5Bbot%5D/followers","following_url":"https://api.github.com/users/dependabot%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/dependabot%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/dependabot%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dependabot%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/dependabot%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/dependabot%5Bbot%5D/repos","events_url":"https://api.github.com/users/dependabot%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/dependabot%5Bbot%5D/received_events","type":"Bot","user_view_type":"public","site_admin":false},"committer":{"login":"web-flow","id":19864447,"node_id":"MDQ6VXNlcjE5ODY0NDQ3","avatar_url":"https://avatars.githubusercontent.com/u/19864447?v=4","gravatar_id":"","url":"https://api.github.com/users/web-flow","html_url":"https://github.com/web-flow","followers_url":"https://api.github.com/users/web-flow/followers","following_url":"https://api.github.com/users/web-flow/following{/other_user}","gists_url":"https://api.github.com/users/web-flow/gists{/gist_id}","starred_url":"https://api.github.com/users/web-flow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/web-flow/subscriptions","organizations_url":"https://api.github.com/users/web-flow/orgs","repos_url":"https://api.github.com/users/web-flow/repos","events_url":"https://api.github.com/users/web-flow/events{/privacy}","received_events_url":"https://api.github.com/users/web-flow/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"bb42b2d210c0335986ed922cbe8231b10f0ffabb","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/bb42b2d210c0335986ed922cbe8231b10f0ffabb","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/bb42b2d210c0335986ed922cbe8231b10f0ffabb"}]},{"sha":"fe05f188c684e38d51e71e9e906bb12b06add66e","node_id":"C_kwDOMRYcBtoAKGZlMDVmMTg4YzY4NGUzOGQ1MWU3MWU5ZTkwNmJiMTJiMDZhZGQ2NmU","commit":{"author":{"name":"Christian Byrne","email":"cbyrne@arizona.edu","date":"2026-04-11T01:11:29Z"},"committer":{"name":"GitHub","email":"noreply@github.com","date":"2026-04-11T01:11:29Z"},"message":"chore: bump version to 2.0.0 and add Nodes table to README (#33)\n\n* chore: bump version to 2.0.0 and add Nodes table to README\n\n- Bump version from 1.5.0 to 2.0.0 in pyproject.toml\n- Add Nodes table documenting all 7 nodes with descriptions\n- Keep existing Examples, Stem Mapping, Requirements, Installation,\n and Troubleshooting sections unchanged\n\nRef: christian-byrne/ticket-to-pr-pipeline#989\n\n* fix: match Audio Combine method order to INPUT_TYPES\n\nAdversarial review caught ordering mismatch between README and code.","tree":{"sha":"b86ab5691f0f8d4f200f48febf4d59d2fd52ff6d","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/b86ab5691f0f8d4f200f48febf4d59d2fd52ff6d"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/fe05f188c684e38d51e71e9e906bb12b06add66e","comment_count":0,"verification":{"verified":true,"reason":"valid","signature":"-----BEGIN PGP SIGNATURE-----\n\nwsFcBAABCAAQBQJp2Z/BCRC1aQ7uu5UhlAAATigQAAsaWZ+eoi9D/SowdZ7nAxmA\nVefa2Vt/vUSfu51pzFn79IHkngTIVWTANU26I1sgnSMxzkLt54k35VPpy1r2RKPu\noe2URDl6BdJd3gN8iAULQRxlrkGxdKzGHrdFqjnqGZrs6JI7aB+wDcyxI83yvexg\nvfODk3UMZmAoV0maAy4Ez9ati81c3GnqRvgLgHRczDsz9SA1FTdX1iN2+f4NMeRP\n5GRpYjQ3N5lXuDA8zRiVI7dsVp3NBL5iEmB1G0ypDJyCKg4YXVqkNHpEd2Qug8gz\nk3u+ivD2a14wiOI3Xqf2OfZC38For0zGrsGAObuJLRwwhT1cJLCcI6wgozS9W8+q\nO1THr0GUtVygdWfpNe7N70UM8ewKaSApd76v7AL39ZxKQ7JfB0mxnrmXcbZ7Gy9R\nCroXLgnD0LQi4Uz7/8KSPVlXKI/CnFqfrps5JnRD90/nyN84eayc6ncFD0TtJGq1\nb+PVx7kCrpButyv805A8opuoeEuzsJ9fRYxxGgG52fUh/p0KBzwKhXvjckE6gvpk\nN931OAW37icj5UMMVH2o9puwoProakeRsMQJkL4CFMXkNOZA9aURlLfuOISLqhFq\npMtDdXope8FYuTwwjAe9ywRExABvw9TFXSgGdurmyfDsdVJjL5Yx6nvbWfYDVSaN\nGHEpP/A/IqYikYpsOa8K\n=p3Yh\n-----END PGP SIGNATURE-----\n","payload":"tree b86ab5691f0f8d4f200f48febf4d59d2fd52ff6d\nparent fd28a44ee4005936a3ac84dabc8b5e47fef9b13d\nauthor Christian Byrne 1775869889 -0700\ncommitter GitHub 1775869889 -0700\n\nchore: bump version to 2.0.0 and add Nodes table to README (#33)\n\n* chore: bump version to 2.0.0 and add Nodes table to README\n\n- Bump version from 1.5.0 to 2.0.0 in pyproject.toml\n- Add Nodes table documenting all 7 nodes with descriptions\n- Keep existing Examples, Stem Mapping, Requirements, Installation,\n and Troubleshooting sections unchanged\n\nRef: christian-byrne/ticket-to-pr-pipeline#989\n\n* fix: match Audio Combine method order to INPUT_TYPES\n\nAdversarial review caught ordering mismatch between README and code.","verified_at":"2026-04-11T01:11:29Z"}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/fe05f188c684e38d51e71e9e906bb12b06add66e","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/fe05f188c684e38d51e71e9e906bb12b06add66e","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/fe05f188c684e38d51e71e9e906bb12b06add66e/comments","author":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"web-flow","id":19864447,"node_id":"MDQ6VXNlcjE5ODY0NDQ3","avatar_url":"https://avatars.githubusercontent.com/u/19864447?v=4","gravatar_id":"","url":"https://api.github.com/users/web-flow","html_url":"https://github.com/web-flow","followers_url":"https://api.github.com/users/web-flow/followers","following_url":"https://api.github.com/users/web-flow/following{/other_user}","gists_url":"https://api.github.com/users/web-flow/gists{/gist_id}","starred_url":"https://api.github.com/users/web-flow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/web-flow/subscriptions","organizations_url":"https://api.github.com/users/web-flow/orgs","repos_url":"https://api.github.com/users/web-flow/repos","events_url":"https://api.github.com/users/web-flow/events{/privacy}","received_events_url":"https://api.github.com/users/web-flow/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"fd28a44ee4005936a3ac84dabc8b5e47fef9b13d","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/fd28a44ee4005936a3ac84dabc8b5e47fef9b13d","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/fd28a44ee4005936a3ac84dabc8b5e47fef9b13d"}]},{"sha":"d0c76280c40be1fa6d10255388351df6794611a3","node_id":"C_kwDOMRYcBtoAKGQwYzc2MjgwYzQwYmUxZmE2ZDEwMjU1Mzg4MzUxZGY2Nzk0NjExYTM","commit":{"author":{"name":"Christian Byrne","email":"cbyrne@arizona.edu","date":"2026-04-10T22:25:39Z"},"committer":{"name":"GitHub","email":"noreply@github.com","date":"2026-04-10T22:25:39Z"},"message":"fix: phase 1 bug fixes (#23 cpu no-op, #16/#22 float cast, #20 librosa pin) (#31)\n\n- Fix #23: move both waveforms to cpu after resampling in combine.py,\n not just the resampled one (avoids device mismatch on arithmetic)\n- Fix #16/#22: add waveform.float() after ensure_stereo() in separation.py\n to handle int16 audio and double/float dtype mismatches\n- Fix #20: relax librosa pin from ==0.10.2 to >=0.10.2,<1 in both\n pyproject.toml and requirements.txt\n- Add tests verifying resampled waveforms are moved to cpu (with cuda inputs)\n- Add test verifying float32 dtype invariant after ensure_stereo()","tree":{"sha":"e84a5729629d8964e78adf06c8e270de987944ab","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/e84a5729629d8964e78adf06c8e270de987944ab"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/d0c76280c40be1fa6d10255388351df6794611a3","comment_count":0,"verification":{"verified":true,"reason":"valid","signature":"-----BEGIN PGP SIGNATURE-----\n\nwsFcBAABCAAQBQJp2XjjCRC1aQ7uu5UhlAAAZKkQAIOtccRfNm4yXXCIQucFu7l5\neZ6lq2Eb5rRl42PbzcDk5x4OtVE25unr7lvtwT9yp5BYwStXZOqb9MNtSakX+VTJ\ne4CNZgtbkOM+VRpTFcu6De6Md1tgw8wr52NzjHsEykcXmtieCQExvsE1npsNSdVY\nUR1PQH+jTCD3g9vricsZnY8wxSO5nNq8f3HJV3K4UTOLyPryYJ4UfzqFnn5UTAEf\nmT3j/sodBYPPMA/PUuyCvONLXETcR0ZcrZ0d4sj6Cf4n4G1Fufu8+6FzvGUgIJvl\nzRzeCYg3c73Rt/2sYV2g7/l98V9kePxe8oVBoM+BDYG1ftTDjK4Z4BMgcbSd7OqH\nfqNA+pPgpDUrJ4hZKT4BG17aHzRPIkaGByGnJ0UEB2E3TVfKjKzdY7TOQsm3uNr1\nNmb/oKp5Mu8ljsbSp1zeE6oN+7Z7y3TjaQU/TjeZrPuRVLSIcx6iMG65gXdiwNUV\neqqTl8giVhaDOuB3L+o/2eLWKiy1G5yS6sVGsGOQAQ/A0nNWU/Oh0XnbI9yeID0d\nEF601AewoWx8t9+euNSu0ePgisyCUmvb8uvmM7cn5AeuKQjpGQFdfS1rF/KoIsqF\nkVvS+HFV4bBGmPNZB49PCTz8+KPf6NOLn2grbIioTGUjGhV6PdOqGcONuj/SaCRW\nG417Rlz8hqEfXzTW6Dak\n=q8wk\n-----END PGP SIGNATURE-----\n","payload":"tree e84a5729629d8964e78adf06c8e270de987944ab\nparent 201d4d244e4251b0d3e1ff6243743c53402a5865\nauthor Christian Byrne 1775859939 -0700\ncommitter GitHub 1775859939 -0700\n\nfix: phase 1 bug fixes (#23 cpu no-op, #16/#22 float cast, #20 librosa pin) (#31)\n\n- Fix #23: move both waveforms to cpu after resampling in combine.py,\n not just the resampled one (avoids device mismatch on arithmetic)\n- Fix #16/#22: add waveform.float() after ensure_stereo() in separation.py\n to handle int16 audio and double/float dtype mismatches\n- Fix #20: relax librosa pin from ==0.10.2 to >=0.10.2,<1 in both\n pyproject.toml and requirements.txt\n- Add tests verifying resampled waveforms are moved to cpu (with cuda inputs)\n- Add test verifying float32 dtype invariant after ensure_stereo()","verified_at":"2026-04-10T22:25:39Z"}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/d0c76280c40be1fa6d10255388351df6794611a3","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/d0c76280c40be1fa6d10255388351df6794611a3","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/d0c76280c40be1fa6d10255388351df6794611a3/comments","author":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"web-flow","id":19864447,"node_id":"MDQ6VXNlcjE5ODY0NDQ3","avatar_url":"https://avatars.githubusercontent.com/u/19864447?v=4","gravatar_id":"","url":"https://api.github.com/users/web-flow","html_url":"https://github.com/web-flow","followers_url":"https://api.github.com/users/web-flow/followers","following_url":"https://api.github.com/users/web-flow/following{/other_user}","gists_url":"https://api.github.com/users/web-flow/gists{/gist_id}","starred_url":"https://api.github.com/users/web-flow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/web-flow/subscriptions","organizations_url":"https://api.github.com/users/web-flow/orgs","repos_url":"https://api.github.com/users/web-flow/repos","events_url":"https://api.github.com/users/web-flow/events{/privacy}","received_events_url":"https://api.github.com/users/web-flow/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"201d4d244e4251b0d3e1ff6243743c53402a5865","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/201d4d244e4251b0d3e1ff6243743c53402a5865","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/201d4d244e4251b0d3e1ff6243743c53402a5865"}]},{"sha":"201d4d244e4251b0d3e1ff6243743c53402a5865","node_id":"C_kwDOMRYcBtoAKDIwMWQ0ZDI0NGU0MjUxYjBkM2UxZmY2MjQzNzQzYzUzNDAyYTU4NjU","commit":{"author":{"name":"Christian Byrne","email":"cbyrne@arizona.edu","date":"2026-04-10T21:44:26Z"},"committer":{"name":"GitHub","email":"noreply@github.com","date":"2026-04-10T21:44:26Z"},"message":"phase0: comprehensive test suite (27% → 94% coverage), ruff lint/format, tooling config (#30)\n\n- Add 155 new tests across 9 test files covering all src modules\n- Configure pytest-cov with 90% coverage threshold\n- Configure ruff lint (E, F, W, I, UP, B, SIM, TCH) and format (line-length=120)\n- Add mypy config with ignore_missing_imports for comfy ecosystem\n- Fix all lint issues: deprecated typing imports, import sorting, simplifications\n- Add from __future__ import annotations for Python 3.9 compat\n- Apply ruff format across entire codebase\n- Mock infrastructure for testing without torch/torchaudio/comfy dependencies\n- No runtime behavior changes","tree":{"sha":"376a7ad87aa3f7f4728be0e7034e309cf36570f5","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/376a7ad87aa3f7f4728be0e7034e309cf36570f5"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/201d4d244e4251b0d3e1ff6243743c53402a5865","comment_count":0,"verification":{"verified":true,"reason":"valid","signature":"-----BEGIN PGP SIGNATURE-----\n\nwsFcBAABCAAQBQJp2W86CRC1aQ7uu5UhlAAAtCoQABzyK9WptCGp6X9CZ2g4gVYo\nm1+UPunhnkWG8Dd/jg9x3W0R5fzAYw1fap7dH49mXQZ6T8kZyIemUYaOKfUBeFuM\ncZsDLoq33GxwGNCo/lneYs/CY2rEabDG/Smbemf0PVm0Rn7TjcU+53vToLz5Qe0Q\n0NxvETRqdUVyMRU6At8EGeZPLu9vEVqmpQpMvAL9VdTC2Vo4eaLUbyDyjfXx7tiJ\nAbJfwNRg3bBdGByxNTcU5AV2cF8BGbo69EIebC/itrY6WUdU6eKW263Jj2jVvIAe\nMy+jevXB+yZKSC2pLO66/N/xm3xmJHl1vJlKw3Ier31m8IznrIc5ktzKQTxPalff\n3nwL/1tkXOQWaH65kI67H06Rn4C2CK/E+9EKb+6iQeveun+aICVk6RDdmQCd9UOg\nG+QUri0JahIJSjsKN3YLPvfh+RA8eQf384G5ZpHYrM9ozqcQGPbKQRfw++BdbuMk\n0RiXJIOXgtjc0qDBsROrQoVYyV7m95BwFiXQIjQ/73ndEwfkj/P7e1GKTcIolhgo\nnA7J/dN3iJX9Ox8lgyEMHhC9u3dy/6d+vouSsY9rklyk0lcqbbtrwFvYDlad3Rxd\nrgOCF7bOROVFfsqxH6/WnrfFI8q8CB5E3VFuRl5lUW7N/ncTpDK3xodEaZfeL5HU\nmiVkSRmlYdchC115q9j6\n=8Haw\n-----END PGP SIGNATURE-----\n","payload":"tree 376a7ad87aa3f7f4728be0e7034e309cf36570f5\nparent 12062cacb4a25b4bac91126a4d0e8a47c6e98b77\nauthor Christian Byrne 1775857466 -0700\ncommitter GitHub 1775857466 -0700\n\nphase0: comprehensive test suite (27% → 94% coverage), ruff lint/format, tooling config (#30)\n\n- Add 155 new tests across 9 test files covering all src modules\n- Configure pytest-cov with 90% coverage threshold\n- Configure ruff lint (E, F, W, I, UP, B, SIM, TCH) and format (line-length=120)\n- Add mypy config with ignore_missing_imports for comfy ecosystem\n- Fix all lint issues: deprecated typing imports, import sorting, simplifications\n- Add from __future__ import annotations for Python 3.9 compat\n- Apply ruff format across entire codebase\n- Mock infrastructure for testing without torch/torchaudio/comfy dependencies\n- No runtime behavior changes","verified_at":"2026-04-10T21:44:26Z"}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/201d4d244e4251b0d3e1ff6243743c53402a5865","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/201d4d244e4251b0d3e1ff6243743c53402a5865","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/201d4d244e4251b0d3e1ff6243743c53402a5865/comments","author":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"web-flow","id":19864447,"node_id":"MDQ6VXNlcjE5ODY0NDQ3","avatar_url":"https://avatars.githubusercontent.com/u/19864447?v=4","gravatar_id":"","url":"https://api.github.com/users/web-flow","html_url":"https://github.com/web-flow","followers_url":"https://api.github.com/users/web-flow/followers","following_url":"https://api.github.com/users/web-flow/following{/other_user}","gists_url":"https://api.github.com/users/web-flow/gists{/gist_id}","starred_url":"https://api.github.com/users/web-flow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/web-flow/subscriptions","organizations_url":"https://api.github.com/users/web-flow/orgs","repos_url":"https://api.github.com/users/web-flow/repos","events_url":"https://api.github.com/users/web-flow/events{/privacy}","received_events_url":"https://api.github.com/users/web-flow/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"12062cacb4a25b4bac91126a4d0e8a47c6e98b77","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/12062cacb4a25b4bac91126a4d0e8a47c6e98b77","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/12062cacb4a25b4bac91126a4d0e8a47c6e98b77"}]},{"sha":"504248bd04b9f3a1d0412297e8986441ec09415e","node_id":"C_kwDOMRYcBtoAKDUwNDI0OGJkMDRiOWYzYTFkMDQxMjI5N2U4OTg2NDQxZWMwOTQxNWU","commit":{"author":{"name":"bymyself","email":"cbyrne@comfy.org","date":"2025-12-24T01:04:50Z"},"committer":{"name":"bymyself","email":"cbyrne@comfy.org","date":"2025-12-24T01:04:50Z"},"message":"Add MIT license and bump version to 1.5.0","tree":{"sha":"358afcbb865ace4a2029a24cb6b9a007e38ce093","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/358afcbb865ace4a2029a24cb6b9a007e38ce093"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/504248bd04b9f3a1d0412297e8986441ec09415e","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/504248bd04b9f3a1d0412297e8986441ec09415e","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/504248bd04b9f3a1d0412297e8986441ec09415e","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/504248bd04b9f3a1d0412297e8986441ec09415e/comments","author":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"256d51a24f28b7fb4515d87e672b8e03ba648214","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/256d51a24f28b7fb4515d87e672b8e03ba648214","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/256d51a24f28b7fb4515d87e672b8e03ba648214"}]},{"sha":"256d51a24f28b7fb4515d87e672b8e03ba648214","node_id":"C_kwDOMRYcBtoAKDI1NmQ1MWEyNGYyOGI3ZmI0NTE1ZDg3ZTY3MmI4ZTAzYmE2NDgyMTQ","commit":{"author":{"name":"bymyself","email":"cbyrne@comfy.org","date":"2025-12-24T01:03:58Z"},"committer":{"name":"bymyself","email":"cbyrne@comfy.org","date":"2025-12-24T01:03:58Z"},"message":"Define license as file reference","tree":{"sha":"3d722fe21cbb547392a1880078a8a2aef8477520","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/3d722fe21cbb547392a1880078a8a2aef8477520"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/256d51a24f28b7fb4515d87e672b8e03ba648214","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/256d51a24f28b7fb4515d87e672b8e03ba648214","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/256d51a24f28b7fb4515d87e672b8e03ba648214","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/256d51a24f28b7fb4515d87e672b8e03ba648214/comments","author":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"bf63e9159d8b53ce1a0513eb4aaeee98c8b816b1","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/bf63e9159d8b53ce1a0513eb4aaeee98c8b816b1","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/bf63e9159d8b53ce1a0513eb4aaeee98c8b816b1"}]},{"sha":"f0409dfacbf2ffe52d509b413cb827a5ded9616f","node_id":"C_kwDOMRYcBtoAKGYwNDA5ZGZhY2JmMmZmZTUyZDUwOWI0MTNjYjgyN2E1ZGVkOTYxNmY","commit":{"author":{"name":"bymyself","email":"cbyrne@comfy.org","date":"2025-12-24T00:58:23Z"},"committer":{"name":"bymyself","email":"cbyrne@comfy.org","date":"2025-12-24T00:58:23Z"},"message":"Add CI tooling, optional deps, and contributor docs","tree":{"sha":"6691ef5dafdb5029a808adcfa74c2810e7fade12","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/6691ef5dafdb5029a808adcfa74c2810e7fade12"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/f0409dfacbf2ffe52d509b413cb827a5ded9616f","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/f0409dfacbf2ffe52d509b413cb827a5ded9616f","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/f0409dfacbf2ffe52d509b413cb827a5ded9616f","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/f0409dfacbf2ffe52d509b413cb827a5ded9616f/comments","author":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"f3de07d201bd8e984cdb7b65b04c728ecd617f12","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/f3de07d201bd8e984cdb7b65b04c728ecd617f12","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/f3de07d201bd8e984cdb7b65b04c728ecd617f12"}]},{"sha":"8346a6027e1f6871f362fb6bc4d2e521d560466f","node_id":"C_kwDOMRYcBtoAKDgzNDZhNjAyN2UxZjY4NzFmMzYyZmI2YmM0ZDJlNTIxZDU2MDQ2NmY","commit":{"author":{"name":"Christian Byrne","email":"cbyrne@arizona.edu","date":"2025-12-09T21:52:59Z"},"committer":{"name":"GitHub","email":"noreply@github.com","date":"2025-12-09T21:52:59Z"},"message":"Update pyproject.toml","tree":{"sha":"4920de2ea90fc199cad1b0a4c99115f0499892cf","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/4920de2ea90fc199cad1b0a4c99115f0499892cf"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/8346a6027e1f6871f362fb6bc4d2e521d560466f","comment_count":0,"verification":{"verified":true,"reason":"valid","signature":"-----BEGIN PGP SIGNATURE-----\n\nwsFcBAABCAAQBQJpOJo7CRC1aQ7uu5UhlAAAv3oQAE1iHw/gE0kKvdfKrqIz8qtx\nJObuW2veJDDvMb/a7Inyy1l0nSPVIrw9QNNyVJ7RXQZ+m9owFYnwgGJJTowiH6cQ\nxFYURXFpy5f9kZbnAOP43P/SXR2sWa1lxlDkK67zC2tMYkyQ3m11TWlEiHVPfcyL\nDbcI3bBEdgRTJ6czG8X/egXABe5+UESVMzPhd/jI/EZRKrwQV4wt0jBete1USvpG\nkKxursauYNrdUEH8OWWK6UDTS0f8Y9MDQ6pV59TpofPVg/FxHtQQh6Oh/aGvg9z1\nWmaAfNixOR2q+HlZmMp/t5NMkIEUdjuHCZ2Ys8gpmxMQfzD3NEBPkM5H8bc531am\nXVNG+S8NJXZAHtKh9HqYj2M4G/H6/xaCkylyDfP5i0i8IAP4vhAEwexXqJNysbTW\nEOg/ypPe+OdjEaTfKLCQ3GnKULs3v5RvNradut39NgYS9zF3URVAwxFmua0vSM9d\nO+vl+buwX3Rc5BStQvraKGMdnWMafI1C+efsDisqAgtFcf/8tPf19AlZn9DXWLCU\nD+Bf+XBBOTO1xHffFoxjXX//iIaeKpb8cNobG7FXfB9aG9e2CdAbHJCPvu8rH3Tm\nXGRK6XSeMlxvRlFmm+ZbgyZy/0u7YSdmfNsIZgiw8iI+9Qrclym8ZWhpzCYO5SA+\neiSCMrJ88kavR7td06mX\n=KhBw\n-----END PGP SIGNATURE-----\n","payload":"tree 4920de2ea90fc199cad1b0a4c99115f0499892cf\nparent 88eb956e2d77234f3e2d746b8278831cbb8d6546\nauthor Christian Byrne 1765317179 -0700\ncommitter GitHub 1765317179 -0700\n\nUpdate pyproject.toml","verified_at":"2025-12-09T21:52:59Z"}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/8346a6027e1f6871f362fb6bc4d2e521d560466f","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/8346a6027e1f6871f362fb6bc4d2e521d560466f","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/8346a6027e1f6871f362fb6bc4d2e521d560466f/comments","author":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"web-flow","id":19864447,"node_id":"MDQ6VXNlcjE5ODY0NDQ3","avatar_url":"https://avatars.githubusercontent.com/u/19864447?v=4","gravatar_id":"","url":"https://api.github.com/users/web-flow","html_url":"https://github.com/web-flow","followers_url":"https://api.github.com/users/web-flow/followers","following_url":"https://api.github.com/users/web-flow/following{/other_user}","gists_url":"https://api.github.com/users/web-flow/gists{/gist_id}","starred_url":"https://api.github.com/users/web-flow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/web-flow/subscriptions","organizations_url":"https://api.github.com/users/web-flow/orgs","repos_url":"https://api.github.com/users/web-flow/repos","events_url":"https://api.github.com/users/web-flow/events{/privacy}","received_events_url":"https://api.github.com/users/web-flow/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"88eb956e2d77234f3e2d746b8278831cbb8d6546","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/88eb956e2d77234f3e2d746b8278831cbb8d6546","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/88eb956e2d77234f3e2d746b8278831cbb8d6546"}]},{"sha":"5291831d7c321ab7a5192374482f9848dffee75b","node_id":"C_kwDOMRYcBtoAKDUyOTE4MzFkN2MzMjFhYjdhNTE5MjM3NDQ4MmY5ODQ4ZGZmZWU3NWI","commit":{"author":{"name":"christian-byrne","email":"abolkonsky.rem@gmail.com","date":"2025-01-05T19:10:38Z"},"committer":{"name":"christian-byrne","email":"abolkonsky.rem@gmail.com","date":"2025-01-05T19:10:38Z"},"message":"Use example_workflows new frontend feature","tree":{"sha":"1a36eb50ac08d03c062efdc3e81d31d080ea570e","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/1a36eb50ac08d03c062efdc3e81d31d080ea570e"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/5291831d7c321ab7a5192374482f9848dffee75b","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/5291831d7c321ab7a5192374482f9848dffee75b","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/5291831d7c321ab7a5192374482f9848dffee75b","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/5291831d7c321ab7a5192374482f9848dffee75b/comments","author":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"4d38c6f0b5cfb08e9375665dbbcd1e910b6ebe82","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/4d38c6f0b5cfb08e9375665dbbcd1e910b6ebe82","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/4d38c6f0b5cfb08e9375665dbbcd1e910b6ebe82"}]},{"sha":"a808c6ee34a39a8ee17b40610b3255008bb2fcdf","node_id":"C_kwDOMRYcBtoAKGE4MDhjNmVlMzRhMzlhOGVlMTdiNDA2MTBiMzI1NTAwOGJiMmZjZGY","commit":{"author":{"name":"christian-byrne","email":"abolkonsky.rem@gmail.com","date":"2025-01-01T10:02:57Z"},"committer":{"name":"christian-byrne","email":"abolkonsky.rem@gmail.com","date":"2025-01-01T10:02:57Z"},"message":"Update version","tree":{"sha":"5d17dd8136ed0929c5bb6e5de2c7e6b10a47e8e4","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/5d17dd8136ed0929c5bb6e5de2c7e6b10a47e8e4"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/a808c6ee34a39a8ee17b40610b3255008bb2fcdf","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/a808c6ee34a39a8ee17b40610b3255008bb2fcdf","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/a808c6ee34a39a8ee17b40610b3255008bb2fcdf","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/a808c6ee34a39a8ee17b40610b3255008bb2fcdf/comments","author":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"1b7caaa297634258ec2ecbc8b0afe0ae5e2c622e","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/1b7caaa297634258ec2ecbc8b0afe0ae5e2c622e","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/1b7caaa297634258ec2ecbc8b0afe0ae5e2c622e"}]},{"sha":"b7d66005f838b945568c0a7caeb59e1bc01e21e1","node_id":"C_kwDOMRYcBtoAKGI3ZDY2MDA1ZjgzOGI5NDU1NjhjMGE3Y2FlYjU5ZTFiYzAxZTIxZTE","commit":{"author":{"name":"christian-byrne","email":"abolkonsky.rem@gmail.com","date":"2024-07-19T21:22:40Z"},"committer":{"name":"christian-byrne","email":"abolkonsky.rem@gmail.com","date":"2024-07-19T21:22:40Z"},"message":"Added examples, TimeShift and GetTempo nodes","tree":{"sha":"bebb26ec763b352899e518ea11a550c331953a77","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/bebb26ec763b352899e518ea11a550c331953a77"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/b7d66005f838b945568c0a7caeb59e1bc01e21e1","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/b7d66005f838b945568c0a7caeb59e1bc01e21e1","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/b7d66005f838b945568c0a7caeb59e1bc01e21e1","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/b7d66005f838b945568c0a7caeb59e1bc01e21e1/comments","author":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"a5107dd740d5917bd18525512f40bbe3945a592b","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/a5107dd740d5917bd18525512f40bbe3945a592b","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/a5107dd740d5917bd18525512f40bbe3945a592b"}]},{"sha":"c30f9eb0d4a2eed743feb47a09a515abae3f43ab","node_id":"C_kwDOMRYcBtoAKGMzMGY5ZWIwZDRhMmVlZDc0M2ZlYjQ3YTA5YTUxNWFiYWUzZjQzYWI","commit":{"author":{"name":"christian-byrne","email":"abolkonsky.rem@gmail.com","date":"2024-07-09T05:00:44Z"},"committer":{"name":"christian-byrne","email":"abolkonsky.rem@gmail.com","date":"2024-07-09T05:00:44Z"},"message":"typo","tree":{"sha":"691bffe192caee4fb1ef55d551945f8266729f54","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/691bffe192caee4fb1ef55d551945f8266729f54"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/c30f9eb0d4a2eed743feb47a09a515abae3f43ab","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/c30f9eb0d4a2eed743feb47a09a515abae3f43ab","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/c30f9eb0d4a2eed743feb47a09a515abae3f43ab","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/c30f9eb0d4a2eed743feb47a09a515abae3f43ab/comments","author":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"5df61fbeb2cd2afea1f42c5e4c501ab515421fdf","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/5df61fbeb2cd2afea1f42c5e4c501ab515421fdf","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/5df61fbeb2cd2afea1f42c5e4c501ab515421fdf"}]},{"sha":"5df61fbeb2cd2afea1f42c5e4c501ab515421fdf","node_id":"C_kwDOMRYcBtoAKDVkZjYxZmJlYjJjZDJhZmVhMWY0MmM1ZTRjNTAxYWI1MTU0MjFmZGY","commit":{"author":{"name":"christian-byrne","email":"abolkonsky.rem@gmail.com","date":"2024-07-09T04:58:48Z"},"committer":{"name":"christian-byrne","email":"abolkonsky.rem@gmail.com","date":"2024-07-09T04:58:48Z"},"message":"Combine video+audio node, example workflows","tree":{"sha":"a44a61b7c171482d83d876eb0dd3c2483a3037a8","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/a44a61b7c171482d83d876eb0dd3c2483a3037a8"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/5df61fbeb2cd2afea1f42c5e4c501ab515421fdf","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/5df61fbeb2cd2afea1f42c5e4c501ab515421fdf","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/5df61fbeb2cd2afea1f42c5e4c501ab515421fdf","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/5df61fbeb2cd2afea1f42c5e4c501ab515421fdf/comments","author":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"6fefdade110be0c2ecae4f0c8fd8a0343a07cd4f","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/6fefdade110be0c2ecae4f0c8fd8a0343a07cd4f","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/6fefdade110be0c2ecae4f0c8fd8a0343a07cd4f"}]},{"sha":"6fefdade110be0c2ecae4f0c8fd8a0343a07cd4f","node_id":"C_kwDOMRYcBtoAKDZmZWZkYWRlMTEwYmUwYzJlY2FlNGYwYzhmZDhhMDM0M2EwN2NkNGY","commit":{"author":{"name":"christian-byrne","email":"abolkonsky.rem@gmail.com","date":"2024-07-09T03:57:36Z"},"committer":{"name":"christian-byrne","email":"abolkonsky.rem@gmail.com","date":"2024-07-09T03:57:36Z"},"message":"Update version","tree":{"sha":"bce3ffee48452a092b7c0b003cffc706592094bc","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/bce3ffee48452a092b7c0b003cffc706592094bc"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/6fefdade110be0c2ecae4f0c8fd8a0343a07cd4f","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/6fefdade110be0c2ecae4f0c8fd8a0343a07cd4f","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/6fefdade110be0c2ecae4f0c8fd8a0343a07cd4f","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/6fefdade110be0c2ecae4f0c8fd8a0343a07cd4f/comments","author":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"4d0046eed395b1b3aafd945cfe0cd6cd1e3cef7a","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/4d0046eed395b1b3aafd945cfe0cd6cd1e3cef7a","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/4d0046eed395b1b3aafd945cfe0cd6cd1e3cef7a"}]},{"sha":"4d0046eed395b1b3aafd945cfe0cd6cd1e3cef7a","node_id":"C_kwDOMRYcBtoAKDRkMDA0NmVlZDM5NWIxYjNhYWZkOTQ1Y2ZlMGNkNmNkMWUzY2VmN2E","commit":{"author":{"name":"christian-byrne","email":"abolkonsky.rem@gmail.com","date":"2024-07-09T03:54:39Z"},"committer":{"name":"christian-byrne","email":"abolkonsky.rem@gmail.com","date":"2024-07-09T03:54:39Z"},"message":"Update pyproject.toml","tree":{"sha":"8936974ba47fa6d5c6229d9ac2fc2261558dd42d","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/8936974ba47fa6d5c6229d9ac2fc2261558dd42d"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/4d0046eed395b1b3aafd945cfe0cd6cd1e3cef7a","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/4d0046eed395b1b3aafd945cfe0cd6cd1e3cef7a","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/4d0046eed395b1b3aafd945cfe0cd6cd1e3cef7a","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/4d0046eed395b1b3aafd945cfe0cd6cd1e3cef7a/comments","author":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"11b7b0a41263232b365ab38a98d1125d52475707","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/11b7b0a41263232b365ab38a98d1125d52475707","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/11b7b0a41263232b365ab38a98d1125d52475707"}]},{"sha":"01c147e780500c3f5c38895e0c8149566ed44809","node_id":"C_kwDOMRYcBtoAKDAxYzE0N2U3ODA1MDBjM2Y1YzM4ODk1ZTBjODE0OTU2NmVkNDQ4MDk","commit":{"author":{"name":"bymyself","email":"abolkonsky.rem@gmail.com","date":"2024-07-09T03:45:51Z"},"committer":{"name":"GitHub","email":"noreply@github.com","date":"2024-07-09T03:45:51Z"},"message":"Update pyproject.toml","tree":{"sha":"34c574f86dd5edd8e648bbe4cde0465cb1ce1e3f","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/34c574f86dd5edd8e648bbe4cde0465cb1ce1e3f"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/01c147e780500c3f5c38895e0c8149566ed44809","comment_count":0,"verification":{"verified":true,"reason":"valid","signature":"-----BEGIN PGP SIGNATURE-----\n\nwsFcBAABCAAQBQJmjLJvCRC1aQ7uu5UhlAAAhuQQAG8ZJBVkol4cfNsCF8hLRPW9\nD01iUu+ailll0xNewHRecT8V1eBoWaYPhmOpkifDcSOKKS+9TL/pSoLjKKWap8Ea\ndLqS1QTXLU4gOs6Tps6R2jnHtQpA/bxK74sROmVNhCxRL6A2X5G6xQOmhww3KgMS\nLUPhj0AHGglcYXMmURHO8Ay0SiBHwFKDgbIUnPZO8nzaPHLUzfkZN2upwlRAmeu+\nMNclx+fEnf382uNI0hf4HwKdi5GZGfVJTe84EcLoUOxZkLVYlGwV7a/ZlkdX4Z3L\nEof85+UMkHCTCe1Ord5EW46g1aLSNWdASc1AhdSaRZBMCaBWexMPy294C12QX6Hv\nxY09g+HtmdBFeov1cFET4UK1JabLPNYjUL1NDaN3o3PNutKtEnMsP7/EsrYTSQ1L\n/Is552A8fQ867AI4Iofjj7Qz6AQo0uZxFyz1Ss1CtA7lArEY1G35pQpj4BeW96Bu\n87Rmq5bR8nM0+ai/+GCnUWJCXKK7mqJ43EHcuIjWMPRM2g7NxydEjmXm99MrQH2Q\nuufVzrhlvSQIRiniTTGgzS+6cQy/CuPFPcIJUfLZ6SyO7N01R/tHT4IOmtkd0EJe\niYDx0BayWghSIH+ypFXbGFNHHIx4GCvdTFxgKc6i/POkbnUZMyQrF/2KvdqIQXio\nYzMkK/ociiJQK/abFDxI\n=JXo0\n-----END PGP SIGNATURE-----\n","payload":"tree 34c574f86dd5edd8e648bbe4cde0465cb1ce1e3f\nparent a946cef95222c1a7372d2f27f4d35c09680a5fb6\nauthor bymyself 1720496751 -0700\ncommitter GitHub 1720496751 -0700\n\nUpdate pyproject.toml","verified_at":"2024-11-15T04:29:25Z"}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/01c147e780500c3f5c38895e0c8149566ed44809","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/01c147e780500c3f5c38895e0c8149566ed44809","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/01c147e780500c3f5c38895e0c8149566ed44809/comments","author":{"login":"christian-byrne","id":72887196,"node_id":"MDQ6VXNlcjcyODg3MTk2","avatar_url":"https://avatars.githubusercontent.com/u/72887196?v=4","gravatar_id":"","url":"https://api.github.com/users/christian-byrne","html_url":"https://github.com/christian-byrne","followers_url":"https://api.github.com/users/christian-byrne/followers","following_url":"https://api.github.com/users/christian-byrne/following{/other_user}","gists_url":"https://api.github.com/users/christian-byrne/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-byrne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-byrne/subscriptions","organizations_url":"https://api.github.com/users/christian-byrne/orgs","repos_url":"https://api.github.com/users/christian-byrne/repos","events_url":"https://api.github.com/users/christian-byrne/events{/privacy}","received_events_url":"https://api.github.com/users/christian-byrne/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"web-flow","id":19864447,"node_id":"MDQ6VXNlcjE5ODY0NDQ3","avatar_url":"https://avatars.githubusercontent.com/u/19864447?v=4","gravatar_id":"","url":"https://api.github.com/users/web-flow","html_url":"https://github.com/web-flow","followers_url":"https://api.github.com/users/web-flow/followers","following_url":"https://api.github.com/users/web-flow/following{/other_user}","gists_url":"https://api.github.com/users/web-flow/gists{/gist_id}","starred_url":"https://api.github.com/users/web-flow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/web-flow/subscriptions","organizations_url":"https://api.github.com/users/web-flow/orgs","repos_url":"https://api.github.com/users/web-flow/repos","events_url":"https://api.github.com/users/web-flow/events{/privacy}","received_events_url":"https://api.github.com/users/web-flow/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"a946cef95222c1a7372d2f27f4d35c09680a5fb6","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/a946cef95222c1a7372d2f27f4d35c09680a5fb6","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/a946cef95222c1a7372d2f27f4d35c09680a5fb6"}]},{"sha":"a946cef95222c1a7372d2f27f4d35c09680a5fb6","node_id":"C_kwDOMRYcBtoAKGE5NDZjZWY5NTIyMmMxYTczNzJkMmYyN2Y0ZDM1YzA5NjgwYTVmYjY","commit":{"author":{"name":"snomiao","email":"snomiao+comfy-pr@gmail.com","date":"2024-07-03T10:59:12Z"},"committer":{"name":"snomiao","email":"snomiao+comfy-pr@gmail.com","date":"2024-07-03T10:59:12Z"},"message":"chore(pyproject): Add pyproject.toml for Custom Node Registry","tree":{"sha":"07642d518e7570bb6916c10ff4d8566bf950a9e4","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/trees/07642d518e7570bb6916c10ff4d8566bf950a9e4"},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/git/commits/a946cef95222c1a7372d2f27f4d35c09680a5fb6","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/a946cef95222c1a7372d2f27f4d35c09680a5fb6","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/a946cef95222c1a7372d2f27f4d35c09680a5fb6","comments_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/a946cef95222c1a7372d2f27f4d35c09680a5fb6/comments","author":{"login":"comfy-pr-bot","id":172744619,"node_id":"U_kgDOCkvfqw","avatar_url":"https://avatars.githubusercontent.com/u/172744619?v=4","gravatar_id":"","url":"https://api.github.com/users/comfy-pr-bot","html_url":"https://github.com/comfy-pr-bot","followers_url":"https://api.github.com/users/comfy-pr-bot/followers","following_url":"https://api.github.com/users/comfy-pr-bot/following{/other_user}","gists_url":"https://api.github.com/users/comfy-pr-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/comfy-pr-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/comfy-pr-bot/subscriptions","organizations_url":"https://api.github.com/users/comfy-pr-bot/orgs","repos_url":"https://api.github.com/users/comfy-pr-bot/repos","events_url":"https://api.github.com/users/comfy-pr-bot/events{/privacy}","received_events_url":"https://api.github.com/users/comfy-pr-bot/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"comfy-pr-bot","id":172744619,"node_id":"U_kgDOCkvfqw","avatar_url":"https://avatars.githubusercontent.com/u/172744619?v=4","gravatar_id":"","url":"https://api.github.com/users/comfy-pr-bot","html_url":"https://github.com/comfy-pr-bot","followers_url":"https://api.github.com/users/comfy-pr-bot/followers","following_url":"https://api.github.com/users/comfy-pr-bot/following{/other_user}","gists_url":"https://api.github.com/users/comfy-pr-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/comfy-pr-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/comfy-pr-bot/subscriptions","organizations_url":"https://api.github.com/users/comfy-pr-bot/orgs","repos_url":"https://api.github.com/users/comfy-pr-bot/repos","events_url":"https://api.github.com/users/comfy-pr-bot/events{/privacy}","received_events_url":"https://api.github.com/users/comfy-pr-bot/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"0ed7f4c73191de0ed33bc299c5b7956be268220d","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/0ed7f4c73191de0ed33bc299c5b7956be268220d","html_url":"https://github.com/christian-byrne/audio-separation-nodes-comfyui/commit/0ed7f4c73191de0ed33bc299c5b7956be268220d"}]}]
\ No newline at end of file
diff --git a/docs/hel-892/separation-reference/plugin-tags.json b/docs/hel-892/separation-reference/plugin-tags.json
new file mode 100644
index 00000000..d5fe7dbf
--- /dev/null
+++ b/docs/hel-892/separation-reference/plugin-tags.json
@@ -0,0 +1 @@
+[{"name":"v2.0.0","zipball_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/zipball/refs/tags/v2.0.0","tarball_url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/tarball/refs/tags/v2.0.0","commit":{"sha":"bb42b2d210c0335986ed922cbe8231b10f0ffabb","url":"https://api.github.com/repos/christian-byrne/audio-separation-nodes-comfyui/commits/bb42b2d210c0335986ed922cbe8231b10f0ffabb"},"node_id":"REF_kwDOMRYcBrByZWZzL3RhZ3MvdjIuMC4w"}]
\ No newline at end of file
diff --git a/docs/hel-892/separation-reference/registry-1.4.0.json b/docs/hel-892/separation-reference/registry-1.4.0.json
new file mode 100644
index 00000000..22439892
--- /dev/null
+++ b/docs/hel-892/separation-reference/registry-1.4.0.json
@@ -0,0 +1 @@
+{"changelog":"","createdAt":"2025-01-05T19:11:07.919704Z","dependencies":["librosa==0.10.2","numpy","torchaudio\u003e=2.3.0","moviepy"],"deprecated":false,"downloadUrl":"https://cdn.comfy.org/christian-byrne/audio-separation-nodes-comfyui/1.4.0/node.zip","id":"08cc8745-19bc-4c78-80a9-6fcb97ef4da1","node_id":"audio-separation-nodes-comfyui","status":"NodeVersionStatusActive","supported_accelerators":null,"supported_comfyui_frontend_version":"","supported_comfyui_version":"","supported_os":null,"tags":[],"version":"1.4.0"}
diff --git a/docs/hel-892/separation-reference/registry-1.4.0.zip b/docs/hel-892/separation-reference/registry-1.4.0.zip
new file mode 100644
index 00000000..d5546cb2
Binary files /dev/null and b/docs/hel-892/separation-reference/registry-1.4.0.zip differ
diff --git a/docs/hel-892/separation-reference/registry-source-match.json b/docs/hel-892/separation-reference/registry-source-match.json
new file mode 100644
index 00000000..7095cc64
--- /dev/null
+++ b/docs/hel-892/separation-reference/registry-source-match.json
@@ -0,0 +1,32 @@
+{
+ "commit": "5291831d7c321ab7a5192374482f9848dffee75b",
+ "files": [
+ {
+ "file": "pyproject.toml",
+ "sha256": "87acc158dbdc300127bc9154e4ca1b905c139c9434726797995d2b3629d7b0a1",
+ "registry_member_equal": true
+ },
+ {
+ "file": "__init__.py",
+ "sha256": "7968717a19aa0aa9b3c4b2daaeef8ae64196ac0f0fb402d418a2809a9bd22663",
+ "registry_member_equal": true
+ },
+ {
+ "file": "src/separation.py",
+ "sha256": "08605b797d8f086c7692f6af1df716af692e77a0c810277e2b0467c45ac66ed0",
+ "registry_member_equal": true
+ },
+ {
+ "file": ".github/workflows/publish.yml",
+ "sha256": "fcc303b0b70778d3053f9ebf3c058f8d2e1062153f3504410bead4e5446c4ee9",
+ "registry_member_equal": true
+ },
+ {
+ "file": "README.md",
+ "sha256": "686ef502d7dfec641b2f690142f36903fb1d2f8952bf252e754bf8ac1a11963d",
+ "registry_member_equal": true
+ }
+ ],
+ "registry_commit_binding": "not exposed by registry API; matching selected source bytes is not a signed release mapping",
+ "license": "pyproject names LICENSE, but no license file in this commit/package; unknown. MIT only added later at 504248bd, not retroactively assigned"
+}
diff --git a/docs/hel-892/separation-reference/registry____init__.py b/docs/hel-892/separation-reference/registry____init__.py
new file mode 100644
index 00000000..a9195868
--- /dev/null
+++ b/docs/hel-892/separation-reference/registry____init__.py
@@ -0,0 +1,18 @@
+from .src.separation import AudioSeparation
+from .src.tempo_match import TempoMatch
+from .src.crop import AudioCrop
+from .src.combine import AudioCombine
+from .src.combine_video_with_audio import AudioVideoCombine
+from .src.time_shift import TimeShift
+from .src.get_tempo import GetTempo
+
+
+NODE_CLASS_MAPPINGS = {
+ "AudioSeparation": AudioSeparation,
+ "AudioCrop": AudioCrop,
+ "AudioCombine": AudioCombine,
+ "AudioTempoMatch": TempoMatch,
+ "AudioVideoCombine": AudioVideoCombine,
+ "AudioSpeedShift": TimeShift,
+ "AudioGetTempo": GetTempo,
+}
\ No newline at end of file
diff --git a/docs/hel-892/separation-reference/registry__pyproject.toml b/docs/hel-892/separation-reference/registry__pyproject.toml
new file mode 100644
index 00000000..0824da3f
--- /dev/null
+++ b/docs/hel-892/separation-reference/registry__pyproject.toml
@@ -0,0 +1,15 @@
+[project]
+name = "audio-separation-nodes-comfyui"
+description = "Separate audio track into stems (vocals, bass, drums, other). Along with tools to recombine, tempo match, slice/crop audio"
+version = "1.4.0"
+license = "LICENSE"
+dependencies = ["librosa==0.10.2", "numpy", "torchaudio>=2.3.0", "moviepy"]
+
+[project.urls]
+Repository = "https://github.com/christian-byrne/audio-separation-nodes-comfyui"
+# Used by Comfy Registry https://comfyregistry.org
+
+[tool.comfy]
+PublisherId = "christian-byrne"
+DisplayName = "audio-separation-nodes-comfyui"
+Icon = "https://img.icons8.com/?size=100&id=gSULe4i1JTpL&format=png&color=000000"
diff --git a/docs/hel-892/separation-reference/registry__src__separation.py b/docs/hel-892/separation-reference/registry__src__separation.py
new file mode 100644
index 00000000..625639c7
--- /dev/null
+++ b/docs/hel-892/separation-reference/registry__src__separation.py
@@ -0,0 +1,171 @@
+"""Credit: https://pytorch.org/audio/stable/tutorials/hybrid_demucs_tutorial.html"""
+
+import torch
+from torchaudio.transforms import Fade, Resample
+from torchaudio.pipelines import HDEMUCS_HIGH_MUSDB_PLUS
+
+import comfy.model_management
+
+from typing import Dict, Tuple
+from ._types import AUDIO
+from .utils import ensure_stereo
+
+
+class AudioSeparation:
+ @classmethod
+ def INPUT_TYPES(cls):
+ return {
+ "required": {
+ "audio": ("AUDIO",),
+ },
+ "optional": {
+ "chunk_fade_shape": (
+ [
+ "linear",
+ "half_sine",
+ "logarithmic",
+ "exponential",
+ ],
+ {
+ "default": "linear",
+ "tooltip": "Audio is split into segments (chunks) with overlapping areas to ensure smooth transitions. This setting controls the fade effect at these overlaps. Choose Linear for even fading, Half-Sine for a smooth curve, Logarithmic for a quick fade out and slow fade in, or Exponential for a slow fade out and quick fade in.",
+ },
+ ),
+ "chunk_length": (
+ "FLOAT",
+ {
+ "default": 10.0,
+ "tooltip": "The length of each segment (chunk) in seconds. Longer chunks may require more memory and MIGHT produce better results.",
+ },
+ ),
+ "chunk_overlap": (
+ "FLOAT",
+ {
+ "default": 0.1,
+ "tooltip": "The overlap between each segment (chunk) in seconds. A higher overlap may be necessary if chunks are too short or the audio changes rapidly.",
+ },
+ ),
+ },
+ }
+
+ FUNCTION = "main"
+ RETURN_TYPES = ("AUDIO", "AUDIO", "AUDIO", "AUDIO")
+ RETURN_NAMES = ("Bass", "Drums", "Other", "Vocals")
+ CATEGORY = "audio"
+ DESCRIPTION = "Separate audio into four sources: bass, drums, other, and vocals."
+
+ def main(
+ self,
+ audio: AUDIO,
+ chunk_fade_shape: str = "linear",
+ chunk_length: float = 10.0,
+ chunk_overlap: float = 0.1,
+ ) -> Tuple[AUDIO, AUDIO, AUDIO, AUDIO]:
+
+ device: torch.device = comfy.model_management.get_torch_device()
+ waveform: torch.Tensor = audio["waveform"]
+ waveform = waveform.squeeze(0).to(device)
+ self.input_sample_rate_: int = audio["sample_rate"]
+
+ bundle = HDEMUCS_HIGH_MUSDB_PLUS
+ model: torch.nn.Module = bundle.get_model().to(device)
+ self.model_sample_rate = bundle.sample_rate
+
+ waveform = ensure_stereo(waveform)
+
+ # Resample to model's expected sample rate
+ if self.input_sample_rate_ != self.model_sample_rate:
+ resample = Resample(self.input_sample_rate_, self.model_sample_rate).to(
+ device
+ )
+ waveform = resample(waveform)
+
+ ref = waveform.mean(0)
+ waveform = (waveform - ref.mean()) / ref.std() # Zs
+
+ sources = self.separate_sources(
+ model,
+ waveform[None],
+ self.model_sample_rate,
+ segment=chunk_length,
+ overlap=chunk_overlap,
+ device=device,
+ chunk_fade_shape=chunk_fade_shape,
+ )[0]
+ sources = sources * ref.std() + ref.mean()
+ sources_list = model.sources
+ sources = list(sources)
+
+ return self.sources_to_tuple(dict(zip(sources_list, sources)))
+
+ def sources_to_tuple(
+ self, sources: Dict[str, torch.Tensor]
+ ) -> Tuple[AUDIO, AUDIO, AUDIO, AUDIO]:
+
+ output_order = ["bass", "drums", "other", "vocals"]
+ outputs = []
+ for source in output_order:
+ if source not in sources:
+ raise ValueError(f"Missing source {source} in the output")
+ outputs.append(
+ {
+ "waveform": sources[source].cpu().unsqueeze(0),
+ "sample_rate": self.model_sample_rate,
+ }
+ )
+ return tuple(outputs)
+
+ def separate_sources(
+ self,
+ model: torch.nn.Module,
+ mix: torch.Tensor,
+ sample_rate: int,
+ segment: float = 10.0,
+ overlap: float = 0.1,
+ device: torch.device = None,
+ chunk_fade_shape: str = "linear",
+ ) -> torch.Tensor:
+ """
+ From: https://pytorch.org/audio/stable/tutorials/hybrid_demucs_tutorial.html
+
+ Apply model to a given mixture. Use fade, and add segments together in order to add model segment by segment.
+
+ Args:
+ segment (int): segment length in seconds
+ device (torch.device, str, or None): if provided, device on which to
+ execute the computation, otherwise `mix.device` is assumed.
+ When `device` is different from `mix.device`, only local computations will
+ be on `device`, while the entire tracks will be stored on `mix.device`.
+ """
+ if device is None:
+ device = mix.device
+ else:
+ device = torch.device(device)
+
+ batch, channels, length = mix.shape
+
+ chunk_len = int(sample_rate * segment * (1 + overlap))
+ start = 0
+ end = chunk_len
+ overlap_frames = overlap * sample_rate
+ fade = Fade(
+ fade_in_len=0, fade_out_len=int(overlap_frames), fade_shape=chunk_fade_shape
+ )
+
+ final = torch.zeros(batch, len(model.sources), channels, length, device=device)
+
+ while start < length - overlap_frames:
+ chunk = mix[:, :, start:end]
+ with torch.no_grad():
+ out = model.forward(chunk)
+ out = fade(out)
+ final[:, :, :, start:end] += out
+ if start == 0:
+ fade.fade_in_len = int(overlap_frames)
+ start += int(chunk_len - overlap_frames)
+ else:
+ start += chunk_len
+ end += chunk_len
+ if end >= length:
+ fade.fade_out_len = 0
+ return final
diff --git a/docs/hel-892/separation-reference/sources.json b/docs/hel-892/separation-reference/sources.json
new file mode 100644
index 00000000..47f974be
--- /dev/null
+++ b/docs/hel-892/separation-reference/sources.json
@@ -0,0 +1,438 @@
+{
+ "authority": "public_reference_only_not_object_info",
+ "source_entry_count": 13,
+ "unique_id_count": 13,
+ "sources": [
+ {
+ "id": "Comfy-Org/ComfyUI@265adad858e1f31b66cd3523a02b16f5d34ced52:comfy_extras/nodes_audio.py",
+ "repository": "https://github.com/Comfy-Org/ComfyUI",
+ "commit": "265adad858e1f31b66cd3523a02b16f5d34ced52",
+ "file": "comfy_extras/nodes_audio.py",
+ "url": "https://github.com/Comfy-Org/ComfyUI/blob/265adad858e1f31b66cd3523a02b16f5d34ced52/comfy_extras/nodes_audio.py",
+ "raw_url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/265adad858e1f31b66cd3523a02b16f5d34ced52/comfy_extras/nodes_audio.py",
+ "local_file": "core-0.3.68__comfy_extras__nodes_audio.py",
+ "sha256": "28c8c4b19af120acabf7c35d66b89e14f47f2aa08d91dfda5eb1ee651c4ab4b7",
+ "retrieved_at": "2026-10-29T19:06:39.792308+00:00",
+ "license": "GPL-3.0",
+ "lines": [
+ [
+ 1,
+ 614
+ ]
+ ],
+ "rule_locations": {
+ "SaveAudio definition": [
+ 196,
+ 218
+ ],
+ "SaveAudioMP3 definition": [
+ 220,
+ 243
+ ],
+ "PreviewAudio definition": [
+ 270,
+ 281
+ ],
+ "LoadAudio definition": [
+ 319,
+ 349
+ ],
+ "SaveAudioMP3 registration": [
+ 584,
+ 584
+ ],
+ "LoadAudio registration": [
+ 586,
+ 586
+ ],
+ "PreviewAudio registration": [
+ 587,
+ 587
+ ],
+ "save_audio UI descriptors": [
+ 187,
+ 194
+ ],
+ "MP3 codec options": [
+ 158,
+ 173
+ ]
+ },
+ "target_version_match": "unknown"
+ },
+ {
+ "id": "Comfy-Org/ComfyUI@265adad858e1f31b66cd3523a02b16f5d34ced52:nodes.py",
+ "repository": "https://github.com/Comfy-Org/ComfyUI",
+ "commit": "265adad858e1f31b66cd3523a02b16f5d34ced52",
+ "file": "nodes.py",
+ "url": "https://github.com/Comfy-Org/ComfyUI/blob/265adad858e1f31b66cd3523a02b16f5d34ced52/nodes.py",
+ "raw_url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/265adad858e1f31b66cd3523a02b16f5d34ced52/nodes.py",
+ "local_file": "core-0.3.68__nodes.py",
+ "sha256": "c92e2e6e3af2ca1a1219276a28660a415f51eb0b02b994e2fb3639d3aca916b3",
+ "retrieved_at": "2026-10-29T19:06:40.564315+00:00",
+ "license": "GPL-3.0",
+ "lines": [
+ [
+ 1,
+ 2423
+ ]
+ ],
+ "rule_locations": {
+ "extra module list entry": [
+ 2293,
+ 2293
+ ],
+ "extra module loading": [
+ 2337,
+ 2338
+ ]
+ },
+ "target_version_match": "unknown"
+ },
+ {
+ "id": "Comfy-Org/ComfyUI@265adad858e1f31b66cd3523a02b16f5d34ced52:execution.py",
+ "repository": "https://github.com/Comfy-Org/ComfyUI",
+ "commit": "265adad858e1f31b66cd3523a02b16f5d34ced52",
+ "file": "execution.py",
+ "url": "https://github.com/Comfy-Org/ComfyUI/blob/265adad858e1f31b66cd3523a02b16f5d34ced52/execution.py",
+ "raw_url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/265adad858e1f31b66cd3523a02b16f5d34ced52/execution.py",
+ "local_file": "core-0.3.68__execution.py",
+ "sha256": "d8db3b6f0874f2a7d1ac627f36b4ef668780c4dffa2db1e2e109f22f1663bb41",
+ "retrieved_at": "2026-10-29T19:06:41.360322+00:00",
+ "license": "GPL-3.0",
+ "lines": [
+ [
+ 1,
+ 1232
+ ]
+ ],
+ "rule_locations": {
+ "legacy UI merge": [
+ 331,
+ 394
+ ],
+ "UI cache": [
+ 520,
+ 531
+ ],
+ "history result": [
+ 723,
+ 734
+ ],
+ "queue history storage": [
+ 1140,
+ 1145
+ ]
+ },
+ "target_version_match": "unknown"
+ },
+ {
+ "id": "Comfy-Org/ComfyUI@265adad858e1f31b66cd3523a02b16f5d34ced52:LICENSE",
+ "repository": "https://github.com/Comfy-Org/ComfyUI",
+ "commit": "265adad858e1f31b66cd3523a02b16f5d34ced52",
+ "file": "LICENSE",
+ "url": "https://github.com/Comfy-Org/ComfyUI/blob/265adad858e1f31b66cd3523a02b16f5d34ced52/LICENSE",
+ "raw_url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/265adad858e1f31b66cd3523a02b16f5d34ced52/LICENSE",
+ "local_file": "core-0.3.68__LICENSE",
+ "sha256": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986",
+ "retrieved_at": "2026-10-29T19:06:42.004327+00:00",
+ "license": "GPL-3.0",
+ "lines": [
+ [
+ 1,
+ 674
+ ]
+ ],
+ "rule_locations": {},
+ "target_version_match": "unknown"
+ },
+ {
+ "id": "Comfy-Org/ComfyUI@c55fd7481626d8bee8044ea7512ea996d13a1b90:comfy_extras/nodes_audio.py",
+ "repository": "https://github.com/Comfy-Org/ComfyUI",
+ "commit": "c55fd7481626d8bee8044ea7512ea996d13a1b90",
+ "file": "comfy_extras/nodes_audio.py",
+ "url": "https://github.com/Comfy-Org/ComfyUI/blob/c55fd7481626d8bee8044ea7512ea996d13a1b90/comfy_extras/nodes_audio.py",
+ "raw_url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/c55fd7481626d8bee8044ea7512ea996d13a1b90/comfy_extras/nodes_audio.py",
+ "local_file": "core-0.3.71__comfy_extras__nodes_audio.py",
+ "sha256": "28c8c4b19af120acabf7c35d66b89e14f47f2aa08d91dfda5eb1ee651c4ab4b7",
+ "retrieved_at": "2026-10-29T19:06:42.792334+00:00",
+ "license": "GPL-3.0",
+ "lines": [
+ [
+ 1,
+ 614
+ ]
+ ],
+ "rule_locations": {
+ "SaveAudio definition": [
+ 196,
+ 218
+ ],
+ "SaveAudioMP3 definition": [
+ 220,
+ 243
+ ],
+ "PreviewAudio definition": [
+ 270,
+ 281
+ ],
+ "LoadAudio definition": [
+ 319,
+ 349
+ ],
+ "SaveAudioMP3 registration": [
+ 584,
+ 584
+ ],
+ "LoadAudio registration": [
+ 586,
+ 586
+ ],
+ "PreviewAudio registration": [
+ 587,
+ 587
+ ],
+ "save_audio UI descriptors": [
+ 187,
+ 194
+ ],
+ "MP3 codec options": [
+ 158,
+ 173
+ ]
+ },
+ "target_version_match": "unknown"
+ },
+ {
+ "id": "Comfy-Org/ComfyUI@c55fd7481626d8bee8044ea7512ea996d13a1b90:nodes.py",
+ "repository": "https://github.com/Comfy-Org/ComfyUI",
+ "commit": "c55fd7481626d8bee8044ea7512ea996d13a1b90",
+ "file": "nodes.py",
+ "url": "https://github.com/Comfy-Org/ComfyUI/blob/c55fd7481626d8bee8044ea7512ea996d13a1b90/nodes.py",
+ "raw_url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/c55fd7481626d8bee8044ea7512ea996d13a1b90/nodes.py",
+ "local_file": "core-0.3.71__nodes.py",
+ "sha256": "0c7a93f8aee98e01481501ac40721fadf43694e6e04f0b69c746c777ee3c9372",
+ "retrieved_at": "2026-10-29T19:06:43.632341+00:00",
+ "license": "GPL-3.0",
+ "lines": [
+ [
+ 1,
+ 2430
+ ]
+ ],
+ "rule_locations": {
+ "extra module list entry": [
+ 2298,
+ 2298
+ ],
+ "extra module loading": [
+ 2343,
+ 2344
+ ]
+ },
+ "target_version_match": "unknown"
+ },
+ {
+ "id": "Comfy-Org/ComfyUI@c55fd7481626d8bee8044ea7512ea996d13a1b90:execution.py",
+ "repository": "https://github.com/Comfy-Org/ComfyUI",
+ "commit": "c55fd7481626d8bee8044ea7512ea996d13a1b90",
+ "file": "execution.py",
+ "url": "https://github.com/Comfy-Org/ComfyUI/blob/c55fd7481626d8bee8044ea7512ea996d13a1b90/execution.py",
+ "raw_url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/c55fd7481626d8bee8044ea7512ea996d13a1b90/execution.py",
+ "local_file": "core-0.3.71__execution.py",
+ "sha256": "d8db3b6f0874f2a7d1ac627f36b4ef668780c4dffa2db1e2e109f22f1663bb41",
+ "retrieved_at": "2026-10-29T19:06:44.332347+00:00",
+ "license": "GPL-3.0",
+ "lines": [
+ [
+ 1,
+ 1232
+ ]
+ ],
+ "rule_locations": {
+ "legacy UI merge": [
+ 331,
+ 394
+ ],
+ "UI cache": [
+ 520,
+ 531
+ ],
+ "history result": [
+ 723,
+ 734
+ ],
+ "queue history storage": [
+ 1140,
+ 1145
+ ]
+ },
+ "target_version_match": "unknown"
+ },
+ {
+ "id": "Comfy-Org/ComfyUI@c55fd7481626d8bee8044ea7512ea996d13a1b90:LICENSE",
+ "repository": "https://github.com/Comfy-Org/ComfyUI",
+ "commit": "c55fd7481626d8bee8044ea7512ea996d13a1b90",
+ "file": "LICENSE",
+ "url": "https://github.com/Comfy-Org/ComfyUI/blob/c55fd7481626d8bee8044ea7512ea996d13a1b90/LICENSE",
+ "raw_url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/c55fd7481626d8bee8044ea7512ea996d13a1b90/LICENSE",
+ "local_file": "core-0.3.71__LICENSE",
+ "sha256": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986",
+ "retrieved_at": "2026-10-29T19:06:44.912352+00:00",
+ "license": "GPL-3.0",
+ "lines": [
+ [
+ 1,
+ 674
+ ]
+ ],
+ "rule_locations": {},
+ "target_version_match": "unknown"
+ },
+ {
+ "id": "christian-byrne/audio-separation-nodes-comfyui@5291831d7c321ab7a5192374482f9848dffee75b:src/separation.py",
+ "repository": "https://github.com/christian-byrne/audio-separation-nodes-comfyui",
+ "commit": "5291831d7c321ab7a5192374482f9848dffee75b",
+ "file": "src/separation.py",
+ "url": "https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/src/separation.py",
+ "raw_url": "https://raw.githubusercontent.com/christian-byrne/audio-separation-nodes-comfyui/5291831d7c321ab7a5192374482f9848dffee75b/src/separation.py",
+ "local_file": "plugin-5291831d__src__separation.py",
+ "sha256": "08605b797d8f086c7692f6af1df716af692e77a0c810277e2b0467c45ac66ed0",
+ "retrieved_at": "2026-10-29T19:07:49.404798+00:00",
+ "license": "unknown; LICENSE referenced but absent at this commit and in registry package",
+ "lines": [
+ [
+ 1,
+ 171
+ ]
+ ],
+ "rule_locations": {
+ "schema": [
+ 14,
+ 50
+ ],
+ "return names/types": [
+ 52,
+ 53
+ ],
+ "source ordering": [
+ 100,
+ 117
+ ],
+ "chunk math": [
+ 147,
+ 168
+ ]
+ },
+ "target_version_match": "unknown"
+ },
+ {
+ "id": "christian-byrne/audio-separation-nodes-comfyui@5291831d7c321ab7a5192374482f9848dffee75b:__init__.py",
+ "repository": "https://github.com/christian-byrne/audio-separation-nodes-comfyui",
+ "commit": "5291831d7c321ab7a5192374482f9848dffee75b",
+ "file": "__init__.py",
+ "url": "https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/__init__.py",
+ "raw_url": "https://raw.githubusercontent.com/christian-byrne/audio-separation-nodes-comfyui/5291831d7c321ab7a5192374482f9848dffee75b/__init__.py",
+ "local_file": "plugin-5291831d____init__.py",
+ "sha256": "7968717a19aa0aa9b3c4b2daaeef8ae64196ac0f0fb402d418a2809a9bd22663",
+ "retrieved_at": "2026-10-29T19:07:49.284798+00:00",
+ "license": "unknown; LICENSE referenced but absent at this commit and in registry package",
+ "lines": [
+ [
+ 1,
+ 18
+ ]
+ ],
+ "rule_locations": {
+ "import": [
+ 1,
+ 1
+ ],
+ "AudioSeparation registration": [
+ 11,
+ 11
+ ]
+ },
+ "target_version_match": "unknown"
+ },
+ {
+ "id": "christian-byrne/audio-separation-nodes-comfyui@5291831d7c321ab7a5192374482f9848dffee75b:pyproject.toml",
+ "repository": "https://github.com/christian-byrne/audio-separation-nodes-comfyui",
+ "commit": "5291831d7c321ab7a5192374482f9848dffee75b",
+ "file": "pyproject.toml",
+ "url": "https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/pyproject.toml",
+ "raw_url": "https://raw.githubusercontent.com/christian-byrne/audio-separation-nodes-comfyui/5291831d7c321ab7a5192374482f9848dffee75b/pyproject.toml",
+ "local_file": "plugin-5291831d__pyproject.toml",
+ "sha256": "87acc158dbdc300127bc9154e4ca1b905c139c9434726797995d2b3629d7b0a1",
+ "retrieved_at": "2026-10-29T19:07:49.092797+00:00",
+ "license": "unknown; LICENSE referenced but absent at this commit and in registry package",
+ "lines": [
+ [
+ 1,
+ 15
+ ]
+ ],
+ "rule_locations": {
+ "name_version_license_repository": [
+ 1,
+ 9
+ ]
+ },
+ "target_version_match": "unknown"
+ },
+ {
+ "id": "christian-byrne/audio-separation-nodes-comfyui@5291831d7c321ab7a5192374482f9848dffee75b:.github/workflows/publish.yml",
+ "repository": "https://github.com/christian-byrne/audio-separation-nodes-comfyui",
+ "commit": "5291831d7c321ab7a5192374482f9848dffee75b",
+ "file": ".github/workflows/publish.yml",
+ "url": "https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/.github/workflows/publish.yml",
+ "raw_url": "https://raw.githubusercontent.com/christian-byrne/audio-separation-nodes-comfyui/5291831d7c321ab7a5192374482f9848dffee75b/.github/workflows/publish.yml",
+ "local_file": "plugin-5291831d__.github__workflows__publish.yml",
+ "sha256": "fcc303b0b70778d3053f9ebf3c058f8d2e1062153f3504410bead4e5446c4ee9",
+ "retrieved_at": "2026-10-29T19:07:49.392798+00:00",
+ "license": "unknown; LICENSE referenced but absent at this commit and in registry package",
+ "lines": [
+ [
+ 1,
+ 23
+ ]
+ ],
+ "rule_locations": {
+ "publish trigger": [
+ 2,
+ 8
+ ],
+ "publish action": [
+ 17,
+ 23
+ ]
+ },
+ "target_version_match": "unknown"
+ },
+ {
+ "id": "christian-byrne/audio-separation-nodes-comfyui@5291831d7c321ab7a5192374482f9848dffee75b:README.md",
+ "repository": "https://github.com/christian-byrne/audio-separation-nodes-comfyui",
+ "commit": "5291831d7c321ab7a5192374482f9848dffee75b",
+ "file": "README.md",
+ "url": "https://github.com/christian-byrne/audio-separation-nodes-comfyui/blob/5291831d7c321ab7a5192374482f9848dffee75b/README.md",
+ "raw_url": "https://raw.githubusercontent.com/christian-byrne/audio-separation-nodes-comfyui/5291831d7c321ab7a5192374482f9848dffee75b/README.md",
+ "local_file": "plugin-5291831d__README.md",
+ "sha256": "686ef502d7dfec641b2f690142f36903fb1d2f8952bf252e754bf8ac1a11963d",
+ "retrieved_at": "2026-10-29T19:07:49.496799+00:00",
+ "license": "unknown; LICENSE referenced but absent at this commit and in registry package",
+ "lines": [
+ [
+ 1,
+ 91
+ ]
+ ],
+ "rule_locations": {
+ "declared behavior": [
+ 1,
+ 40
+ ]
+ },
+ "target_version_match": "unknown"
+ }
+ ]
+}