diff --git a/calliope-backend/scripts/audit_reference_conversion.py b/calliope-backend/scripts/audit_reference_conversion.py index 4f7b857f..66a2f14a 100644 --- a/calliope-backend/scripts/audit_reference_conversion.py +++ b/calliope-backend/scripts/audit_reference_conversion.py @@ -41,6 +41,7 @@ from calliope.comfyui.serialization_reference import ( ) from calliope.comfyui.structure_reference import ( PROMOTED_PROFILES, + SCAIL_LOAD_PROFILES, SETGET_COMMIT, SETGET_PROFILES, STRUCTURE_PROFILES, @@ -301,6 +302,7 @@ REFERENCE_PROFILES = ( *VHS_PROFILES, *SETGET_PROFILES, *VIDEOINFO_PROFILES, + *SCAIL_LOAD_PROFILES, ) @@ -505,6 +507,7 @@ def profile_attempt(source, profile): **VHS_PROFILES, **SETGET_PROFILES, **VIDEOINFO_PROFILES, + **SCAIL_LOAD_PROFILES, }.get(profile, "1.37.11") assumptions = { "frontend": expected, @@ -582,7 +585,7 @@ def profile_attempt(source, profile): "serialization-evidence/sources.json", ] base = {"profile": profile, "assumptions": assumptions} - if profile in (*SETGET_PROFILES, *VIDEOINFO_PROFILES): + if profile in (*SETGET_PROFILES, *VIDEOINFO_PROFILES, *SCAIL_LOAD_PROFILES): assumptions["setget_reference"] = { "commit": SETGET_COMMIT, "missing_version": "explicit_fixed_reference_assumption_only", @@ -606,7 +609,38 @@ def profile_attempt(source, profile): } for i, n in enumerate(source.get("nodes", [])) ] - if profile in VIDEOINFO_PROFILES: + if profile in SCAIL_LOAD_PROFILES: + assumptions["scail_load_reference"] = { + "commit": "8e4d79471bf1952154768e8435a9300077b534fa", + "contract": "scail-load-reference/contract.json", + "scope": ( + "exact loader + info537f3a02 + KJab72eda7 + old core/Combine; " + "AnimateDiff fixed points, no UE/VAE/batch" + ), + "legacy_literal_aux": ( + "historical KJ emission proven; this graph provenance unproven; rejected" + ), + "actual_fps": "unknown; no media/info evaluated", + } + assumptions["reference_sources"].insert(0, "scail-load-reference/sources.json") + base["verified_reference_facts"] = "scail-load-reference/contract.json" + if not any( + n.get("type") == "VHS_LoadVideo" + and (n.get("properties") or {}).get("ver") + == "8e4d79471bf1952154768e8435a9300077b534fa" + for n in source.get("nodes", []) + ): + return { + **base, + "status": "not_applicable", + "issues": [ + { + "code": "scail_load_not_present", + "message": "新组合要求精确8e4d7947加载器", + } + ], + } + if profile in (*VIDEOINFO_PROFILES, *SCAIL_LOAD_PROFILES): assumptions["videoinfo_reference"] = { "commit": "537f3a02269e14ab4b0350d4189a52034e9a3b12", "contract": "videoinfo-reference/contract.json", @@ -614,7 +648,8 @@ def profile_attempt(source, profile): "scalar_values": "unknown; no media or info dictionary evaluated", } assumptions["reference_sources"].insert(0, "videoinfo-reference/sources.json") - base["verified_reference_facts"] = "videoinfo-reference/contract.json" + if profile not in SCAIL_LOAD_PROFILES: + base["verified_reference_facts"] = "videoinfo-reference/contract.json" if not any(n.get("type") == "VHS_VideoInfoLoaded" for n in source.get("nodes", [])): return { **base, @@ -659,26 +694,30 @@ def profile_attempt(source, profile): ) assumptions["missing_frontend_policy"] = ( "explicit_1.37.11_reference_assumption" - if profile in (*SETGET_PROFILES, *VIDEOINFO_PROFILES) + if profile in (*SETGET_PROFILES, *VIDEOINFO_PROFILES, *SCAIL_LOAD_PROFILES) else "explicit_media_reference_assumption" if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE, *CROP_SPLIT_PROFILES, *VHS_PROFILES) else "explicit_legacy_reference_assumption" if profile in (PROFILE, AUX_PROFILE, PRIMITIVE_PROFILE) else "requires_explicit_declaration" ) - if profile in (*VHS_PROFILES, *SETGET_PROFILES, *VIDEOINFO_PROFILES) and expected == "1.48.6": + if ( + profile in (*VHS_PROFILES, *SETGET_PROFILES, *VIDEOINFO_PROFILES, *SCAIL_LOAD_PROFILES) + and expected == "1.48.6" + ): assumptions["missing_frontend_policy"] = "requires_explicit_1.48.6" assumptions["missing_node_declarations"] = [ n["pointer"] for n in node_inventory( source, - include_aux=profile in (*CROP_SPLIT_PROFILES, *SETGET_PROFILES, *VIDEOINFO_PROFILES), + include_aux=profile + in (*CROP_SPLIT_PROFILES, *SETGET_PROFILES, *VIDEOINFO_PROFILES, *SCAIL_LOAD_PROFILES), ) if n["type"] not in ("Note", "MarkdownNote", "Reroute", "PrimitiveNode") and (n["provider"] is None or n["version"] is None) ] if ( - profile in (*VHS_PROFILES, *SETGET_PROFILES, *VIDEOINFO_PROFILES) + profile in (*VHS_PROFILES, *SETGET_PROFILES, *VIDEOINFO_PROFILES, *SCAIL_LOAD_PROFILES) and expected == "1.48.6" and declared_frontend is None ) or ( @@ -696,6 +735,7 @@ def profile_attempt(source, profile): *VHS_PROFILES, *SETGET_PROFILES, *VIDEOINFO_PROFILES, + *SCAIL_LOAD_PROFILES, ) ) ): @@ -721,7 +761,7 @@ def profile_attempt(source, profile): "unresolved_boundaries": result.unresolved_boundaries, **( {"virtual_resolutions": result.virtual_resolutions} - if profile in (*SETGET_PROFILES, *VIDEOINFO_PROFILES) + if profile in (*SETGET_PROFILES, *VIDEOINFO_PROFILES, *SCAIL_LOAD_PROFILES) else {} ), } @@ -737,7 +777,7 @@ def profile_attempt(source, profile): "candidate_prompt": result.prompt, **( {"virtual_resolutions": result.virtual_resolutions} - if profile in (*SETGET_PROFILES, *VIDEOINFO_PROFILES) + if profile in (*SETGET_PROFILES, *VIDEOINFO_PROFILES, *SCAIL_LOAD_PROFILES) else {} ), **( @@ -826,7 +866,12 @@ def audit_library(repo: Path, profiles=REFERENCE_PROFILES, *, baseline_profiles= gap_inventory = ( node_inventory(source, include_aux=True) if attempt["profile"] - in (*CROP_SPLIT_PROFILES, *SETGET_PROFILES, *VIDEOINFO_PROFILES) + in ( + *CROP_SPLIT_PROFILES, + *SETGET_PROFILES, + *VIDEOINFO_PROFILES, + *SCAIL_LOAD_PROFILES, + ) else inventory ) matches = [n for n in gap_inventory if n["node_id"] == issue.get("node_id")] @@ -852,7 +897,9 @@ def audit_library(repo: Path, profiles=REFERENCE_PROFILES, *, baseline_profiles= } if baseline_profiles is None: excluded_profiles = ( - VIDEOINFO_PROFILES + SCAIL_LOAD_PROFILES + if any(p in SCAIL_LOAD_PROFILES for p in profiles) + else VIDEOINFO_PROFILES if any(p in VIDEOINFO_PROFILES for p in profiles) else SETGET_PROFILES if any(p in SETGET_PROFILES for p in profiles) diff --git a/calliope-backend/src/calliope/comfyui/serialization_reference.py b/calliope-backend/src/calliope/comfyui/serialization_reference.py index 31f87a3d..e17c4ad6 100644 --- a/calliope-backend/src/calliope/comfyui/serialization_reference.py +++ b/calliope-backend/src/calliope/comfyui/serialization_reference.py @@ -14,7 +14,13 @@ import json import math from typing import Any -from .structure_reference import SETGET_PROFILES, VIDEOINFO_PROFILES +from .structure_reference import ( + SCAIL_LOAD_DELEGATES, + SCAIL_LOAD_PROFILES, + SETGET_PROFILES, + VIDEOINFO_DELEGATES, + VIDEOINFO_PROFILES, +) 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" @@ -102,8 +108,10 @@ def reference_definitions(profile: str = PROFILE) -> dict[str, Any]: "output": outputs, } + if profile in SCAIL_LOAD_PROFILES: + return reference_definitions(SCAIL_LOAD_DELEGATES[profile]) if profile in VIDEOINFO_PROFILES: - return {**reference_definitions(next(iter(SETGET_PROFILES))), **videoinfo_definitions()} + return {**reference_definitions(VIDEOINFO_DELEGATES[profile]), **videoinfo_definitions()} if profile in SETGET_PROFILES: return {**reference_definitions(PROFILE), **vhs_definitions()} if profile in VHS_PROFILES: @@ -182,10 +190,14 @@ 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 SCAIL_LOAD_PROFILES: + if node.get("type") == "VHS_LoadVideo": + return serialize_scail_load_node(node) + return serialize_reference_widgets(node, SCAIL_LOAD_DELEGATES[profile]) if profile in VIDEOINFO_PROFILES: if node.get("type") == "VHS_VideoInfoLoaded": return serialize_videoinfo_node(node) - return serialize_reference_widgets(node, next(iter(SETGET_PROFILES))) + return serialize_reference_widgets(node, VIDEOINFO_DELEGATES[profile]) if profile in SETGET_PROFILES: if node.get("type") in vhs_definitions(): return serialize_vhs_node(node) @@ -1411,10 +1423,14 @@ def serialize_vhs_node(node): is persisted by onSerialize despite options.serialize=false, but excluded from graphToPrompt. This does not assert target extensions or file access. """ + return _serialize_vhs_node(node) + + +def _serialize_vhs_node(node, *, load_commit=VHS_LOAD_COMMIT, linked_controls=()): ct, props = node.get("type"), node.get("properties") or {} if ct not in vhs_definitions(): raise ValueError("VHS固定参考未覆盖此类") - expected = VHS_COMBINE_COMMIT if ct == "VHS_VideoCombine" else VHS_LOAD_COMMIT + expected = VHS_COMBINE_COMMIT if ct == "VHS_VideoCombine" else load_commit if ( props.get("cnr_id") != "comfyui-videohelpersuite" or props.get("ver") != expected @@ -1519,7 +1535,8 @@ def serialize_vhs_node(node): if socket.get("widget") != ({"name": name} if name in layout else None): raise ValueError("VHS具名控件绑定不符") if socket.get("link") is not None and ( - name in ("vae", "meta_batch") or (name in layout and name != "frame_rate") + name in ("vae", "meta_batch") + or (name in layout and name not in ("frame_rate", *linked_controls)) ): raise ValueError("VHS控件转连线/VAE/批次模式未覆盖") outputs = node.get("outputs", []) @@ -1619,3 +1636,81 @@ def serialize_videoinfo_node(node): ): raise ValueError("VideoInfoLoaded原输出槽索引不符") return {} + + +SCAIL_LOAD_COMMIT = "8e4d79471bf1952154768e8435a9300077b534fa" +SCAIL_LOAD_NAMES = ("IMAGE", "frame_count", "audio", "video_info") + + +def serialize_scail_load_node(node): + """Pinned no-UE AnimateDiff saved state, before queue hooks. + + Construction runs addLoadCommon over every widget, including default + AnimateDiff, before onConfigure. Its format callback installs step8/reset512 + while dimensions are zero (early return). Restore then uses those options; + saved AnimateDiff preserves multiples of eight, including zero. + No media, dynamic file list, preview callback, VAE or batch is evaluated. + Sources: scail-load-reference/{sources,contract}.json. + """ + props = node.get("properties") or {} + if ( + node.get("type") != "VHS_LoadVideo" + or props.get("cnr_id") != "comfyui-videohelpersuite" + or props.get("ver") != SCAIL_LOAD_COMMIT + or props.get("aux_id") is not None + or type(node.get("mode", 0)) is not int + or node.get("mode", 0) != 0 + ): + raise ValueError("Scail加载器提供方/完整提交/正常模式不符") + for container in (node, props): + if any( + k in container + for k in ( + "widgets", + "widgets_values_named", + "serializeValue", + "comfyDynamic", + "getInputLink", + "resolveInput", + "resolveOutput", + "onExecute", + "isVirtualNode", + "applyToGraph", + "onConfigure", + "onSerialize", + "onNodeCreated", + ) + ): + raise ValueError("Scail加载器自定义覆盖或额外具名镜像未知") + ue = props.get("ue_properties") or {} + if type(ue) is not dict or any( + container.get(k) + for container in (props, ue, node) + for k in ("widget_ue_connectable", "input_ue_unconnectable") + ): + raise ValueError("Scail加载器UE绑定实现未固定,不能删除绑定或假设无扩展") + values = node.get("widgets_values") + allowed = set(_VHS_LOAD) | {"videopreview", "choose video to upload"} + if type(values) is not dict or not set(_VHS_LOAD) <= set(values) <= allowed: + raise ValueError("Scail加载器仅覆盖完整具名对象,不迁移数组/补默认/忽略额外字段") + if values["format"] != "AnimateDiff": + raise ValueError("Scail加载器仅覆盖固定AnimateDiff恢复分支") + if any(type(values[k]) is not int or values[k] % 8 for k in ("custom_width", "custom_height")): + raise ValueError("Scail固定AnimateDiff构造先设置step8;尺寸须为恢复不变点") + # The shared validator receives explicit identity and linked-control domain; + # old callers keep their old commit and connection policy unchanged. + for socket in node.get("inputs", []): + if socket.get("name") in ("frame_load_cap", "skip_first_frames"): + if socket.get("link") is not None and ( + type(socket["link"]) is not int or socket["link"] < 0 + ): + raise ValueError("Scail cap/skip连线ID不符") + result = _serialize_vhs_node( + node, + load_commit=SCAIL_LOAD_COMMIT, + linked_controls=("frame_load_cap", "skip_first_frames"), + ) + outputs = node.get("outputs", []) + if [s.get("name") for s in outputs] != list(SCAIL_LOAD_NAMES): + raise ValueError("Scail加载器四个原出口名/顺序不符") + return result diff --git a/calliope-backend/src/calliope/comfyui/structure_reference.py b/calliope-backend/src/calliope/comfyui/structure_reference.py index de98d038..98980806 100644 --- a/calliope-backend/src/calliope/comfyui/structure_reference.py +++ b/calliope-backend/src/calliope/comfyui/structure_reference.py @@ -23,6 +23,22 @@ VIDEOINFO_PROFILES = { for v in ("1.37.11", "1.48.6") } +VIDEOINFO_DELEGATES = { + profile: f"comfy-frontend-{v}-kj-setget-ab72eda7-vhs-reference" + for profile, v in VIDEOINFO_PROFILES.items() +} + +# Explicit composition keys; frontend and delegate identities never depend on order. +SCAIL_LOAD_PROFILES = { + f"comfy-frontend-{v}-scail-load-8e4d7947-info-537f3a02-kj-ab72eda7-reference": v + for v in ("1.37.11", "1.48.6") +} +SCAIL_LOAD_DELEGATES = { + profile: f"comfy-frontend-{v}-videoinfo-537f3a02-kj-ab72eda7-vhs-core-reference" + for profile, v in SCAIL_LOAD_PROFILES.items() +} + + STRUCTURE_PROFILES = { f"comfy-frontend-{version}-structure-reference": version for version in ("1.48.7", "1.53.6", "1.48.6") diff --git a/calliope-backend/src/calliope/comfyui/ui2api.py b/calliope-backend/src/calliope/comfyui/ui2api.py index a7a0eebc..3a1bed02 100644 --- a/calliope-backend/src/calliope/comfyui/ui2api.py +++ b/calliope-backend/src/calliope/comfyui/ui2api.py @@ -32,10 +32,12 @@ from .serialization_reference import ( serialize_case04_node, serialize_promoted_node, serialize_reference_widgets, + serialize_scail_load_node, validate_reroute, ) from .structure_reference import ( PROMOTED_PROFILES, + SCAIL_LOAD_PROFILES, SETGET_PROFILES, STRUCTURE_PROFILES, VIDEOINFO_PROFILES, @@ -77,6 +79,7 @@ def convert_reference(source: Any, profile: str = PROFILE) -> Conversion: *VHS_PROFILES, *SETGET_PROFILES, *VIDEOINFO_PROFILES, + *SCAIL_LOAD_PROFILES, AUX_PROFILE, PRIMITIVE_PROFILE, PREVIEW_PROFILE, @@ -93,12 +96,34 @@ def convert_reference(source: Any, profile: str = PROFILE) -> Conversion: True, ) try: - if profile in (*SETGET_PROFILES, *VIDEOINFO_PROFILES): - expected = {**SETGET_PROFILES, **VIDEOINFO_PROFILES}[profile] + if profile in (*SETGET_PROFILES, *VIDEOINFO_PROFILES, *SCAIL_LOAD_PROFILES): + expected = {**SETGET_PROFILES, **VIDEOINFO_PROFILES, **SCAIL_LOAD_PROFILES}[profile] declared = (source.get("extra") or {}).get("frontendVersion") if declared != expected and not (declared is None and expected == "1.37.11"): raise ValueError("Set/Get前端声明不匹配;缺失仅显式选择1.37.11") + loader_issues = [] + if profile in SCAIL_LOAD_PROFILES: + for i, node in enumerate(source["nodes"]): + if node.get("type") == "VHS_LoadVideo": + try: + serialize_scail_load_node(node) + except (ValueError, TypeError, KeyError, AttributeError) as exc: + loader_issues.append( + { + "code": "scail_load_reference_invalid", + "node_id": str(node.get("id", "")), + "pointer": f"/nodes/{i}", + "message": str(exc), + } + ) structure = project_reference_setget(source) + if loader_issues: + return Conversion( + None, + loader_issues + structure.issues, + True, + virtual_resolutions=structure.resolved, + ) if structure.graph is None: return Conversion( None, structure.issues, True, virtual_resolutions=structure.resolved @@ -259,6 +284,7 @@ def _convert( **VHS_PROFILES, **SETGET_PROFILES, **VIDEOINFO_PROFILES, + **SCAIL_LOAD_PROFILES, }.get(reference_profile, "1.37.11") if frontend_version is not None and frontend_version != expected_version: fail("reference_frontend_mismatch", "源图声明的前端版本与固定参考不一致") diff --git a/calliope-backend/tests/test_audio_separation_reference.py b/calliope-backend/tests/test_audio_separation_reference.py index 386638cb..edfe28e9 100644 --- a/calliope-backend/tests/test_audio_separation_reference.py +++ b/calliope-backend/tests/test_audio_separation_reference.py @@ -368,6 +368,7 @@ def test_library_actual_delta_keeps_every_old_attempt_and_all_six_golden_compari *audit.VHS_PROFILES, *audit.SETGET_PROFILES, *audit.VIDEOINFO_PROFILES, + *audit.SCAIL_LOAD_PROFILES, ) ) baseline = tuple(p for p in profiles if p != SEPARATION_PROFILE) diff --git a/calliope-backend/tests/test_crop_split_reference.py b/calliope-backend/tests/test_crop_split_reference.py index f1a8a8d2..b8cf214c 100644 --- a/calliope-backend/tests/test_crop_split_reference.py +++ b/calliope-backend/tests/test_crop_split_reference.py @@ -354,7 +354,13 @@ def test_all_old_fourteen_profiles_attempts_gaps_and_six_differences_unchanged() historical_profiles = tuple( p for p in audit.REFERENCE_PROFILES - if p not in (*VHS_PROFILES, *audit.SETGET_PROFILES, *audit.VIDEOINFO_PROFILES) + if p + not in ( + *VHS_PROFILES, + *audit.SETGET_PROFILES, + *audit.VIDEOINFO_PROFILES, + *audit.SCAIL_LOAD_PROFILES, + ) ) profiles = tuple(p for p in historical_profiles if p not in CROP_SPLIT_PROFILES) historical = json.loads((REPO / "docs/hel-892/separation-evidence/library.json").read_bytes()) diff --git a/calliope-backend/tests/test_scail_load_reference.py b/calliope-backend/tests/test_scail_load_reference.py new file mode 100644 index 00000000..31def863 --- /dev/null +++ b/calliope-backend/tests/test_scail_load_reference.py @@ -0,0 +1,303 @@ +"""Synthetic saved-state transformations only; no upstream/media/history execution.""" + +import ast +import copy +import json +from pathlib import Path + +import pytest +from scripts import audit_reference_conversion as audit +from scripts.verify_frontend_sources import verify + +from calliope.comfyui.serialization_reference import ( + SCAIL_LOAD_COMMIT, + serialize_scail_load_node, +) +from calliope.comfyui.structure_reference import SCAIL_LOAD_PROFILES +from calliope.comfyui.ui2api import convert, convert_reference +from tests.test_setget_reference import connect +from tests.test_videoinfo_reference import graph as info_graph + +REPO = Path(__file__).resolve().parents[2] +ROOT = REPO / "docs/hel-892/scail-load-reference" +PROFILE = "comfy-frontend-1.37.11-scail-load-8e4d7947-info-537f3a02-kj-ab72eda7-reference" +ACTION = "example_ComfyUI_workflows/6-动作迁移/Wan2.1_Scail-2_动作迁移_WanAnimatePlus_v4.2.json" +ROLE = "example_ComfyUI_workflows/6-动作迁移/Wan2.1_Scail-2_角色迁移_WanAnimatePlus_v4.2.json" + + +def loader(): + node = next(n for n in json.loads((REPO / ACTION).read_bytes())["nodes"] if n["id"] == 573) + # Explicit synthetic no-UE premise, NEVER a conversion of the real graph. + node["properties"].pop("widget_ue_connectable") + node["properties"].pop("ue_properties") + node["id"] = 17 + for s in node["inputs"]: + s["link"] = None + for s in node["outputs"]: + s["links"] = [] + return node + + +def graph(): + g = info_graph(0) + old = g["nodes"][0] + new = loader() + for target, source in zip(new["outputs"], old["outputs"]): + target["links"] = source.get("links", []) + g["nodes"][0] = new + supply = loader() + supply["id"] = 900 + supply["widgets_values"]["video"] = "synthetic-other.mp4" + g["nodes"].append(supply) + connect(g, 30, 900, 1, 17, 6, "INT") + connect(g, 31, 900, 1, 17, 7, "INT") + return g + + +@pytest.mark.parametrize("profile", SCAIL_LOAD_PROFILES) +@pytest.mark.parametrize("rate", [0, 8, 16, 16.25, 60]) +def test_whole_graph_nonzero_info_slot_and_external_cap_skip(profile, rate): + g = graph() + g["extra"] = {"frontendVersion": SCAIL_LOAD_PROFILES[profile]} + g["nodes"][0]["widgets_values"].update(force_rate=rate, frame_load_cap=81, skip_first_frames=9) + original = copy.deepcopy(g) + result = convert_reference(g, profile) + assert result.prompt is not None, result.issues + assert result.prompt["17"]["inputs"]["force_rate"] == rate + assert result.prompt["17"]["inputs"]["frame_load_cap"] == ["900", 1] + assert result.prompt["17"]["inputs"]["skip_first_frames"] == ["900", 1] + assert result.prompt["546"]["inputs"]["video_info"] == ["17", 3] + assert result.prompt["12"]["inputs"]["frame_rate"] == ["546", 0] + assert result.reference_only and g == original and convert(g).prompt is None + assert "videopreview" not in result.prompt["17"]["inputs"] + g["nodes"][0]["widgets_values"]["videopreview"]["params"]["force_rate"] = 999 + assert convert_reference(g, profile).prompt == result.prompt + g["nodes"][-1]["widgets_values"]["video"] = "changed.mp4" + assert convert_reference(g, profile).prompt["900"]["inputs"]["video"] == "changed.mp4" + # Change just cap's upstream instance. Skip must retain its original source. + other = loader() + other["id"] = 901 + other["outputs"][1]["links"] = [30] + g["nodes"].append(other) + g["nodes"][-2]["outputs"][1]["links"].remove(30) + next(e for e in g["links"] if e[0] == 30)[1] = 901 + prompt = convert_reference(g, profile).prompt + assert prompt["17"]["inputs"]["frame_load_cap"] == ["901", 1] + assert prompt["17"]["inputs"]["skip_first_frames"] == ["900", 1] + g["nodes"][0]["widgets_values"]["video"] = "changed-instance17.mp4" + assert convert_reference(g, profile).prompt["17"]["inputs"]["video"] == "changed-instance17.mp4" + + +@pytest.mark.parametrize( + "mutation", + [ + "old_version", + "release", + "provider", + "aux", + "mode", + "bool_mode", + "array", + "missing", + "extra", + "mirror", + "width10", + "height513", + "dim_bool", + "format", + "vae", + "batch", + "force_link", + "nan", + "bool_rate", + "skip_bool", + "nth_zero", + "slot_type", + "slot_name", + "slot_bool", + "slot_extra", + "bad_reverse", + "bad_link_type", + "cap_bool_link", + "ue_top", + "ue_nested", + "ue_node", + "ue_bad", + "override", + "literal_aux", + "frontend", + "nested", + ], +) +def test_mutations_fail_closed_and_precise_new_loader_pointer(mutation): + g = graph() + n, vals = g["nodes"][0], g["nodes"][0]["widgets_values"] + if mutation == "old_version": + n["properties"]["ver"] = "8550981384301e9bc5bfea83e5c2c75258102593" + elif mutation == "release": + n["properties"]["ver"] = "1.7.9" + elif mutation == "provider": + n["properties"]["cnr_id"] = "other" + elif mutation == "aux": + n["properties"]["aux_id"] = "VHS_LoadVideo" + elif mutation == "mode": + n["mode"] = 4 + elif mutation == "bool_mode": + n["mode"] = False + elif mutation == "array": + n["widgets_values"] = list(vals.values()) + elif mutation == "missing": + vals.pop("format") + elif mutation == "extra": + vals["unknown"] = 1 + elif mutation == "mirror": + n["widgets_values_named"] = copy.deepcopy(vals) + elif mutation == "width10": + vals["custom_width"] = 10 + elif mutation == "height513": + vals["custom_height"] = 513 + elif mutation == "dim_bool": + vals["custom_width"] = False + elif mutation == "format": + vals["format"] = "Wan" + elif mutation == "vae": + n["inputs"][1]["link"] = 60 + elif mutation == "batch": + n["inputs"][0]["link"] = 60 + elif mutation == "force_link": + n["inputs"][3]["link"] = 60 + elif mutation == "nan": + vals["force_rate"] = float("nan") + elif mutation == "bool_rate": + vals["force_rate"] = True + elif mutation == "skip_bool": + vals["skip_first_frames"] = False + elif mutation == "nth_zero": + vals["select_every_nth"] = 0 + elif mutation == "slot_type": + n["outputs"][3]["type"] = "INT" + elif mutation == "slot_name": + n["outputs"][3]["name"] = "frame_count" + elif mutation == "slot_bool": + n["outputs"][3]["slot_index"] = True + elif mutation == "slot_extra": + n["outputs"].append(copy.deepcopy(n["outputs"][0])) + elif mutation == "bad_reverse": + g["nodes"][-1]["outputs"][1]["links"].remove(30) + elif mutation == "bad_link_type": + g["links"][-1][5] = "FLOAT" + elif mutation == "cap_bool_link": + n["inputs"][6]["link"] = True + elif mutation == "ue_top": + n["properties"]["widget_ue_connectable"] = {"custom_width": True} + elif mutation == "ue_nested": + n["properties"]["ue_properties"] = {"widget_ue_connectable": {"custom_height": True}} + elif mutation == "ue_node": + n["widget_ue_connectable"] = {"custom_width": True} + elif mutation == "ue_bad": + n["properties"]["ue_properties"] = [1] + elif mutation == "override": + n["properties"]["onConfigure"] = "custom" + elif mutation == "literal_aux": + g["nodes"][3]["properties"]["aux_id"] = "SetNode" + elif mutation == "frontend": + g["extra"] = {"frontendVersion": "1.48.7"} + elif mutation == "nested": + g["definitions"] = {"subgraphs": [{"id": "unknown"}]} + result = convert_reference(g, PROFILE) + assert result.prompt is None + if mutation not in ("bad_reverse", "bad_link_type", "literal_aux", "frontend", "nested"): + assert any( + x["code"] == "scail_load_reference_invalid" and x["pointer"] == "/nodes/0" + for x in result.issues + ), result.issues + + +@pytest.mark.parametrize("path,nid", [(ACTION, 573), (ROLE, 112)]) +def test_actual_graph_ue_and_literal_provenance_remain_closed(path, nid): + g = json.loads((REPO / path).read_bytes()) + original = copy.deepcopy(g) + result = convert_reference(g, PROFILE) + assert result.prompt is None and g == original + assert any( + i["code"] == "scail_load_reference_invalid" + and i["node_id"] == str(nid) + and "UE" in i["message"] + for i in result.issues + ) + assert any(i["code"] == "setget_reference_invalid" for i in result.issues) + assert audit.profile_attempt(g, PROFILE)["status"] == "rejected" + + +def test_exact_historical_emission_is_not_user_provenance(): + assert verify(ROOT)["sources_verified"] + old = (ROOT / "kj-276955e45fa48c794b47bf49dbc22f2d955d76a8__setgetnodes.js").read_text() + new = (ROOT / "kj-e56b3061ed49251a7b8a5450a2e18295548ea7a1__setgetnodes.js").read_text() + assert 'this.properties["aux_id"] = "SetNode"' in old + assert 'this.properties["aux_id"] = "GetNode"' in old + assert new.count('this.properties["aux_id"] = "kijai/ComfyUI-KJNodes"') == 2 + assert 'this.properties["aux_id"] = "SetNode"' not in new + tree = ast.parse((ROOT / "videohelpersuite__load_video_nodes.py").read_text()) + cls = next(n for n in tree.body if isinstance(n, ast.ClassDef) and n.name == "LoadVideoUpload") + assert cls.lineno > 0 + assert '"VHS_LoadVideo": LoadVideoUpload,' in (ROOT / "videohelpersuite__nodes.py").read_text() + assert serialize_scail_load_node(loader())["custom_width"] == 0 + assert len(audit.REFERENCE_PROFILES) == 24 + + +def test_named_map_order_external_removal_and_old_contracts(): + g = graph() + expected = convert_reference(g, PROFILE).prompt + n = g["nodes"][0] + n["widgets_values"] = dict(reversed(list(n["widgets_values"].items()))) + assert convert_reference(g, PROFILE).prompt == expected + for lid, slot, value in [(30, 6, 42), (31, 7, 13)]: + g["links"] = [e for e in g["links"] if e[0] != lid] + g["nodes"][-1]["outputs"][1]["links"].remove(lid) + n["inputs"][slot]["link"] = None + n["widgets_values"][n["inputs"][slot]["name"]] = value + result = convert_reference(g, PROFILE) + assert result.prompt["17"]["inputs"]["frame_load_cap"] == 42 + assert result.prompt["17"]["inputs"]["skip_first_frames"] == 13 + for old in audit.REFERENCE_PROFILES[:22]: + assert convert_reference(g, old).prompt is None + + +def test_frontend_requires_explicit_1486_and_fixed_restore_order_evidence(): + p1486 = "comfy-frontend-1.48.6-scail-load-8e4d7947-info-537f3a02-kj-ab72eda7-reference" + assert convert_reference(graph(), p1486).prompt is None + assert audit.profile_attempt(graph(), p1486)["status"] == "not_applicable" + js = (ROOT / "web__js__VHS.core.js").read_text() + assert "w.value = widgetDict[w.name];" in js + assert "w.callback?.(w.value)" in js + assert "if (v == 0)" in js + assert "const s = this.options.step" in js + assert "Math.round((v - sh) / s) * s + sh" in js + py = (ROOT / "videohelpersuite__load_video_nodes.py").read_text() + cls = py[py.index("class LoadVideoUpload:") : py.index("class LoadVideoPath:")] + assert cls.index('"custom_width"') < cls.index('"format"') + assert "step" not in next(line for line in cls.splitlines() if '"custom_width"' in line) + assert '"format": get_load_formats()' in cls + assert SCAIL_LOAD_COMMIT in json.dumps(json.loads((ROOT / "sources.json").read_text())) + + +@pytest.mark.parametrize("width,height", [(0, 0), (512, 0), (0, 768), (384, 640), (8192, 8)]) +def test_proven_construction_before_restore_dimension_fixed_points(width, height): + g = graph() + g["nodes"][0]["widgets_values"].update(custom_width=width, custom_height=height) + result = convert_reference(g, PROFILE) + assert result.prompt is not None, result.issues + assert result.prompt["17"]["inputs"]["custom_width"] == width + assert result.prompt["17"]["inputs"]["custom_height"] == height + js = (ROOT / "web__js__VHS.core.js").read_text() + start = js.index("function addLoadCommon") + end = js.index("function path_stem", start) + construction = js[start:end] + assert construction.index("initializeLoadFormat(nodeType, nodeData)") < construction.index( + "for (let widget of this.widgets)" + ) + assert "widget.callback?.(widget.value)" in construction + assert ( + "'AnimateDiff': {'target_rate': 8, 'dim': (8,0,512,512)}" + in (ROOT / "videohelpersuite__load_video_nodes.py").read_text() + ) diff --git a/calliope-backend/tests/test_setget_reference.py b/calliope-backend/tests/test_setget_reference.py index a28732b4..e8534dc4 100644 --- a/calliope-backend/tests/test_setget_reference.py +++ b/calliope-backend/tests/test_setget_reference.py @@ -330,7 +330,16 @@ def test_wrong_frontend_missing_policy_and_profile_inventory(): g = synthetic() g["extra"] = {"frontendVersion": v} assert convert_reference(g, PROFILE).prompt is None - assert len([p for p in audit.REFERENCE_PROFILES if p not in audit.VIDEOINFO_PROFILES]) == 20 + assert ( + len( + [ + p + for p in audit.REFERENCE_PROFILES + if p not in (*audit.VIDEOINFO_PROFILES, *audit.SCAIL_LOAD_PROFILES) + ] + ) + == 20 + ) @pytest.mark.parametrize("profile", SETGET_PROFILES) @@ -407,7 +416,7 @@ def test_historical_18_profiles_attempts_gaps_and_six_comparisons_unchanged(): baseline = tuple( p for p in audit.REFERENCE_PROFILES - if p not in (*SETGET_PROFILES, *audit.VIDEOINFO_PROFILES) + if p not in (*SETGET_PROFILES, *audit.VIDEOINFO_PROFILES, *audit.SCAIL_LOAD_PROFILES) ) now = audit.audit_library(REPO, baseline_profiles=baseline) actual_old = audit.audit_library(REPO, baseline) diff --git a/calliope-backend/tests/test_vhs_reference.py b/calliope-backend/tests/test_vhs_reference.py index 91453404..ff5865ce 100644 --- a/calliope-backend/tests/test_vhs_reference.py +++ b/calliope-backend/tests/test_vhs_reference.py @@ -289,7 +289,7 @@ def test_old_sixteen_attempts_gaps_candidates_and_six_comparisons_protected(): historical_profiles = tuple( p for p in audit.REFERENCE_PROFILES - if p not in (*audit.SETGET_PROFILES, *audit.VIDEOINFO_PROFILES) + if p not in (*audit.SETGET_PROFILES, *audit.VIDEOINFO_PROFILES, *audit.SCAIL_LOAD_PROFILES) ) profiles = tuple(p for p in historical_profiles if p not in VHS_PROFILES) baseline = audit.audit_library(REPO, profiles) diff --git a/calliope-backend/tests/test_videoinfo_reference.py b/calliope-backend/tests/test_videoinfo_reference.py index 2f2057e6..5107fd95 100644 --- a/calliope-backend/tests/test_videoinfo_reference.py +++ b/calliope-backend/tests/test_videoinfo_reference.py @@ -275,7 +275,7 @@ def test_real_entities_strict_source_schema_and_old_profiles_stay_frozen(): result = convert_reference(source, PROFILE) assert result.prompt is None and result.issues assert all(a["status"] != "complete_reference_candidate" for a in row["attempts"]) - assert len(audit.REFERENCE_PROFILES) == 22 + assert len([p for p in audit.REFERENCE_PROFILES if p not in audit.SCAIL_LOAD_PROFILES]) == 22 assert tuple(audit.REFERENCE_PROFILES[:20]) == tuple(old["profiles"]) diff --git a/docs/hel-892/scail-load-evidence/recompute.py b/docs/hel-892/scail-load-evidence/recompute.py new file mode 100644 index 00000000..3bea9758 --- /dev/null +++ b/docs/hel-892/scail-load-evidence/recompute.py @@ -0,0 +1,394 @@ +"""Recompute Scail loader evidence and protections without services or upstream execution.""" + +from __future__ import annotations + +import argparse +import hashlib +import json +import sqlite3 +import subprocess +import sys +import tarfile +import zipfile +from collections import Counter +from pathlib import Path + +BASE = "821e33dd87e28d8ede95dc08e62c87ba64a07815" + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--repo", type=Path, required=True) + parser.add_argument("--db", type=Path, required=True) + parser.add_argument("--documents", type=Path, required=True) + args = parser.parse_args() + repo = args.repo.resolve() + sys.path.insert(0, str(repo / "calliope-backend")) + from calliope.comfyui.structure_reference import ( + SCAIL_LOAD_PROFILES, + ) + from scripts import audit_reference_conversion as audit + from scripts.audit_library_documents import audit as audit_docs + from scripts.verify_frontend_sources import verify + + out = repo / "docs/hel-892/scail-load-evidence" + + def write(name, value): + (out / name).write_text(json.dumps(value, ensure_ascii=False, indent=2) + "\n") + + old = json.loads( + (repo / "docs/hel-892/videoinfo-evidence/library.json").read_bytes() + ) + profiles = tuple(old["profiles"]) + assert len(profiles) == 22 + assert profiles == tuple( + p for p in audit.REFERENCE_PROFILES if p not in SCAIL_LOAD_PROFILES + ) + before = audit.audit_library(repo, profiles) + now = audit.audit_library(repo, baseline_profiles=profiles) + write("library.json", now) + for a, b, c in zip(old["cases"], before["cases"], now["cases"]): + assert a["source_path"] == b["source_path"] == c["source_path"] + assert a["attempts"] == b["attempts"] == c["attempts"][:22] + assert a.get("comparisons") == b.get("comparisons") == c.get("comparisons") + assert a["candidate_hashes"] == c["candidate_hashes"] + assert old["gap_groups"] == before["gap_groups"] + six = audit.audit(repo, "case04-batch-reference") + assert six == json.loads( + (repo / "docs/hel-892/media-evidence/protected-six-cases.json").read_bytes() + ) + write( + "previous-protection.json", + { + "baseline_profiles": profiles, + "old_attempts_identical": True, + "old_gaps_identical": True, + "six_companion_differences_identical": True, + "old_candidate_hashes_identical": True, + }, + ) + + def groups(report): + return { + tuple( + g[k] + for k in ("type", "provider", "version", "profile", "code", "rule_gap") + ): Counter( + (o["source_path"], o["node_pointer"], o["node_id"]) + for o in g["occurrences"] + ) + for g in report["gap_groups"] + } + + def stats(report): + gs = groups(report) + return { + "groups": len(gs), + "raw_occurrences": sum(sum(c.values()) for c in gs.values()), + "unique_occurrences_per_group": sum(len(c) for c in gs.values()), + "unique_nodes": len({o for c in gs.values() for o in c}), + "unique_paths": len({o[0] for c in gs.values() for o in c}), + } + + def diffrows(a, b): + return [ + { + "key": list(k), + "occurrences": [ + { + "source_path": o[0], + "node_pointer": o[1], + "node_id": o[2], + "count": n, + } + for o, n in sorted((v - b.get(k, Counter())).items(), key=str) + ], + } + for k, v in sorted(a.items(), key=str) + if v - b.get(k, Counter()) + ] + + def unavailable(report): + return sorted( + r["source_path"] + for r in report["cases"] + if all(a["status"] == "not_applicable" for a in r["attempts"]) + ) + + assert unavailable(before) == unavailable(now) + ga, gb = groups(before), groups(now) + added, removed = diffrows(gb, ga), diffrows(ga, gb) + write( + "coverage-delta.json", + { + "baseline_profiles": profiles, + "baseline": stats(before), + "current": stats(now), + "key_fields": [ + "type", + "provider", + "version", + "profile", + "code", + "rule_gap", + ], + "occurrence_key": ["source_path", "node_pointer", "node_id"], + "added_groups": added, + "removed_groups": removed, + "added_occurrences": sum( + o["count"] for g in added for o in g["occurrences"] + ), + "removed_occurrences": sum( + o["count"] for g in removed for o in g["occurrences"] + ), + "new_complete_paths": now["coverage_delta"]["new_complete_paths"], + "complete_paths": now["coverage_delta"]["current_complete_paths"], + "closed_paths": [ + r["source_path"] for r in now["cases"] if r["status"] == "blocked" + ], + "unavailable_frontend_paths_unchanged": unavailable(now), + "attempt_counts": dict( + Counter(a["status"] for r in now["cases"] for a in r["attempts"]) + ), + "conflicts": sum(r["status"] == "candidate_conflict" for r in now["cases"]), + }, + ) + + from calliope.comfyui.serialization_reference import serialize_scail_load_node + from calliope.comfyui.ui2api import convert_reference + + inventory, chains = [], [] + profile = ( + "comfy-frontend-1.37.11-scail-load-8e4d7947-info-537f3a02-kj-ab72eda7-reference" + ) + for row in now["cases"]: + source = json.loads((repo / row["source_path"]).read_bytes()) + for n in audit.node_inventory(source, include_aux=True): + if n["type"] == "VHS_LoadVideo": + inventory.append({"source_path": row["source_path"], **n}) + for old_chain in json.loads( + (repo / "docs/hel-892/videoinfo-evidence/scail-endpoints.json").read_bytes() + ): + source = json.loads((repo / old_chain["source_path"]).read_bytes()) + nid = old_chain["upstream"]["node_id"] + ni, node = next((i, n) for i, n in enumerate(source["nodes"]) if n["id"] == nid) + try: + serialize_scail_load_node(node) + except ValueError as exc: + rejection = str(exc) + else: + raise AssertionError("Real UE-bound loader must remain rejected") + result = convert_reference(source, profile) + assert result.prompt is None and "UE" in rejection + edges = [] + nodes = {n["id"]: (i, n) for i, n in enumerate(source["nodes"])} + for li, edge in enumerate(source["links"]): + if nid not in (edge[1], edge[3]): + continue + ai, a = nodes[edge[1]] + bi, b = nodes[edge[3]] + assert ( + a["outputs"][edge[2]]["type"] == edge[5] == b["inputs"][edge[4]]["type"] + ) + assert a["outputs"][edge[2]]["links"].count(edge[0]) == 1 + assert b["inputs"][edge[4]]["link"] == edge[0] + edges.append( + { + "pointer": f"/links/{li}", + "edge": edge, + "origin_pointer": f"/nodes/{ai}/outputs/{edge[2]}", + "target_pointer": f"/nodes/{bi}/inputs/{edge[4]}", + } + ) + aliases = [ + {"pointer": f"/nodes/{i}", "node": n} + for i, n in enumerate(source["nodes"]) + if n["type"] in ("SetNode", "GetNode") + and n["id"] + in [int(h["node_id"]) for h in old_chain["downstream_alias_hops"]] + ] + chains.append( + { + "source_path": old_chain["source_path"], + "source_sha256": old_chain["source_sha256"], + "loader_pointer": f"/nodes/{ni}", + "loader": node, + "checked_physical_edges": edges, + "loader_schema": "fixed registration/schema/no-VAE output slots proven; UE-bound construction not proven", + "loader_rejection": rejection, + "info_endpoint": old_chain["node_pointer"], + "info_schema": "537f3a02 exact five slots proven; loaded_fps value unknown", + "aliases": aliases, + "alias_history": "KJ historical emission proven; user provenance unproven, old rejection retained", + "saved_combine_fps": old_chain["saved_frame_rate"], + "saved_force_rate": node["widgets_values"]["force_rate"], + "fps_value": "unknown; saved30 and force_rate0/16 do not evaluate media info", + "prompt": None, + "comparison_status": "comparison_unavailable", + "whole_graph_issues": result.issues, + } + ) + write("scail-loaders.json", chains) + write("inventory.json", inventory) + + dirs = [ + "serialization-evidence", + "structure-reference", + "controlnet-reference", + "promoted-reference", + "case04-reference", + "media-reference", + "separation-reference", + "crop-split-reference", + "vhs-reference", + "setget-reference", + "videoinfo-reference", + "scail-load-reference", + ] + entries = [] + counts = [] + for name in dirs: + directory = repo / "docs/hel-892" / name + verify(directory) + rows = json.loads((directory / "sources.json").read_bytes())["sources"] + for entry in rows: + lines = (directory / entry["local_file"]).read_text().splitlines() + locations = entry.get("rule_locations", {}) + for lo, hi in ( + locations.values() if isinstance(locations, dict) else locations + ): + assert 1 <= lo <= hi <= len(lines) + counts.append( + { + "manifest": name, + "entries": len(rows), + "unique_ids": len({r["id"] for r in rows}), + } + ) + entries.extend(rows) + write( + "cached-sources-check.json", + { + "manifests": counts, + "entries": len(entries), + "unique_ids_summed_per_manifest": sum(c["unique_ids"] for c in counts), + "global_distinct_id_strings": len({r["id"] for r in entries}), + "unique_url_and_hash": len({(r["raw_url"], r["sha256"]) for r in entries}), + "note": "ID counts are strings; URL+SHA256 is separately deduplicated; repeated frontend originals retained", + }, + ) + + originals = json.loads( + (repo / "docs/hel-892/media-evidence/original-bytes.json").read_bytes() + )["files"] + for row in originals: + raw = (repo / row["path"]).read_bytes() + assert raw == subprocess.check_output( + ["git", "show", f"{BASE}:{row['path']}"], cwd=repo + ) + assert len(originals) == 163 + write( + "original-bytes.json", + {"base": BASE, "count": 163, "all_unchanged": True, "files": originals}, + ) + production = json.loads( + (repo / "docs/hel-892/setget-evidence/production-protection.json").read_bytes() + )["files"] + for row in production: + raw = (repo / row["path"]).read_bytes() + assert raw == subprocess.check_output( + ["git", "show", f"{BASE}:{row['path']}"], cwd=repo + ) + assert hashlib.sha256(raw).hexdigest() == row["sha256"] + write("production-protection.json", {"base": BASE, "files": production}) + db = sqlite3.connect(args.db) + db.row_factory = sqlite3.Row + rows = db.execute( + "SELECT * FROM workflows WHERE source_repo_path IS NOT NULL" + ).fetchall() + assert len(rows) == 155 + assert not any( + r["is_enabled"] or r["doc_completed_at"] or r["exec_verified_at"] for r in rows + ) + issues = Counter(i["code"] for r in rows for i in json.loads(r["import_issues"])) + companion_values = sum( + p.get("value_origin") == "supplied_api_companion" + for r in rows + for p in json.loads(r["doc_json"])["params"] + ) + assert ( + companion_values == 294 + and issues["companion_unverified"] == 6 + and issues["environment_unchecked"] == 16 + ) + write( + "isolation.json", + { + "states": dict(Counter(r["import_state"] for r in rows)), + "count": 155, + "enabled_or_completed_or_executed": 0, + "issue_counts": dict(issues), + "companion_named_values": companion_values, + "reference_candidates_written_to_db": False, + "user_whole_row_protection": "executed affected tests", + }, + ) + db.close() + report = audit_docs(repo, args.documents.resolve()) + summary = {k: v for k, v in report.items() if k != "files"} + assert ( + summary["named_values_preserved"] == 1217 + and summary["unnamed_widget_nodes"] == 3660 + ) + assert summary["full_documents_completed"] == 0 and summary["real_executions"] == 0 + write("document-audit-summary.json", summary) + packages = [] + with ( + zipfile.ZipFile(next((repo / "calliope-backend/dist").glob("*.whl"))) as wh, + tarfile.open(next((repo / "calliope-backend/dist").glob("*.tar.gz"))) as sd, + ): + for name in [ + "structure_reference.py", + "serialization_reference.py", + "ui2api.py", + "protocol_references.json", + "source_reviews.json", + "delivery_scope.py", + "delivery_scope.json", + ]: + p = f"calliope-backend/src/calliope/comfyui/{name}" + raw = (repo / p).read_bytes() + assert wh.read(f"calliope/comfyui/{name}") == raw + member = next( + n for n in sd.getnames() if n.endswith(f"/src/calliope/comfyui/{name}") + ) + assert sd.extractfile(member).read() == raw + packages.append( + { + "path": p, + "sha256": hashlib.sha256(raw).hexdigest(), + "wheel_matches": True, + "sdist_matches": True, + } + ) + write("package-check.json", packages) + print( + json.dumps( + { + "ui": now["ui_total"], + "attempts": Counter( + a["status"] for r in now["cases"] for a in r["attempts"] + ), + "complete": len(now["coverage_delta"]["current_complete_paths"]), + "new_complete": now["coverage_delta"]["new_complete_paths"], + "inventory_nodes": len(inventory), + "inventory_paths": len({n["source_path"] for n in inventory}), + "gap_stats": stats(now), + }, + ensure_ascii=False, + ) + ) + + +if __name__ == "__main__": + main() diff --git a/docs/hel-892/scail-load-reference/LICENSE b/docs/hel-892/scail-load-reference/LICENSE new file mode 100644 index 00000000..f288702d --- /dev/null +++ b/docs/hel-892/scail-load-reference/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/scail-load-reference/__init__.py b/docs/hel-892/scail-load-reference/__init__.py new file mode 100644 index 00000000..9fa995f0 --- /dev/null +++ b/docs/hel-892/scail-load-reference/__init__.py @@ -0,0 +1,9 @@ +from .videohelpersuite.nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS +import folder_paths +from .videohelpersuite.server import server +from .videohelpersuite import documentation +from .videohelpersuite import latent_preview + +WEB_DIRECTORY = "./web" +__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"] +documentation.format_descriptions(NODE_CLASS_MAPPINGS) diff --git a/docs/hel-892/scail-load-reference/contract.json b/docs/hel-892/scail-load-reference/contract.json new file mode 100644 index 00000000..e4b11a0f --- /dev/null +++ b/docs/hel-892/scail-load-reference/contract.json @@ -0,0 +1,71 @@ +{ + "authority": "public_reference_only; no target object_info, export or execution proof", + "loader_commit": "8e4d79471bf1952154768e8435a9300077b534fa", + "composition": { + "frontends": [ + "1.37.11", + "1.48.6" + ], + "loader": "8e4d7947 full commit only; unmodified built-in AnimateDiff initialization", + "info": "537f3a02 full commit only", + "aliases": "exact KJ aux + ab72eda7 reference only", + "combine": "4ee72c06", + "core": "previous identity serializers; root only" + }, + "verified_facts": { + "registration": "VHS_LoadVideo -> LoadVideoUpload via nodes.py import and __init__ exports", + "required": [ + "video", + "force_rate", + "custom_width", + "custom_height", + "frame_load_cap", + "skip_first_frames", + "select_every_nth" + ], + "optional": [ + "meta_batch", + "vae", + "format" + ], + "outputs_no_vae": [ + "IMAGE", + "INT", + "AUDIO", + "VHS_VIDEOINFO" + ], + "names": [ + "IMAGE", + "frame_count", + "audio", + "video_info" + ], + "restore_order": "VHS hooks are chained before node creation. addLoadCommon registers initializeLoadFormat then a final onNodeCreated loop invokes every non-button widget callback, including default AnimateDiff. Constructor dimension defaults0 early-return; format callback installs step8/reset512 before onConfigure. useKVState restore iterates constructed widgets (not object keys), sets value then invokes callback: required dimensions before optional format, now with installed step8.", + "dimensions": "Initial schema omits dimension step, so order proof is necessary. Construction default0 returns before rounding; construction format callback sets step8/mod0/reset512. Saved dimensions restore with these options and must be finite exact integers in0..8192 divisible8; format restores same AnimateDiff, equal resets stay512 and others stay unchanged. This proof is specific to this commit/default/format/no-overrides; no generalized step8 assumption. Actual UE-bound dimensions remain rejected.", + "force_rate": "VHSFLOAT default 0 min0 max60 with no round; min0 is falsy. AnimateDiff target_rate8 resets only when previous reset equals current value. Within pinned AnimateDiff to AnimateDiff path, rate 8 remains8, other finite in-range values unchanged; 0/16 not loaded_fps.", + "cap_skip": "INT step1; links resolved after widget serialization. Explicit physical INT cap/skip links override saved map, including nonzero source slot. No UE inferred links.", + "format": "Only built-in AnimateDiff map; external nodes.VHSLoadFormats merged first and built-ins overwrite same key. No other format admitted.", + "vae_batch": "Known optional schema and VAE type-toggle/timer code; connected VAE/meta_batch rejected. No LATENT reconstruction or batch execution claimed.", + "ui": "VHS map onSerialize persists button/preview. Button restore skipped, options.serialize=false. DOM videopreview has serialize:false. No preview/updateParameters/media callbacks executed.", + "ue": "Both real loaders have nested + top-level custom_width/custom_height true, version7.1. Neither fixed VHS source nor cached frontend sources define this extension. No immutable target UE implementation/declaration available; whole loader/graph rejected. Unknown impact, not inert." + }, + "assumptions": [ + "Explicit unmodified pinned frontend+plugin saved-state reference only", + "1.37.11 may be explicitly chosen when declaration absent; 1.48.6 requires exact declaration", + "Dynamic video membership, actual media, target installation, queue hooks remain unknown" + ], + "legacy_alias_conclusion": { + "bounded_scope": "Official KJ pinned ab72eda7 web/js/setgetnodes.js history only; 52 revisions, one100-row page without next. Exact aux change e56b3061 and immediate parent276955e4 fetched as raw bytes.", + "historical_emission_proven": "276955e45fa48c794b47bf49dbc22f2d955d76a8 constructors emit SetNode/GetNode aux; e56b3061ed49251a7b8a5450a2e18295548ea7a1 changes exactly two lines to KJ repository aux.", + "restore_identity": "Pinned frontend configure copies saved properties over constructor properties before onConfigure; serialization clones properties. Old and new KJ onConfigure handle paste/name/type, not aux normalization. Old literal can persist after reload under a newer constructor; saved aux cannot uniquely date installed code.", + "difference": "Parent has root lookup and scoped lookup, paste map, virtual identity, name controls, getInputLink/resolveVirtualOutput; changes after parent include cleanup/subgraph handling; not byte-equivalent to ab72eda7.", + "user_provenance": "unproven: four literal declarations could have been authored/copied/migrated under multiple implementations or later installed KJ. Historical emission compatibility does not identify author or target install.", + "policy": "No new legacy alias profile; all old literal-source rejections unchanged. Do not revisit these four nodes without new evidence.", + "needed_evidence_layers": [ + "Immutable original frontend extension file and loaded registration identity/version at export", + "Export/configure migration context binding saved nodes to that constructor (and no competing same-class provider)", + "Pinned UE serialization/connection implementation and ordering for these saved bindings", + "Original API/target runtime evidence separately, before equivalence or execution claims" + ] + } +} diff --git a/docs/hel-892/scail-load-reference/history-boundary.json b/docs/hel-892/scail-load-reference/history-boundary.json new file mode 100644 index 00000000..130b7dc4 --- /dev/null +++ b/docs/hel-892/scail-load-reference/history-boundary.json @@ -0,0 +1,8 @@ +{ + "url": "https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits?sha=ab72eda7ffad6280422d71ab7d54d3fb87c0ba18&path=web/js/setgetnodes.js&per_page=100", + "retrieved_at": "2026-10-29T21:44:40.835665+00:00", + "sha256": "ef70e5f5ace6243c044d8ae38861adb188af3fe4fd78f55c87bb1e5d55d3df59", + "count": 52, + "pagination_link": null, + "scope": "Only official KJ web/js/setgetnodes.js history at pinned ab72eda7; one page within 100. Exact aux-changing commit plus immediate parent read, no provider-wide scan or unique provenance inference." +} diff --git a/docs/hel-892/scail-load-reference/kj-276955e45fa48c794b47bf49dbc22f2d955d76a8__LICENSE b/docs/hel-892/scail-load-reference/kj-276955e45fa48c794b47bf49dbc22f2d955d76a8__LICENSE new file mode 100644 index 00000000..f288702d --- /dev/null +++ b/docs/hel-892/scail-load-reference/kj-276955e45fa48c794b47bf49dbc22f2d955d76a8__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/scail-load-reference/kj-276955e45fa48c794b47bf49dbc22f2d955d76a8__setgetnodes.js b/docs/hel-892/scail-load-reference/kj-276955e45fa48c794b47bf49dbc22f2d955d76a8__setgetnodes.js new file mode 100644 index 00000000..023f8985 --- /dev/null +++ b/docs/hel-892/scail-load-reference/kj-276955e45fa48c794b47bf49dbc22f2d955d76a8__setgetnodes.js @@ -0,0 +1,1566 @@ +const { app } = window.comfyAPI.app; + +// originally based on diffus3's SetGet: https://github.com/diffus3/ComfyUI-extensions + +// Nodes that allow you to hide connections for cleaner graphs + +let _typeColorMap; +function setColorAndBgColor(node, type) { + if (!_typeColorMap) { + _typeColorMap = { + "DEFAULT": LGraphCanvas.node_colors.gray, + "MODEL": LGraphCanvas.node_colors.blue, + "LATENT": LGraphCanvas.node_colors.purple, + "VAE": LGraphCanvas.node_colors.red, + "WANVAE": LGraphCanvas.node_colors.red, + "CONDITIONING": LGraphCanvas.node_colors.brown, + "IMAGE": LGraphCanvas.node_colors.pale_blue, + "CLIP": LGraphCanvas.node_colors.yellow, + "FLOAT": LGraphCanvas.node_colors.green, + "MASK": { color: "#1c5715", bgcolor: "#1f401b"}, + "INT": { color: "#1b4669", bgcolor: "#29699c"}, + "CONTROL_NET": { color: "#156653", bgcolor: "#1c453b"}, + "NOISE": { color: "#2e2e2e", bgcolor: "#242121"}, + "GUIDER": { color: "#3c7878", bgcolor: "#1c453b"}, + "SAMPLER": { color: "#614a4a", bgcolor: "#3b2c2c"}, + "SIGMAS": { color: "#485248", bgcolor: "#272e27"}, + }; + } + const colors = _typeColorMap[type] || LGraphCanvas.node_colors?.gray; + if (colors) { + node.color = colors.color; + node.bgcolor = colors.bgcolor; + } +} +function getDisablePrefix() { + return app.ui.settings.getSettingValue("KJNodes.disablePrefix") ?? false; +} +// Temporary map for paste rename coordination between Set and Get nodes. +// Key: old name, Value: new name. Cleared via setTimeout(0) after each paste cycle. +// This works because both onConfigure calls (Set + Get) fire synchronously within +// the same paste operation, before the timeout clears the entry. +const _pasteRenameMap = new Map(); + +let _forceShowAllLinks = false; + +function getShowLinksMode() { + if (_forceShowAllLinks) return "always"; + return app.ui.settings.getSettingValue("KJNodes.showSetGetLinks") ?? "never"; +} +const LGraphNode = LiteGraph.LGraphNode + +// Cross-graph traversal utilities with lexical scoping for subgraph support. +// Set nodes propagate downward: a Set in a parent graph is visible to all descendant subgraphs. +// Get nodes look upward: a Get searches its own graph first, then parent, then grandparent, etc. +// Duplicate names are allowed across unrelated (sibling) subgraphs. + +function findRootGraph(graph) { + if (!graph) return null; + return graph.rootGraph || graph; +} + +// Find which SubgraphNode in parentGraph wraps the given subgraph +function findSubgraphNodeFor(parentGraph, innerNode) { + if (!parentGraph?._nodes || !innerNode?.graph) return null; + for (const n of parentGraph._nodes) { + if (n.subgraph && n.subgraph === innerNode.graph) return n; + } + return null; +} + +// Walk from a subgraph up to root, returning [graph, parent, grandparent, ..., root] +function getGraphAncestors(graph) { + if (!graph) return []; + const root = findRootGraph(graph); + if (!root || graph === root) return [root]; + + const chain = [graph]; + const visited = new Set([graph]); + let current = graph; + // Walk up: find which SubgraphNode wraps current, then get its parent graph + while (current !== root) { + let found = false; + // Search root nodes + for (const n of root._nodes) { + if (n.subgraph === current) { + chain.push(root); + current = root; + found = true; + break; + } + } + if (found) break; + // Search sibling subgraphs (for nested subgraphs) + const subgraphs = root._subgraphs || root.subgraphs; + if (subgraphs) { + for (const sg of subgraphs.values()) { + if (sg === current || !sg._nodes) continue; + for (const n of sg._nodes) { + if (n.subgraph === current) { + if (visited.has(sg)) { found = false; break; } + visited.add(sg); + chain.push(sg); + current = sg; + found = true; + break; + } + } + if (found) break; + } + } + if (!found) { + // Can't find parent, add root as fallback + if (!chain.includes(root)) chain.push(root); + break; + } + } + return chain; +} + +// Get all descendant subgraphs of a graph (children, grandchildren, etc.) +function getGraphDescendants(graph, _visited) { + if (!graph?._nodes) return []; + const visited = _visited || new Set(); + if (visited.has(graph)) return []; + visited.add(graph); + const descendants = []; + for (const n of graph._nodes) { + if (n.subgraph && !visited.has(n.subgraph)) { + descendants.push(n.subgraph); + descendants.push(...getGraphDescendants(n.subgraph, visited)); + } + } + return descendants; +} + +// Collect nodes of a type from specific graphs +function collectNodesOfType(graphs, type) { + const results = []; + for (const g of graphs) { + if (!g?._nodes) continue; + for (const node of g._nodes) { + if (node.type === type) results.push({ node, graph: g }); + } + } + return results; +} + +// Find all nodes of type across ALL graphs (root + all subgraphs). Used for global operations. +function findAllNodesOfType(graph, type) { + const root = findRootGraph(graph); + if (!root) return []; + const allGraphs = [root]; + const subgraphs = root._subgraphs || root.subgraphs; + if (subgraphs) { + for (const sg of subgraphs.values()) allGraphs.push(sg); + } + return collectNodesOfType(allGraphs, type); +} + +// Scoped setter lookup: search current graph, then ancestors (look up). +function findSetterByName(graph, name) { + if (!name) return null; + for (const g of getGraphAncestors(graph)) { + if (!g?._nodes) continue; + for (const node of g._nodes) { + if (node.type === 'SetNode' && node.widgets[0].value === name) { + return { node, graph: g }; + } + } + } + return null; +} + +// Scoped getter lookup: search current graph + descendants (propagate down). +function findGettersByName(graph, name) { + if (!name) return []; + const graphs = [graph, ...getGraphDescendants(graph)]; + return collectNodesOfType(graphs, 'GetNode') + .filter(entry => entry.node.widgets[0].value === name); +} + +// Get all visible SetNode names for a GetNode's combo dropdown. +// Shows names from current graph + ancestors (what's in scope). +// Also builds a source map for getOptionLabel. This module-level variable is safe +// because the values getter and getOptionLabel run in the same synchronous render pass. +let _setNameSourceMap = new Map(); + +function getVisibleSetNames(graph, filterType) { + const sourceMap = new Map(); + const ancestors = getGraphAncestors(graph); + const entries = collectNodesOfType(ancestors, 'SetNode'); + for (const e of entries) { + const name = e.node.widgets[0].value; + if (!name) continue; + if (filterType && filterType !== '*') { + const setType = e.node.inputs[0]?.type; + if (setType && setType !== '*') { + const filterTypes = String(filterType).split(","); + if (!filterTypes.some(ft => ft === setType || setType.split(",").includes(ft))) continue; + } + } + if (!sourceMap.has(name)) { + sourceMap.set(name, e.graph === graph ? "local" : "parent"); + } + } + _setNameSourceMap = sourceMap; + return [...sourceMap.keys()].sort(); +} + +// Exposed globally for use in contextmenu.js +window.kjNodes = window.kjNodes || {}; +window.kjNodes.convertOutputsToSetGet = convertOutputsToSetGet; +window.kjNodes.snapshotSelectedNodes = snapshotSelectedNodes; +function convertOutputsToSetGet(graph, node) { + if (!graph || !node) return; + for (let slotIdx = 0; slotIdx < node.outputs.length; slotIdx++) { + const output = node.outputs[slotIdx]; + if (!output.links || output.links.length === 0) continue; + + const linkType = output.type || "*"; + const linkName = output.name || linkType; + + // Collect targets and link IDs to remove, skipping existing Set/Get nodes + const targets = []; + const linksToRemove = []; + for (const linkId of [...output.links]) { + const link = getLink(graph, linkId); + if (link) { + const targetNode = graph.getNodeById(link.target_id); + if (targetNode && targetNode.type !== 'SetNode' && targetNode.type !== 'GetNode') { + targets.push({ targetId: link.target_id, targetSlot: link.target_slot }); + linksToRemove.push(linkId); + } + } + } + if (targets.length === 0) continue; + + // Create Set node + const setNode = LiteGraph.createNode("SetNode"); + if (!setNode) continue; + setNode.pos = [ + node.pos[0] + node.size[0] + 30, + node.pos[1] + slotIdx * 60 + ]; + graph.add(setNode); + setNode.flags.collapsed = true; + + for (const linkId of linksToRemove) graph.removeLink(linkId); + + // Connect source → Set node input + node.connect(slotIdx, setNode, 0); + + // Set the name widget + setNode.widgets[0].value = linkName; + setNode.title = (!getDisablePrefix() ? "Set_" : "") + linkName; + setNode.validateName(graph); + const finalName = setNode.widgets[0].value; + setNode.properties.previousName = finalName; + + // Create a Get node for each target + for (const target of targets) { + const targetNode = graph.getNodeById(target.targetId); + if (!targetNode) continue; + + const getNode = LiteGraph.createNode("GetNode"); + if (!getNode) continue; + getNode.pos = [ + targetNode.pos[0] - getNode.size[0] - 30, + targetNode.pos[1] + ]; + graph.add(getNode); + getNode.flags.collapsed = true; + + getNode.widgets[0].value = finalName; + getNode.onRename(); + + getNode.connect(0, targetNode, target.targetSlot); + } + } + app.canvas.setDirty(true, true); +} + +// Snapshot selection immediately (before right-click changes it) +function snapshotSelectedNodes(node, typeFilter) { + const selected = Object.values(app.canvas.selected_nodes || {}); + // Always include the right-clicked node, even if selection state is inconsistent + const nodeSet = new Set(selected); + nodeSet.add(node); + let nodes = [...nodeSet]; + if (typeFilter) nodes = nodes.filter(n => n.type === typeFilter); + return nodes; +} + +// Tracks nodes flagged with has_errors so they can be cleared on the next alert. +// Always cleared before repopulating, so it only holds nodes from the most recent alert. +const _errorNodes = new Set(); +function showAlert(message, nodes) { + const nodeList = nodes ? (Array.isArray(nodes) ? nodes : [nodes]) : []; + const nodeInfo = nodeList.map(n => + `${n.title || n.type} [${Math.round(n.pos[0])}, ${Math.round(n.pos[1])}]` + ).join(', '); + if (nodeList.length) { + // Clear previous error flags + for (const n of _errorNodes) n.has_errors = false; + _errorNodes.clear(); + setTimeout(() => { + for (const n of nodeList) { + n.has_errors = true; + _errorNodes.add(n); + } + app.canvas?.setDirty(true, true); + }, 100); + } + app.extensionManager.toast.add({ + severity: 'warn', + summary: "KJ Set/Get", + detail: nodeInfo ? `${message} — ${nodeInfo}` : message, + life: 5000, + }); +} +function convertAllSetGetToLinks(graph) { + if (!graph) return; + const rootGraph = findRootGraph(graph); + + // First pass: handle cross-graph pairs (must run before same-graph + // because converting cross-graph creates real links that replace + // the Set/Get, and same-graph pass would miss the removed nodes) + const allSetEntries = findAllNodesOfType(rootGraph, 'SetNode'); + for (const { node: setNode, graph: setGraph } of [...allSetEntries]) { + const name = setNode.widgets[0].value; + if (!name) continue; + const allGetEntries = findGettersByName(rootGraph, name); + const crossGraphGetters = allGetEntries.filter(e => e.graph !== setGraph); + if (crossGraphGetters.length > 0) { + convertCrossGraphSetGet(setNode, setGraph, crossGraphGetters); + } + } + + // Second pass: handle remaining same-graph pairs + for (const { node: setNode, graph: g } of [...findAllNodesOfType(rootGraph, 'SetNode')]) { + convertSetGetToLinks(g, setNode); + } +} + +// Compat shim: older frontends may lack graph.getLink(), and _links may be a Map or +// plain object depending on the litegraph version. The == null check catches both null +// and undefined intentionally. +function getLink(graph, linkId) { + if (linkId == null) return null; + if (graph.getLink) return graph.getLink(linkId); + return graph._links instanceof Map ? graph._links.get(linkId) : graph._links?.[linkId] ?? null; +} + +// Collect {targetId, targetSlot} from an output slot's links +function collectOutputConnections(graph, output) { + const connections = []; + if (output?.links) { + for (const linkId of [...output.links]) { + const link = getLink(graph, linkId); + if (link) connections.push({ targetId: link.target_id, targetSlot: link.target_slot }); + } + } + return connections; +} + +function convertCrossGraphSetGet(setNode, setGraph, crossGraphGetters) { + // Find what's connected to the SetNode's input + const setInput = setNode.inputs[0]; + if (setInput.link == null) return; + const sourceLink = getLink(setGraph, setInput.link); + if (!sourceLink) return; + const sourceNode = setGraph.getNodeById(sourceLink.origin_id); + if (!sourceNode) return; + const sourceSlot = sourceLink.origin_slot; + const linkType = setNode.inputs[0].type || '*'; + + for (const { node: getter, graph: getterGraph } of crossGraphGetters) { + // Collect getter's downstream connections before removing it + const connections = collectOutputConnections(getterGraph, getter.outputs[0]); + if (connections.length === 0) { + getterGraph.remove(getter); + continue; + } + + // Determine direction and create SubgraphInput or SubgraphOutput + const rootGraph = findRootGraph(setGraph); + const sgNodeForGetter = findSubgraphNodeFor(rootGraph, getter); + const sgNodeForSetter = findSubgraphNodeFor(rootGraph, setNode); + + if (sgNodeForGetter && setGraph === rootGraph) { + // Set in root, Get in subgraph → create SubgraphInput + const subgraph = sgNodeForGetter.subgraph; + const inputName = setNode.widgets[0].value || linkType; + const newInput = subgraph.addInput(inputName, linkType); + const inputIndex = subgraph.inputs.indexOf(newInput); + + // Connect source → SubgraphNode's new input in root graph + sourceNode.connect(sourceSlot, sgNodeForGetter, inputIndex); + + // Inside subgraph: connect SubgraphInput slot → getter's targets + for (const conn of connections) { + if (conn.targetId === subgraph.outputNode?.id) { + // GetNode fed a SubgraphOutput — bypass it and connect source directly in parent graph. + const sgNodeOutput = sgNodeForGetter.outputs[conn.targetSlot]; + if (sgNodeOutput?.links) { + for (const parentLinkId of [...sgNodeOutput.links]) { + const parentLink = getLink(rootGraph, parentLinkId); + if (parentLink) { + const parentTarget = rootGraph.getNodeById(parentLink.target_id); + if (parentTarget) { + sourceNode.connect(sourceSlot, parentTarget, parentLink.target_slot); + } + } + } + } + // Remove the now-unnecessary SubgraphOutput + const sgOutput = subgraph.outputs[conn.targetSlot]; + if (sgOutput) { + subgraph.removeOutput(sgOutput); + } + } else { + const targetNode = getterGraph.getNodeById(conn.targetId); + if (targetNode) { + newInput.connect(targetNode.inputs[conn.targetSlot], targetNode); + } + } + } + + // If no connections used the SubgraphInput, remove it + if (newInput.linkIds.length === 0) { + subgraph.removeInput(newInput); + } + + getterGraph.remove(getter); + + } else if (sgNodeForSetter && getterGraph === rootGraph) { + // Set in subgraph, Get in root → create SubgraphOutput + const subgraph = sgNodeForSetter.subgraph; + const outputName = setNode.widgets[0].value || linkType; + const newOutput = subgraph.addOutput(outputName, linkType); + const outputIndex = subgraph.outputs.indexOf(newOutput); + + // Inside subgraph: connect source output → SubgraphOutput slot + newOutput.connect(sourceNode.outputs[sourceSlot], sourceNode); + + // In root graph: connect SubgraphNode's new output → getter's targets + for (const conn of connections) { + const targetNode = getterGraph.getNodeById(conn.targetId); + if (targetNode) { + sgNodeForSetter.connect(outputIndex, targetNode, conn.targetSlot); + } + } + + getterGraph.remove(getter); + + } else { + // Both in different subgraphs (sibling) — would need both input and output + // Skip for now, too complex + console.warn(`KJNodes: Cannot convert cross-graph Set/Get "${setNode.widgets[0].value}" between sibling subgraphs`); + } + } + + // Remove SetNode if all its getters have been handled (check if any same-graph getters remain) + const remainingGetters = setGraph._nodes.filter( + n => n.type === 'GetNode' && n.widgets[0].value === setNode.widgets[0].value + ); + if (remainingGetters.length === 0) { + setGraph.remove(setNode); + } +} + +function convertSetGetToLinks(graph, setNode) { + if (!graph || !setNode) return; + + const name = setNode.widgets[0].value; + let sameGraphGetters = []; + if (name) { + const allGetters = findGettersByName(graph, name); + const crossGetters = []; + for (const entry of allGetters) { + if (entry.graph === graph) sameGraphGetters.push(entry.node); + else crossGetters.push(entry); + } + if (crossGetters.length > 0) { + convertCrossGraphSetGet(setNode, graph, crossGetters); + } + } + + // Find the source connected to the Set node's input + const setInput = setNode.inputs[0]; + if (setInput.link == null) return; + const sourceLink = getLink(graph, setInput.link); + if (!sourceLink) return; + const sourceNode = graph.getNodeById(sourceLink.origin_id); + if (!sourceNode) return; + const sourceSlot = sourceLink.origin_slot; + + // Collect all consumer connections from Get nodes and SetNode's own output passthrough + const connections = []; + for (const getter of sameGraphGetters) { + connections.push(...collectOutputConnections(graph, getter.outputs[0])); + } + connections.push(...collectOutputConnections(graph, setNode.outputs[0])); + + // Remove all Get nodes (this also removes their links) + for (const getter of sameGraphGetters) { + graph.remove(getter); + } + // Remove the Set node + graph.remove(setNode); + + // Create direct links from source to each consumer + for (const conn of connections) { + const targetNode = graph.getNodeById(conn.targetId); + if (targetNode) { + sourceNode.connect(sourceSlot, targetNode, conn.targetSlot); + } + } + + app.canvas?.setDirty(true, true); +} + +// region SetNode +app.registerExtension({ + name: "KJNodes.SetNode", + registerCustomNodes() { + class SetNode extends LGraphNode { + static title = "Set"; + static category = "KJNodes"; + serialize_widgets = true; + drawConnection = false; + slotColor = "#FFF"; + canvas = app.canvas; + + constructor(title) { + super(title) + if (!this.properties) { + this.properties = { + "previousName": "" + }; + } + this.properties["Node name for S&R"] = "SetNode"; + this.properties["aux_id"] = "SetNode"; + this.isVirtualNode = true; // This node is purely frontend and does not impact the resulting prompt so should not be serialized + + this.addWidget( + "text", + "Constant", + '', + () => { + if (!this.graph || app.configuringGraph) return; + this.validateName(this.graph); + if (this.widgets[0].value !== '') { + this.title = (!getDisablePrefix() ? "Set_" : "") + this.widgets[0].value; + } + this.update(); + this.properties.previousName = this.widgets[0].value; + }, + {} + ) + + this.addInput("*", "*"); + this.addOutput("*", '*'); + } + + onConnectionsChange( + slotType, + slot, + isChangeConnect, + link_info + ) { + // During graph load, slots are restored by configure — skip side effects + if (app.configuringGraph) return; + //On Disconnect + if (slotType === LiteGraph.INPUT && !isChangeConnect) { + const outputConnected = this.outputs[0]?.links?.length > 0; + if (outputConnected) { + this.inputs[slot].type = this.outputs[0].type; + this.inputs[slot].name = this.outputs[0].name; + } else { + this.inputs[slot].type = '*'; + this.inputs[slot].name = '*'; + this.outputs[0].type = '*'; + this.outputs[0].name = '*'; + this.title = "Set"; + this.color = null; + this.bgcolor = null; + } + this.update(); + } + if (slotType === LiteGraph.OUTPUT && !isChangeConnect) { + if (this.outputs && this.outputs[slot]) { + // Keep type if input has a real connection + const inputConnected = this.inputs[0]?.link != null; + if (inputConnected) { + this.outputs[slot].type = this.inputs[0].type; + this.outputs[slot].name = this.inputs[0].name; + } else { + this.inputs[0].type = '*'; + this.inputs[0].name = '*'; + this.outputs[slot].type = '*'; + this.outputs[slot].name = '*'; + this.color = null; + this.bgcolor = null; + } + } + } + //On Connect + if (link_info && this.graph && slotType === LiteGraph.INPUT && isChangeConnect) { + const resolve = link_info.resolve(this.graph) + const resolvedSlot = resolve?.subgraphInput ?? resolve?.output; + const type = resolvedSlot?.type; + if (type) { + if (this.title === "Set"){ + this.title = (!getDisablePrefix() ? "Set_" : "") + type; + } + if (this.widgets[0].value === '' || this.widgets[0].value === '*'){ + // Determine the initial widget value based on naming setting + const namingMode = app.ui.settings.getSettingValue("KJNodes.setGetNaming") ?? "empty"; + if (namingMode !== "empty") { + const link = getLink(this.graph, this.inputs[0]?.link); + const sourceNode = link ? this.graph.getNodeById(link.origin_id) : null; + const slotName = sourceNode?.outputs?.[link?.origin_slot]?.name || type; + switch (namingMode) { + case "slot name": this.widgets[0].value = slotName; break; + case "slot name (lowercase)": this.widgets[0].value = slotName.toLowerCase(); break; + case "slot name (UPPERCASE)": this.widgets[0].value = slotName.toUpperCase(); break; + } + } + } + + this.validateName(this.graph); + this.properties.previousName = this.widgets[0].value; + this.inputs[0].type = type; + this.inputs[0].name = type; + this.outputs[0].type = type; + this.outputs[0].name = type; + + if (app.ui.settings.getSettingValue("KJNodes.nodeAutoColor")){ + setColorAndBgColor(this, type); + } + } else { + showAlert(`node ${this.title} input undefined.`, this) + } + } + if (link_info && this.graph && slotType === LiteGraph.OUTPUT && isChangeConnect) { + // Prefer input type; fall back to target's input type + const inputType = this.inputs[0]?.type; + if (inputType && inputType !== '*') { + this.outputs[0].type = inputType; + this.outputs[0].name = inputType; + } else { + const resolve = link_info.resolve(this.graph); + const type = resolve?.input?.type; + if (type && type !== '*') { + this.inputs[0].type = type; + this.inputs[0].name = type; + this.outputs[0].type = type; + this.outputs[0].name = type; + if (app.ui.settings.getSettingValue("KJNodes.nodeAutoColor")){ + setColorAndBgColor(this, type); + } + } + } + } + + //Update either way + this.update(); + } + + // Returns true if the name was changed + validateName(graph, sameGraphOnly) { + let widgetValue = this.widgets[0].value; + + if (widgetValue !== '') { + let tries = 0; + const existingValues = new Set(); + + // sameGraphOnly: only check the immediate graph (for paste/clone) + // otherwise check full scope (own graph + ancestors) + const scopeGraphs = sameGraphOnly ? [graph] : getGraphAncestors(graph); + const scopedSetNodes = collectNodesOfType(scopeGraphs, 'SetNode'); + scopedSetNodes.forEach(entry => { + if (entry.node !== this) { + existingValues.add(entry.node.widgets[0].value); + } + }); + + const originalValue = widgetValue; + // Only strip _N suffix during paste to avoid FOO_0_1_2 accumulation. + // For manual renames, keep the full name as base (user may intend FOO_3). + const baseName = this._justAdded ? widgetValue.replace(/_\d+$/, '') : widgetValue; + while (existingValues.has(widgetValue)) { + widgetValue = baseName + "_" + tries; + tries++; + } + + this.widgets[0].value = widgetValue; + this.title = (!getDisablePrefix() ? "Set_" : "") + widgetValue; + return widgetValue !== originalValue; + } + return false; + } + + clone() { + const cloned = super.clone(); + cloned.inputs[0].name = '*'; + cloned.inputs[0].type = '*'; + cloned.properties.previousName = ''; + cloned.size = cloned.computeSize(); + return cloned; + } + + onAdded() { + this._justAdded = true; + } + + onConfigure() { + // Only run paste logic when actually pasting, not during workflow load + if (this._justAdded && this.graph && !app.configuringGraph) { + const oldName = this.widgets[0].value; + this.validateName(this.graph, true); + this._justAdded = false; + const newName = this.widgets[0].value; + if (newName !== oldName) { + _pasteRenameMap.set(oldName, newName); + // Clear the map after this paste cycle + setTimeout(() => _pasteRenameMap.delete(oldName), 0); + } + // Reset type and color on paste — nothing is connected yet + if (this.inputs[0]?.link == null) { + this.inputs[0].type = '*'; + this.inputs[0].name = '*'; + this.outputs[0].type = '*'; + this.outputs[0].name = '*'; + this.color = null; + this.bgcolor = null; + } + } + this._justAdded = false; + } + + update() { + if (!this.graph) return; + + const getters = this.findGetters(this.graph); + getters.forEach(getter => { + getter.setType(this.inputs[0].type); + }); + + if (this.widgets[0].value && this.properties.previousName) { + const gettersWithPreviousName = this.findGetters(this.graph, true); + gettersWithPreviousName.forEach(getter => { + getter.setName(this.widgets[0].value); + }); + } + app.canvas?.setDirty(true, true); + } + + findGetters(graph, checkForPreviousName) { + const name = checkForPreviousName ? this.properties.previousName : this.widgets[0].value; + if (!name || name === '') return []; + // Scoped: searches own graph + descendant subgraphs + return findGettersByName(graph, name).map(entry => entry.node); + } + + getExtraMenuOptions(_, options) { + options.unshift( + { + content: this.drawConnection ? "Hide connections" : "Show connections", + callback: () => { + this.drawConnection = !this.drawConnection; + const linkType = this.inputs[0].type; + this.slotColor = this.canvas.default_connection_color_byType[linkType]; + this.canvas.setDirty(true, true); + }, + }, + { + content: "Hide all connections", + callback: () => { + for (const n of this.graph._nodes) { + if (n.type === "GetNode" || n.type === "SetNode") n.drawConnection = false; + } + this.canvas.setDirty(true, true); + }, + + }, + ); + options.unshift({ + content: "Convert to links", + callback: () => { + const graph = this.graph; + for (const n of snapshotSelectedNodes(this, 'SetNode')) convertSetGetToLinks(graph, n); + }, + }); + options.unshift({ + content: "Add paired GetNode", + callback: () => { + const graph = this.graph; + const getNode = LiteGraph.createNode("GetNode"); + if (!getNode) return; + getNode.pos = [this.pos[0] + this.size[0] + 30, this.pos[1]]; + graph.add(getNode); + // Set the widget value to match — this drives type, color, and connection + const name = this.widgets[0].value; + if (getNode.widgets?.[0]) { + getNode.widgets[0].value = name; + } + getNode.onRename?.(); + app.canvas.selectNode(getNode, false); + app.canvas.setDirty(true, true); + }, + }); + // Dynamically add a submenu for all getters + const allGettersForMenu = this.findGetters(this.graph); + if (allGettersForMenu.length) { + let gettersSubmenu = allGettersForMenu.map(getter => { + const sameGraph = getter.graph === this.graph; + const sgNode = !sameGraph ? findSubgraphNodeFor(this.graph, getter) : null; + const label = sameGraph + ? `${getter.title} id: ${getter.id}` + : `${getter.title} (in subgraph${sgNode ? ': ' + (sgNode.title || sgNode.type) : ''})`; + return { + content: label, + callback: () => { + if (sameGraph) { + this.canvas.centerOnNode(getter); + this.canvas.selectNode(getter, false); + } else if (sgNode) { + this.canvas.openSubgraph(sgNode.subgraph, sgNode); + // Center on the getter after entering the subgraph + setTimeout(() => { + this.canvas.centerOnNode(getter); + this.canvas.selectNode(getter, false); + }, 0); + } + this.canvas.setDirty(true, true); + }, + }; + }); + + options.unshift({ + content: "Getters", + has_submenu: true, + submenu: { + title: "GetNodes", + options: gettersSubmenu, + } + }); + } + } + } + + LiteGraph.registerNodeType("SetNode", SetNode); + }, +}); + +// region GetNode +app.registerExtension({ + name: "KJNodes.GetNode", + registerCustomNodes() { + class GetNode extends LGraphNode { + static title = "Get"; + static category = "KJNodes"; + serialize_widgets = true; + drawConnection = false; + currentSetter = null; + canvas = app.canvas; + + constructor(title) { + super(title) + if (!this.properties) { + this.properties = {}; + } + this.properties["Node name for S&R"] = "GetNode"; + this.properties["aux_id"] = "GetNode"; + this.isVirtualNode = true; // This node is purely frontend and does not impact the resulting prompt so should not be serialized + const comboOptions = { + getOptionLabel: (value) => { + if (!value) return ""; + const source = _setNameSourceMap.get(value); + if (!source || source === "local") return value; + return `${value} (${source})`; + }, + }; + Object.defineProperty(comboOptions, 'values', { + get: () => { + if (!this.graph) return []; + let filterType = null; + if (app.ui.settings.getSettingValue("KJNodes.filterGetNodeOptions") !== false + && this.outputs[0]?.links?.length) { + const linkId = this.outputs[0].links[0]; + const link = getLink(this.graph, linkId); + if (link) { + const targetNode = this.graph.getNodeById(link.target_id); + filterType = targetNode?.inputs?.[link.target_slot]?.type || null; + } + } + return getVisibleSetNames(this.graph, filterType); + }, + enumerable: true, + configurable: true + }); + this.addWidget("combo", "Constant", "", () => { if (!app.configuringGraph) this.onRename(); }, comboOptions) + this.addOutput("*", '*'); + } + + onConnectionsChange() { + if (app.configuringGraph) return; + this.validateLinks(); + } + + setName(name) { + this.widgets[0].value = name; + this.onRename(); + this.serialize(); + } + + onRename() { + const setter = this.findSetter(this.graph); + if (setter) { + this.setType(setter.inputs[0].type); + this.title = (!getDisablePrefix() ? "Get_" : "") + setter.widgets[0].value; + } else { + this.setType('*'); + const name = this.widgets[0].value; + this.title = name ? (!getDisablePrefix() ? "Get_" : "") + name : "Get"; + } + app.canvas?.setDirty(true, true); + } + + clone() { + const cloned = super.clone(); + cloned.size = cloned.computeSize(); + return cloned; + } + + validateLinks() { + if (this.outputs[0].type !== '*' && this.outputs[0].links && this.graph) { + this.outputs[0].links.filter(linkId => { + const link = getLink(this.graph, linkId); + if (!link || !link.type) return false; + if (link.type === '*') return false; + const targetNode = this.graph.getNodeById(link.target_id); + const targetType = targetNode?.inputs?.[link.target_slot]?.type; + if (targetType === '*') return false; + if (targetType) { + const targetTypes = String(targetType).split(","); + if (targetTypes.includes(this.outputs[0].type)) return false; + } + return !link.type.split(",").includes(this.outputs[0].type); + }).forEach(linkId => { + this.graph.removeLink(linkId); + }); + } + } + + setType(type) { + this.outputs[0].name = type; + this.outputs[0].type = type; + this.validateLinks(); + if (app.ui.settings.getSettingValue("KJNodes.nodeAutoColor")) { + if (type === '*') { + this.color = null; + this.bgcolor = null; + } else { + setColorAndBgColor(this, type); + } + } + } + + findSetter(graph) { + const name = this.widgets[0].value; + // Scoped: searches own graph first, then ancestors + const result = findSetterByName(graph, name); + return result ? result.node : undefined; + } + + goToSetter() { + if (!this.currentSetter) return; + const setterGraph = this.currentSetter.graph; + if (setterGraph && setterGraph !== this.graph) { + this.canvas.setGraph(setterGraph); + setTimeout(() => { + this.canvas.centerOnNode(this.currentSetter); + this.canvas.selectNode(this.currentSetter, false); + this.canvas.setDirty(true, true); + }, 0); + } else { + this.canvas.centerOnNode(this.currentSetter); + this.canvas.selectNode(this.currentSetter, false); + } + } + + onAdded() { + this._justAdded = true; + } + + onConfigure() { + if (this._justAdded && !app.configuringGraph) { + const name = this.widgets[0].value; + if (name) { + // Check if our paired SetNode was renamed during this paste + const newName = _pasteRenameMap.get(name); + if (newName) { + this.widgets[0].value = newName; + } + // Restore type/color from setter after paste + setTimeout(() => this.onRename(), 0); + } + } + this._justAdded = false; + } + + getInputLink(slot) { + // Same-graph: standard resolveOutput path. + // Cross-graph: handled by resolveVirtualOutput. + const name = this.widgets[0].value; + if (!name || name === '') return null; + const setter = this.graph?._nodes?.find( + n => n.type === 'SetNode' && n.widgets[0].value === name + ); + if (setter) { + const slotInfo = setter.inputs[slot]; + if (!slotInfo || slotInfo.link == null) return null; + return getLink(this.graph, slotInfo.link); + } + // Scoped lookup: no setter found in own graph or ancestors + if (name && !findSetterByName(this.graph, name)) { + showAlert("No SetNode found for " + name + "(" + this.type + ")", this); + } + return null; + } + + resolveVirtualOutput(slot) { + const name = this.widgets[0].value; + // Scoped lookup: own graph first, then ancestors + const result = findSetterByName(this.graph, name); + if (!result) return undefined; + + // Same graph — let the standard getInputLink path handle it + if (result.graph === this.graph) return undefined; + + // Warn if multiple SetNodes with this name exist in scope + const scopeGraphs = getGraphAncestors(this.graph); + const scopedSetters = collectNodesOfType(scopeGraphs, 'SetNode') + .filter(e => e.node.widgets[0].value === name); + if (scopedSetters.length > 1) { + showAlert(`Multiple SetNodes named "${name}" found in scope. Rename duplicates or use "Convert to links" to resolve`, [this, ...scopedSetters.map(e => e.node)]); + return undefined; + } + + const { node: setter, graph: setterGraph } = result; + const slotInfo = setter.inputs[slot]; + if (!slotInfo || slotInfo.link == null) return undefined; + + const link = getLink(setterGraph, slotInfo.link); + if (!link) return undefined; + + const sourceNode = setterGraph.getNodeById(link.origin_id); + if (!sourceNode) return undefined; + + return { node: sourceNode, slot: link.origin_slot }; + } + getExtraMenuOptions(_, options) { + this.currentSetter = this.findSetter(this.graph) + if (!this.currentSetter) return + const sameGraph = this.currentSetter.graph === this.graph; + if (sameGraph) { + let menuEntry = this.drawConnection ? "Hide connections" : "Show connections"; + options.unshift( + { + content: "Convert to links", + callback: () => { + const graph = this.graph; + const setters = new Set(snapshotSelectedNodes(this, 'GetNode') + .map(n => n.findSetter?.(graph)).filter(Boolean)); + for (const s of setters) convertSetGetToLinks(graph, s); + }, + }, + { + content: "Go to setter", + callback: () => { + this.goToSetter(); + }, + }, + { + content: menuEntry, + callback: () => { + if (!this.currentSetter) return; + const linkType = this.currentSetter.inputs[0].type; + // Toggle on the SetNode so the canvas-level hook draws it + this.currentSetter.drawConnection = !this.currentSetter.drawConnection; + this.currentSetter.slotColor = this.canvas.default_connection_color_byType[linkType]; + this.drawConnection = this.currentSetter.drawConnection; + this.canvas.setDirty(true, true); + }, + }, + ); + } else { + // Cross-graph setter — navigate to its graph + const setterGraph = this.currentSetter.graph; + const isRoot = setterGraph === findRootGraph(this.graph); + options.unshift( + { + content: `Go to setter (in ${isRoot ? 'parent graph' : 'subgraph'})`, + callback: () => { + const canvas = this.canvas; + canvas.setGraph(setterGraph); + setTimeout(() => { + canvas.centerOnNode(this.currentSetter); + canvas.selectNode(this.currentSetter, false); + canvas.setDirty(true, true); + }, 0); + }, + }, + ); + } + } + } + + LiteGraph.registerNodeType("GetNode", GetNode); + }, +}); + +// region UI: commands, keybindings, canvas menu, draw hook, settings +app.registerExtension({ + name: "KJNodes.SetGetUI", + settings: [ + { + id: "KJNodes.setGetNaming", + name: "Default SetNode widget value", + category: ["KJNodes", "Set & Get", "Default SetNode widget value"], + tooltip: "Initial Constant value when a Set node is first connected to a slot", + type: "combo", + options: ["empty", "slot name", "slot name (lowercase)", "slot name (UPPERCASE)"], + defaultValue: "empty", + }, + { + id: "KJNodes.showSetGetLinks", + name: "Show links", + category: ["KJNodes", "Set & Get", "Show links"], + tooltip: "When to show virtual links between Set/Get pairs", + type: "combo", + options: ["never", "selected", "always"], + defaultValue: "never", + onChange: () => app.canvas?.setDirty(true, true), + }, + ], + commands: [ + { + id: "KJNodes.AddSetNodeToSelected", + label: "Add Set node to selected / at cursor", + function: () => { + const selected = Object.values(app.canvas.selected_nodes || {}); + if (selected.length > 0) { + for (const n of selected) { + window.kjNodes.addNode("SetNode", n, { side: "right", offset: 30 }); + } + } else { + const canvas = app.canvas; + const graph = canvas.graph || app.graph; + const node = LiteGraph.createNode("SetNode"); + if (!node) return; + node.pos = [canvas.graph_mouse[0], canvas.graph_mouse[1]]; + graph.add(node); + canvas.selectNode(node, false); + canvas.setDirty(true, true); + } + }, + }, + { + id: "KJNodes.AddGetNodeAtCursor", + label: "Add Get node to selected / at cursor", + function: () => { + const selected = Object.values(app.canvas.selected_nodes || {}); + if (selected.length > 0) { + for (const n of selected) { + window.kjNodes.addNode("GetNode", n, { side: "left", offset: 30 }); + } + } else { + const canvas = app.canvas; + const graph = canvas.graph || app.graph; + const node = LiteGraph.createNode("GetNode"); + if (!node) return; + node.pos = [canvas.graph_mouse[0], canvas.graph_mouse[1]]; + graph.add(node); + canvas.selectNode(node, false); + canvas.setDirty(true, true); + } + }, + }, + { + id: "KJNodes.ToggleForceShowSetGetLinks", + label: "Toggle force-show all Set/Get connections", + function: () => { + _forceShowAllLinks = !_forceShowAllLinks; + app.canvas.setDirty(true, true); + }, + }, + ], + keybindings: [ + { + commandId: "KJNodes.AddSetNodeToSelected", + combo: { key: "s", ctrl: true, shift: true }, + targetElementId: "graph-canvas", + }, + { + commandId: "KJNodes.AddGetNodeAtCursor", + combo: { key: "g", ctrl: true, shift: true }, + targetElementId: "graph-canvas", + }, + { + commandId: "KJNodes.ToggleForceShowSetGetLinks", + combo: { key: "l", ctrl: true, shift: true }, + targetElementId: "graph-canvas", + }, + ], + getCanvasMenuItems() { + return [ + { + content: "KJNodes", + has_submenu: true, + submenu: { + options: [ + { + content: "Convert outputs on all selected nodes to Set/Get", + callback: () => { + const selected = Object.values(app.canvas.selected_nodes || {}); + if (selected.length === 0) return; + for (const n of selected) convertOutputsToSetGet(app.graph, n); + }, + }, + { + content: "Convert selected Set/Get to links", + callback: () => { + const graph = app.graph; + const selected = Object.values(app.canvas.selected_nodes || {}); + const setNodes = selected.filter(n => n.type === 'SetNode'); + const getNodes = selected.filter(n => n.type === 'GetNode'); + for (const n of setNodes) convertSetGetToLinks(graph, n); + const setters = new Set(getNodes.map(n => n.findSetter?.(graph)).filter(Boolean)); + for (const s of setters) convertSetGetToLinks(graph, s); + }, + }, + ], + }, + }, + ]; + }, + setup() { + // Double-click GetNode to jump to its SetNode (works in both legacy and Vue modes) + document.addEventListener("dblclick", (e) => { + // Don't interfere when a ContextMenu (e.g. combo dropdown) is open + if (document.querySelector(".litecontextmenu")) return; + const canvas = app.canvas; + if (!canvas) return; + const selected = Object.values(canvas.selected_nodes || {}); + if (selected.length !== 1) return; + const node = selected[0]; + if (node.type === "GetNode") { + node.currentSetter = node.findSetter(node.graph); + if (node.currentSetter) node.goToSetter(); + } + }); + // Suppress title rename on collapsed GetNodes so double-click navigates instead + document.addEventListener("litegraph:canvas", (e) => { + if (e.detail?.subType !== 'node-double-click') return; + const node = e.detail.node; + if (node?.type === "GetNode" && node.flags?.collapsed) { + e.stopImmediatePropagation(); + } + }); + + // Monkey-patch: no extension hook exists for filtering visible nodes. + // Keep Set/Get nodes with visible virtual connections in the visible set + // even when offscreen, so the link lines don't get clipped. + const originalComputeVisibleNodes = LGraphCanvas.prototype.computeVisibleNodes; + LGraphCanvas.prototype.computeVisibleNodes = function () { + const visible = originalComputeVisibleNodes.apply(this, arguments); + for (const node of this.graph._nodes) { + if ((node.type === "SetNode" || node.type === "GetNode") && node.drawConnection && !visible.includes(node)) { + visible.push(node); + } + } + return visible; + }; + + // Monkey-patch: no extension hook exists for custom canvas drawing. + // Draws virtual links between Set/Get pairs. + // Handles per-node "Show connections", "selected" mode, and "always" mode. + const origCanvasOnDrawBackground = app.canvas.onDrawBackground; + app.canvas.onDrawBackground = function(ctx, visibleArea) { + origCanvasOnDrawBackground?.call(this, ctx, visibleArea); + + const graph = this.graph || app.graph; + if (!graph?._nodes) return; + const mode = getShowLinksMode(); + + // Build set of selected Set/Get names for "selected" mode + let selectedNames = null; + if (mode === "selected") { + const sel = Object.values(this.selected_nodes || {}); + if (!sel.length) { + // No selection — still honor per-node drawConnection + if (!graph._nodes.some(n => n.type === 'SetNode' && n.drawConnection)) return; + } else { + selectedNames = new Set(); + for (const n of sel) { + if (n.type === 'SetNode' || n.type === 'GetNode') { + selectedNames.add(n.widgets?.[0]?.value ?? n.title); + } + } + if (!selectedNames.size && !graph._nodes.some(n => n.type === 'SetNode' && n.drawConnection)) return; + } + } else if (mode === "never") { + if (!graph._nodes.some(n => n.type === 'SetNode' && n.drawConnection)) return; + } + + // Collect all GetNodes once across current graph + descendants, grouped by name. + // This avoids re-discovering descendant graphs and re-scanning nodes per SetNode. + const gettersByName = new Map(); + const scopeGraphs = [graph, ...getGraphDescendants(graph)]; + for (const g of scopeGraphs) { + if (!g?._nodes) continue; + for (const node of g._nodes) { + if (node.type !== 'GetNode') continue; + const n = node.widgets?.[0]?.value; + if (!n) continue; + let list = gettersByName.get(n); + if (!list) { list = []; gettersByName.set(n, list); } + list.push(node); + } + } + + for (const setNode of graph._nodes) { + if (setNode.type !== 'SetNode') continue; + const name = setNode.widgets?.[0]?.value ?? setNode.title; + const showByMode = mode === "always" || (mode === "selected" && selectedNames?.has(name)); + if (!showByMode && !setNode.drawConnection) continue; + + const allGetters = gettersByName.get(name) || []; + const drawTargets = []; + const seenSubgraphs = new Set(); + for (const getter of allGetters) { + if (getter.graph === graph) { + drawTargets.push(getter); + } else { + const sgNode = findSubgraphNodeFor(graph, getter); + if (sgNode && !seenSubgraphs.has(sgNode)) { + seenSubgraphs.add(sgNode); + drawTargets.push(sgNode); + } + } + } + if (!drawTargets.length) continue; + + const linkType = setNode.inputs[0]?.type; + const slotColor = app.canvas.default_connection_color_byType?.[linkType] + || LGraphCanvas.link_type_colors?.[linkType] + || setNode.bgcolor + || (setNode.slotColor !== "#FFF" ? setNode.slotColor : null) || "#AAA"; + + const startPos = setNode.getConnectionPos(false, 0); + + for (const target of drawTargets) { + const endPos = target.getConnectionPos(true, 0); + const highlighted = setNode.is_selected || target.is_selected; + const color = highlighted ? "#FFF" : slotColor; + app.canvas.renderLink( + ctx, + startPos, + endPos, + null, + false, + null, + color, + LiteGraph.RIGHT, + LiteGraph.LEFT + ); + } + } + }; + + app.ui.settings.addSetting({ + id: "KJNodes.filterGetNodeOptions", + name: "Filter Get node options by type", + category: ["KJNodes", "Set & Get", "Filter Get node options by type"], + tooltip: "When a Get node is connected, only show Set nodes with compatible types in the dropdown", + type: "boolean", + defaultValue: true, + }); + app.ui.settings.addSetting({ + id: "KJNodes.convertAllSetGet", + name: "Convert ALL Set/Get to links", + category: ["KJNodes", "Set & Get", "Convert ALL Set/Get to links"], + tooltip: "Replaces all Set/Get node pairs with direct links, including across subgraph boundaries (irreversible)", + type: () => { + const btn = document.createElement("button"); + btn.textContent = "Convert ALL Set/Get to links"; + btn.style.cssText = "padding: 6px 12px; cursor: pointer;"; + btn.onclick = () => { + if (confirm("This will replace ALL Set/Get pairs with direct links. This is irreversible. Continue?")) { + convertAllSetGetToLinks(app.graph); + app.canvas?.setDirty(true, true); + app.extensionManager.toast.add({ + severity: 'info', + summary: "KJ Set/Get", + detail: "All Set/Get nodes converted to direct links", + life: 3000, + }); + } + }; + return btn; + }, + defaultValue: false, + }); + } +}); + +// Temporary backwards-compat patch: makes cross-subgraph Set/Get work on frontends +// that don't natively support resolveVirtualOutput. Remove when no longer needed. +app.registerExtension({ + name: "KJNodes.CrossGraphSetGet", + setup() { + let patched = false; + + const originalGraphToPrompt = app.graphToPrompt.bind(app); + app.graphToPrompt = async function(...args) { + if (!patched) { + try { + const subgraphNode = app.graph._nodes.find(n => typeof n.getInnerNodes === 'function'); + if (subgraphNode) { + const tempMap = new Map(); + const dtos = subgraphNode.getInnerNodes(tempMap, []); + if (dtos.length > 0) { + const proto = Object.getPrototypeOf(dtos[0]); + const DtoClass = proto.constructor; + const nativeSource = proto.resolveOutput.toString(); + const hasNativeSupport = nativeSource.includes('resolveVirtualOutput'); + console.log(`[KJNodes] Cross-graph Set/Get: frontend native support ${hasNativeSupport ? 'detected, skipping patch' : 'not found, applying patch'}`); + if (!hasNativeSupport) { + const origResolveOutput = proto.resolveOutput; + proto.resolveOutput = function(slot, type, visited) { + if (typeof this.node?.resolveVirtualOutput === 'function') { + const virtualSource = this.node.resolveVirtualOutput(slot); + if (virtualSource) { + const inputNodeDto = [...this.nodesByExecutionId.values()] + .find(dto => dto instanceof DtoClass && dto.node === virtualSource.node); + if (inputNodeDto) { + return inputNodeDto.resolveOutput(virtualSource.slot, type, visited); + } + throw new Error(`KJNodes: No DTO found for cross-graph source node [${virtualSource.node.id}]`); + } + } + return origResolveOutput.call(this, slot, type, visited); + }; + } + patched = true; + } + } + } catch (e) { + console.warn('[KJNodes] Failed to probe ExecutableNodeDTO for cross-graph patch:', e); + } + } + return originalGraphToPrompt(...args); + }; + } +}); + +// Monkey-patch: no hook exists to extend the link context menu. +// Appends a "Convert to Set/Get" entry by counting DOM menus before/after +// the original call to find the newly created one. Fragile but unavoidable. +app.registerExtension({ + name: "KJNodes.LinkToSetGet", + setup() { + const originalShowLinkMenu = LGraphCanvas.prototype.showLinkMenu; + LGraphCanvas.prototype.showLinkMenu = function(segment, e) { + const menusBefore = document.querySelectorAll(".litecontextmenu").length; + const result = originalShowLinkMenu.call(this, segment, e); + + const graph = this.graph; + if (!graph) return result; + + // Get the full link object to access target info + const link = getLink(graph, segment.id); + if (!link || link.origin_id == null || link.target_id == null) return result; + + // Find the newly created context menu + const menus = document.querySelectorAll(".litecontextmenu"); + if (menus.length <= menusBefore) return result; + const lastMenu = menus[menus.length - 1]; + if (!lastMenu) return result; + + const entries = lastMenu.querySelector(".litemenu-entry")?.parentElement; + if (!entries) return result; + + // Create separator + const separator = document.createElement("div"); + separator.className = "litemenu-entry separator"; + entries.appendChild(separator); + + // Create menu entry + const menuItem = document.createElement("div"); + menuItem.className = "litemenu-entry submenu"; + menuItem.textContent = "Convert to Set/Get"; + entries.appendChild(menuItem); + + const canvas = this; + menuItem.addEventListener("click", function() { + // Close menu + lastMenu.remove(); + + const originNode = graph.getNodeById(link.origin_id); + const targetNode = graph.getNodeById(link.target_id); + if (!originNode || !targetNode) return; + + const outputSlot = originNode.outputs[link.origin_slot]; + const linkType = outputSlot?.type || "*"; + const linkName = outputSlot?.name || linkType; + + // Create Set node near the source + const setNode = LiteGraph.createNode("SetNode"); + if (!setNode) return; + setNode.pos = [ + originNode.pos[0] + originNode.size[0] + 30, + originNode.pos[1] + ]; + graph.add(setNode); + + // Create Get node near the target + const getNode = LiteGraph.createNode("GetNode"); + if (!getNode) return; + graph.add(getNode); + getNode.pos = [ + targetNode.pos[0] - getNode.size[0] - 30, + targetNode.pos[1] + ]; + + // Remove the original link + graph.removeLink(link.id); + + // Connect source -> Set node input + originNode.connect(link.origin_slot, setNode, 0); + + // Set the name widget on the Set node + setNode.widgets[0].value = linkName; + setNode.title = (!getDisablePrefix() ? "Set_" : "") + linkName; + setNode.validateName(graph); + setNode.properties.previousName = setNode.widgets[0].value; + + // Update Get node to match + const finalName = setNode.widgets[0].value; + getNode.widgets[0].value = finalName; + getNode.onRename(); + + // Connect Get node output -> target node input + getNode.connect(0, targetNode, link.target_slot); + + canvas.setDirty(true, true); + }); + + return result; + }; + } +}); diff --git a/docs/hel-892/scail-load-reference/kj-aux-change.json b/docs/hel-892/scail-load-reference/kj-aux-change.json new file mode 100644 index 00000000..3526c54f --- /dev/null +++ b/docs/hel-892/scail-load-reference/kj-aux-change.json @@ -0,0 +1 @@ +{"sha":"e56b3061ed49251a7b8a5450a2e18295548ea7a1","node_id":"C_kwDOKZZTCtoAKGU1NmIzMDYxZWQ0OTI1MWE3YjhhNTQ1MGEyZTE4Mjk1NTQ4ZWE3YTE","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-30T23:58:46Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-30T23:58:46Z"},"message":"Update aux_id to match what's expected","tree":{"sha":"0d93d39a73d65a3576ced12b9db54e09a775c127","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/0d93d39a73d65a3576ced12b9db54e09a775c127"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/e56b3061ed49251a7b8a5450a2e18295548ea7a1","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/e56b3061ed49251a7b8a5450a2e18295548ea7a1","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/e56b3061ed49251a7b8a5450a2e18295548ea7a1","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/e56b3061ed49251a7b8a5450a2e18295548ea7a1/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"276955e45fa48c794b47bf49dbc22f2d955d76a8","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/276955e45fa48c794b47bf49dbc22f2d955d76a8","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/276955e45fa48c794b47bf49dbc22f2d955d76a8"}],"stats":{"total":4,"additions":2,"deletions":2},"files":[{"sha":"f24ba869229f6472590589a2d1ed699d79478f87","filename":"web/js/setgetnodes.js","status":"modified","additions":2,"deletions":2,"changes":4,"blob_url":"https://github.com/kijai/ComfyUI-KJNodes/blob/e56b3061ed49251a7b8a5450a2e18295548ea7a1/web%2Fjs%2Fsetgetnodes.js","raw_url":"https://github.com/kijai/ComfyUI-KJNodes/raw/e56b3061ed49251a7b8a5450a2e18295548ea7a1/web%2Fjs%2Fsetgetnodes.js","contents_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/contents/web%2Fjs%2Fsetgetnodes.js?ref=e56b3061ed49251a7b8a5450a2e18295548ea7a1","patch":"@@ -540,7 +540,7 @@ app.registerExtension({\n \t\t\t\t\t};\n \t\t\t\t}\n \t\t\t\tthis.properties[\"Node name for S&R\"] = \"SetNode\";\n-\t\t\t\tthis.properties[\"aux_id\"] = \"SetNode\";\n+\t\t\t\tthis.properties[\"aux_id\"] = \"kijai/ComfyUI-KJNodes\";\n \t\t\t\tthis.isVirtualNode = true; // This node is purely frontend and does not impact the resulting prompt so should not be serialized\n \n \t\t\t\tthis.addWidget(\n@@ -873,7 +873,7 @@ app.registerExtension({\n \t\t\t\t\tthis.properties = {};\n \t\t\t\t}\n \t\t\t\tthis.properties[\"Node name for S&R\"] = \"GetNode\";\n-\t\t\t\tthis.properties[\"aux_id\"] = \"GetNode\";\n+\t\t\t\tthis.properties[\"aux_id\"] = \"kijai/ComfyUI-KJNodes\";\n \t\t\t\tthis.isVirtualNode = true; // This node is purely frontend and does not impact the resulting prompt so should not be serialized\n \t\t\t\tconst comboOptions = {\n \t\t\t\t\tgetOptionLabel: (value) => {"}]} \ No newline at end of file diff --git a/docs/hel-892/scail-load-reference/kj-e56b3061ed49251a7b8a5450a2e18295548ea7a1__LICENSE b/docs/hel-892/scail-load-reference/kj-e56b3061ed49251a7b8a5450a2e18295548ea7a1__LICENSE new file mode 100644 index 00000000..f288702d --- /dev/null +++ b/docs/hel-892/scail-load-reference/kj-e56b3061ed49251a7b8a5450a2e18295548ea7a1__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/scail-load-reference/kj-e56b3061ed49251a7b8a5450a2e18295548ea7a1__setgetnodes.js b/docs/hel-892/scail-load-reference/kj-e56b3061ed49251a7b8a5450a2e18295548ea7a1__setgetnodes.js new file mode 100644 index 00000000..f24ba869 --- /dev/null +++ b/docs/hel-892/scail-load-reference/kj-e56b3061ed49251a7b8a5450a2e18295548ea7a1__setgetnodes.js @@ -0,0 +1,1566 @@ +const { app } = window.comfyAPI.app; + +// originally based on diffus3's SetGet: https://github.com/diffus3/ComfyUI-extensions + +// Nodes that allow you to hide connections for cleaner graphs + +let _typeColorMap; +function setColorAndBgColor(node, type) { + if (!_typeColorMap) { + _typeColorMap = { + "DEFAULT": LGraphCanvas.node_colors.gray, + "MODEL": LGraphCanvas.node_colors.blue, + "LATENT": LGraphCanvas.node_colors.purple, + "VAE": LGraphCanvas.node_colors.red, + "WANVAE": LGraphCanvas.node_colors.red, + "CONDITIONING": LGraphCanvas.node_colors.brown, + "IMAGE": LGraphCanvas.node_colors.pale_blue, + "CLIP": LGraphCanvas.node_colors.yellow, + "FLOAT": LGraphCanvas.node_colors.green, + "MASK": { color: "#1c5715", bgcolor: "#1f401b"}, + "INT": { color: "#1b4669", bgcolor: "#29699c"}, + "CONTROL_NET": { color: "#156653", bgcolor: "#1c453b"}, + "NOISE": { color: "#2e2e2e", bgcolor: "#242121"}, + "GUIDER": { color: "#3c7878", bgcolor: "#1c453b"}, + "SAMPLER": { color: "#614a4a", bgcolor: "#3b2c2c"}, + "SIGMAS": { color: "#485248", bgcolor: "#272e27"}, + }; + } + const colors = _typeColorMap[type] || LGraphCanvas.node_colors?.gray; + if (colors) { + node.color = colors.color; + node.bgcolor = colors.bgcolor; + } +} +function getDisablePrefix() { + return app.ui.settings.getSettingValue("KJNodes.disablePrefix") ?? false; +} +// Temporary map for paste rename coordination between Set and Get nodes. +// Key: old name, Value: new name. Cleared via setTimeout(0) after each paste cycle. +// This works because both onConfigure calls (Set + Get) fire synchronously within +// the same paste operation, before the timeout clears the entry. +const _pasteRenameMap = new Map(); + +let _forceShowAllLinks = false; + +function getShowLinksMode() { + if (_forceShowAllLinks) return "always"; + return app.ui.settings.getSettingValue("KJNodes.showSetGetLinks") ?? "never"; +} +const LGraphNode = LiteGraph.LGraphNode + +// Cross-graph traversal utilities with lexical scoping for subgraph support. +// Set nodes propagate downward: a Set in a parent graph is visible to all descendant subgraphs. +// Get nodes look upward: a Get searches its own graph first, then parent, then grandparent, etc. +// Duplicate names are allowed across unrelated (sibling) subgraphs. + +function findRootGraph(graph) { + if (!graph) return null; + return graph.rootGraph || graph; +} + +// Find which SubgraphNode in parentGraph wraps the given subgraph +function findSubgraphNodeFor(parentGraph, innerNode) { + if (!parentGraph?._nodes || !innerNode?.graph) return null; + for (const n of parentGraph._nodes) { + if (n.subgraph && n.subgraph === innerNode.graph) return n; + } + return null; +} + +// Walk from a subgraph up to root, returning [graph, parent, grandparent, ..., root] +function getGraphAncestors(graph) { + if (!graph) return []; + const root = findRootGraph(graph); + if (!root || graph === root) return [root]; + + const chain = [graph]; + const visited = new Set([graph]); + let current = graph; + // Walk up: find which SubgraphNode wraps current, then get its parent graph + while (current !== root) { + let found = false; + // Search root nodes + for (const n of root._nodes) { + if (n.subgraph === current) { + chain.push(root); + current = root; + found = true; + break; + } + } + if (found) break; + // Search sibling subgraphs (for nested subgraphs) + const subgraphs = root._subgraphs || root.subgraphs; + if (subgraphs) { + for (const sg of subgraphs.values()) { + if (sg === current || !sg._nodes) continue; + for (const n of sg._nodes) { + if (n.subgraph === current) { + if (visited.has(sg)) { found = false; break; } + visited.add(sg); + chain.push(sg); + current = sg; + found = true; + break; + } + } + if (found) break; + } + } + if (!found) { + // Can't find parent, add root as fallback + if (!chain.includes(root)) chain.push(root); + break; + } + } + return chain; +} + +// Get all descendant subgraphs of a graph (children, grandchildren, etc.) +function getGraphDescendants(graph, _visited) { + if (!graph?._nodes) return []; + const visited = _visited || new Set(); + if (visited.has(graph)) return []; + visited.add(graph); + const descendants = []; + for (const n of graph._nodes) { + if (n.subgraph && !visited.has(n.subgraph)) { + descendants.push(n.subgraph); + descendants.push(...getGraphDescendants(n.subgraph, visited)); + } + } + return descendants; +} + +// Collect nodes of a type from specific graphs +function collectNodesOfType(graphs, type) { + const results = []; + for (const g of graphs) { + if (!g?._nodes) continue; + for (const node of g._nodes) { + if (node.type === type) results.push({ node, graph: g }); + } + } + return results; +} + +// Find all nodes of type across ALL graphs (root + all subgraphs). Used for global operations. +function findAllNodesOfType(graph, type) { + const root = findRootGraph(graph); + if (!root) return []; + const allGraphs = [root]; + const subgraphs = root._subgraphs || root.subgraphs; + if (subgraphs) { + for (const sg of subgraphs.values()) allGraphs.push(sg); + } + return collectNodesOfType(allGraphs, type); +} + +// Scoped setter lookup: search current graph, then ancestors (look up). +function findSetterByName(graph, name) { + if (!name) return null; + for (const g of getGraphAncestors(graph)) { + if (!g?._nodes) continue; + for (const node of g._nodes) { + if (node.type === 'SetNode' && node.widgets[0].value === name) { + return { node, graph: g }; + } + } + } + return null; +} + +// Scoped getter lookup: search current graph + descendants (propagate down). +function findGettersByName(graph, name) { + if (!name) return []; + const graphs = [graph, ...getGraphDescendants(graph)]; + return collectNodesOfType(graphs, 'GetNode') + .filter(entry => entry.node.widgets[0].value === name); +} + +// Get all visible SetNode names for a GetNode's combo dropdown. +// Shows names from current graph + ancestors (what's in scope). +// Also builds a source map for getOptionLabel. This module-level variable is safe +// because the values getter and getOptionLabel run in the same synchronous render pass. +let _setNameSourceMap = new Map(); + +function getVisibleSetNames(graph, filterType) { + const sourceMap = new Map(); + const ancestors = getGraphAncestors(graph); + const entries = collectNodesOfType(ancestors, 'SetNode'); + for (const e of entries) { + const name = e.node.widgets[0].value; + if (!name) continue; + if (filterType && filterType !== '*') { + const setType = e.node.inputs[0]?.type; + if (setType && setType !== '*') { + const filterTypes = String(filterType).split(","); + if (!filterTypes.some(ft => ft === setType || setType.split(",").includes(ft))) continue; + } + } + if (!sourceMap.has(name)) { + sourceMap.set(name, e.graph === graph ? "local" : "parent"); + } + } + _setNameSourceMap = sourceMap; + return [...sourceMap.keys()].sort(); +} + +// Exposed globally for use in contextmenu.js +window.kjNodes = window.kjNodes || {}; +window.kjNodes.convertOutputsToSetGet = convertOutputsToSetGet; +window.kjNodes.snapshotSelectedNodes = snapshotSelectedNodes; +function convertOutputsToSetGet(graph, node) { + if (!graph || !node) return; + for (let slotIdx = 0; slotIdx < node.outputs.length; slotIdx++) { + const output = node.outputs[slotIdx]; + if (!output.links || output.links.length === 0) continue; + + const linkType = output.type || "*"; + const linkName = output.name || linkType; + + // Collect targets and link IDs to remove, skipping existing Set/Get nodes + const targets = []; + const linksToRemove = []; + for (const linkId of [...output.links]) { + const link = getLink(graph, linkId); + if (link) { + const targetNode = graph.getNodeById(link.target_id); + if (targetNode && targetNode.type !== 'SetNode' && targetNode.type !== 'GetNode') { + targets.push({ targetId: link.target_id, targetSlot: link.target_slot }); + linksToRemove.push(linkId); + } + } + } + if (targets.length === 0) continue; + + // Create Set node + const setNode = LiteGraph.createNode("SetNode"); + if (!setNode) continue; + setNode.pos = [ + node.pos[0] + node.size[0] + 30, + node.pos[1] + slotIdx * 60 + ]; + graph.add(setNode); + setNode.flags.collapsed = true; + + for (const linkId of linksToRemove) graph.removeLink(linkId); + + // Connect source → Set node input + node.connect(slotIdx, setNode, 0); + + // Set the name widget + setNode.widgets[0].value = linkName; + setNode.title = (!getDisablePrefix() ? "Set_" : "") + linkName; + setNode.validateName(graph); + const finalName = setNode.widgets[0].value; + setNode.properties.previousName = finalName; + + // Create a Get node for each target + for (const target of targets) { + const targetNode = graph.getNodeById(target.targetId); + if (!targetNode) continue; + + const getNode = LiteGraph.createNode("GetNode"); + if (!getNode) continue; + getNode.pos = [ + targetNode.pos[0] - getNode.size[0] - 30, + targetNode.pos[1] + ]; + graph.add(getNode); + getNode.flags.collapsed = true; + + getNode.widgets[0].value = finalName; + getNode.onRename(); + + getNode.connect(0, targetNode, target.targetSlot); + } + } + app.canvas.setDirty(true, true); +} + +// Snapshot selection immediately (before right-click changes it) +function snapshotSelectedNodes(node, typeFilter) { + const selected = Object.values(app.canvas.selected_nodes || {}); + // Always include the right-clicked node, even if selection state is inconsistent + const nodeSet = new Set(selected); + nodeSet.add(node); + let nodes = [...nodeSet]; + if (typeFilter) nodes = nodes.filter(n => n.type === typeFilter); + return nodes; +} + +// Tracks nodes flagged with has_errors so they can be cleared on the next alert. +// Always cleared before repopulating, so it only holds nodes from the most recent alert. +const _errorNodes = new Set(); +function showAlert(message, nodes) { + const nodeList = nodes ? (Array.isArray(nodes) ? nodes : [nodes]) : []; + const nodeInfo = nodeList.map(n => + `${n.title || n.type} [${Math.round(n.pos[0])}, ${Math.round(n.pos[1])}]` + ).join(', '); + if (nodeList.length) { + // Clear previous error flags + for (const n of _errorNodes) n.has_errors = false; + _errorNodes.clear(); + setTimeout(() => { + for (const n of nodeList) { + n.has_errors = true; + _errorNodes.add(n); + } + app.canvas?.setDirty(true, true); + }, 100); + } + app.extensionManager.toast.add({ + severity: 'warn', + summary: "KJ Set/Get", + detail: nodeInfo ? `${message} — ${nodeInfo}` : message, + life: 5000, + }); +} +function convertAllSetGetToLinks(graph) { + if (!graph) return; + const rootGraph = findRootGraph(graph); + + // First pass: handle cross-graph pairs (must run before same-graph + // because converting cross-graph creates real links that replace + // the Set/Get, and same-graph pass would miss the removed nodes) + const allSetEntries = findAllNodesOfType(rootGraph, 'SetNode'); + for (const { node: setNode, graph: setGraph } of [...allSetEntries]) { + const name = setNode.widgets[0].value; + if (!name) continue; + const allGetEntries = findGettersByName(rootGraph, name); + const crossGraphGetters = allGetEntries.filter(e => e.graph !== setGraph); + if (crossGraphGetters.length > 0) { + convertCrossGraphSetGet(setNode, setGraph, crossGraphGetters); + } + } + + // Second pass: handle remaining same-graph pairs + for (const { node: setNode, graph: g } of [...findAllNodesOfType(rootGraph, 'SetNode')]) { + convertSetGetToLinks(g, setNode); + } +} + +// Compat shim: older frontends may lack graph.getLink(), and _links may be a Map or +// plain object depending on the litegraph version. The == null check catches both null +// and undefined intentionally. +function getLink(graph, linkId) { + if (linkId == null) return null; + if (graph.getLink) return graph.getLink(linkId); + return graph._links instanceof Map ? graph._links.get(linkId) : graph._links?.[linkId] ?? null; +} + +// Collect {targetId, targetSlot} from an output slot's links +function collectOutputConnections(graph, output) { + const connections = []; + if (output?.links) { + for (const linkId of [...output.links]) { + const link = getLink(graph, linkId); + if (link) connections.push({ targetId: link.target_id, targetSlot: link.target_slot }); + } + } + return connections; +} + +function convertCrossGraphSetGet(setNode, setGraph, crossGraphGetters) { + // Find what's connected to the SetNode's input + const setInput = setNode.inputs[0]; + if (setInput.link == null) return; + const sourceLink = getLink(setGraph, setInput.link); + if (!sourceLink) return; + const sourceNode = setGraph.getNodeById(sourceLink.origin_id); + if (!sourceNode) return; + const sourceSlot = sourceLink.origin_slot; + const linkType = setNode.inputs[0].type || '*'; + + for (const { node: getter, graph: getterGraph } of crossGraphGetters) { + // Collect getter's downstream connections before removing it + const connections = collectOutputConnections(getterGraph, getter.outputs[0]); + if (connections.length === 0) { + getterGraph.remove(getter); + continue; + } + + // Determine direction and create SubgraphInput or SubgraphOutput + const rootGraph = findRootGraph(setGraph); + const sgNodeForGetter = findSubgraphNodeFor(rootGraph, getter); + const sgNodeForSetter = findSubgraphNodeFor(rootGraph, setNode); + + if (sgNodeForGetter && setGraph === rootGraph) { + // Set in root, Get in subgraph → create SubgraphInput + const subgraph = sgNodeForGetter.subgraph; + const inputName = setNode.widgets[0].value || linkType; + const newInput = subgraph.addInput(inputName, linkType); + const inputIndex = subgraph.inputs.indexOf(newInput); + + // Connect source → SubgraphNode's new input in root graph + sourceNode.connect(sourceSlot, sgNodeForGetter, inputIndex); + + // Inside subgraph: connect SubgraphInput slot → getter's targets + for (const conn of connections) { + if (conn.targetId === subgraph.outputNode?.id) { + // GetNode fed a SubgraphOutput — bypass it and connect source directly in parent graph. + const sgNodeOutput = sgNodeForGetter.outputs[conn.targetSlot]; + if (sgNodeOutput?.links) { + for (const parentLinkId of [...sgNodeOutput.links]) { + const parentLink = getLink(rootGraph, parentLinkId); + if (parentLink) { + const parentTarget = rootGraph.getNodeById(parentLink.target_id); + if (parentTarget) { + sourceNode.connect(sourceSlot, parentTarget, parentLink.target_slot); + } + } + } + } + // Remove the now-unnecessary SubgraphOutput + const sgOutput = subgraph.outputs[conn.targetSlot]; + if (sgOutput) { + subgraph.removeOutput(sgOutput); + } + } else { + const targetNode = getterGraph.getNodeById(conn.targetId); + if (targetNode) { + newInput.connect(targetNode.inputs[conn.targetSlot], targetNode); + } + } + } + + // If no connections used the SubgraphInput, remove it + if (newInput.linkIds.length === 0) { + subgraph.removeInput(newInput); + } + + getterGraph.remove(getter); + + } else if (sgNodeForSetter && getterGraph === rootGraph) { + // Set in subgraph, Get in root → create SubgraphOutput + const subgraph = sgNodeForSetter.subgraph; + const outputName = setNode.widgets[0].value || linkType; + const newOutput = subgraph.addOutput(outputName, linkType); + const outputIndex = subgraph.outputs.indexOf(newOutput); + + // Inside subgraph: connect source output → SubgraphOutput slot + newOutput.connect(sourceNode.outputs[sourceSlot], sourceNode); + + // In root graph: connect SubgraphNode's new output → getter's targets + for (const conn of connections) { + const targetNode = getterGraph.getNodeById(conn.targetId); + if (targetNode) { + sgNodeForSetter.connect(outputIndex, targetNode, conn.targetSlot); + } + } + + getterGraph.remove(getter); + + } else { + // Both in different subgraphs (sibling) — would need both input and output + // Skip for now, too complex + console.warn(`KJNodes: Cannot convert cross-graph Set/Get "${setNode.widgets[0].value}" between sibling subgraphs`); + } + } + + // Remove SetNode if all its getters have been handled (check if any same-graph getters remain) + const remainingGetters = setGraph._nodes.filter( + n => n.type === 'GetNode' && n.widgets[0].value === setNode.widgets[0].value + ); + if (remainingGetters.length === 0) { + setGraph.remove(setNode); + } +} + +function convertSetGetToLinks(graph, setNode) { + if (!graph || !setNode) return; + + const name = setNode.widgets[0].value; + let sameGraphGetters = []; + if (name) { + const allGetters = findGettersByName(graph, name); + const crossGetters = []; + for (const entry of allGetters) { + if (entry.graph === graph) sameGraphGetters.push(entry.node); + else crossGetters.push(entry); + } + if (crossGetters.length > 0) { + convertCrossGraphSetGet(setNode, graph, crossGetters); + } + } + + // Find the source connected to the Set node's input + const setInput = setNode.inputs[0]; + if (setInput.link == null) return; + const sourceLink = getLink(graph, setInput.link); + if (!sourceLink) return; + const sourceNode = graph.getNodeById(sourceLink.origin_id); + if (!sourceNode) return; + const sourceSlot = sourceLink.origin_slot; + + // Collect all consumer connections from Get nodes and SetNode's own output passthrough + const connections = []; + for (const getter of sameGraphGetters) { + connections.push(...collectOutputConnections(graph, getter.outputs[0])); + } + connections.push(...collectOutputConnections(graph, setNode.outputs[0])); + + // Remove all Get nodes (this also removes their links) + for (const getter of sameGraphGetters) { + graph.remove(getter); + } + // Remove the Set node + graph.remove(setNode); + + // Create direct links from source to each consumer + for (const conn of connections) { + const targetNode = graph.getNodeById(conn.targetId); + if (targetNode) { + sourceNode.connect(sourceSlot, targetNode, conn.targetSlot); + } + } + + app.canvas?.setDirty(true, true); +} + +// region SetNode +app.registerExtension({ + name: "KJNodes.SetNode", + registerCustomNodes() { + class SetNode extends LGraphNode { + static title = "Set"; + static category = "KJNodes"; + serialize_widgets = true; + drawConnection = false; + slotColor = "#FFF"; + canvas = app.canvas; + + constructor(title) { + super(title) + if (!this.properties) { + this.properties = { + "previousName": "" + }; + } + this.properties["Node name for S&R"] = "SetNode"; + this.properties["aux_id"] = "kijai/ComfyUI-KJNodes"; + this.isVirtualNode = true; // This node is purely frontend and does not impact the resulting prompt so should not be serialized + + this.addWidget( + "text", + "Constant", + '', + () => { + if (!this.graph || app.configuringGraph) return; + this.validateName(this.graph); + if (this.widgets[0].value !== '') { + this.title = (!getDisablePrefix() ? "Set_" : "") + this.widgets[0].value; + } + this.update(); + this.properties.previousName = this.widgets[0].value; + }, + {} + ) + + this.addInput("*", "*"); + this.addOutput("*", '*'); + } + + onConnectionsChange( + slotType, + slot, + isChangeConnect, + link_info + ) { + // During graph load, slots are restored by configure — skip side effects + if (app.configuringGraph) return; + //On Disconnect + if (slotType === LiteGraph.INPUT && !isChangeConnect) { + const outputConnected = this.outputs[0]?.links?.length > 0; + if (outputConnected) { + this.inputs[slot].type = this.outputs[0].type; + this.inputs[slot].name = this.outputs[0].name; + } else { + this.inputs[slot].type = '*'; + this.inputs[slot].name = '*'; + this.outputs[0].type = '*'; + this.outputs[0].name = '*'; + this.title = "Set"; + this.color = null; + this.bgcolor = null; + } + this.update(); + } + if (slotType === LiteGraph.OUTPUT && !isChangeConnect) { + if (this.outputs && this.outputs[slot]) { + // Keep type if input has a real connection + const inputConnected = this.inputs[0]?.link != null; + if (inputConnected) { + this.outputs[slot].type = this.inputs[0].type; + this.outputs[slot].name = this.inputs[0].name; + } else { + this.inputs[0].type = '*'; + this.inputs[0].name = '*'; + this.outputs[slot].type = '*'; + this.outputs[slot].name = '*'; + this.color = null; + this.bgcolor = null; + } + } + } + //On Connect + if (link_info && this.graph && slotType === LiteGraph.INPUT && isChangeConnect) { + const resolve = link_info.resolve(this.graph) + const resolvedSlot = resolve?.subgraphInput ?? resolve?.output; + const type = resolvedSlot?.type; + if (type) { + if (this.title === "Set"){ + this.title = (!getDisablePrefix() ? "Set_" : "") + type; + } + if (this.widgets[0].value === '' || this.widgets[0].value === '*'){ + // Determine the initial widget value based on naming setting + const namingMode = app.ui.settings.getSettingValue("KJNodes.setGetNaming") ?? "empty"; + if (namingMode !== "empty") { + const link = getLink(this.graph, this.inputs[0]?.link); + const sourceNode = link ? this.graph.getNodeById(link.origin_id) : null; + const slotName = sourceNode?.outputs?.[link?.origin_slot]?.name || type; + switch (namingMode) { + case "slot name": this.widgets[0].value = slotName; break; + case "slot name (lowercase)": this.widgets[0].value = slotName.toLowerCase(); break; + case "slot name (UPPERCASE)": this.widgets[0].value = slotName.toUpperCase(); break; + } + } + } + + this.validateName(this.graph); + this.properties.previousName = this.widgets[0].value; + this.inputs[0].type = type; + this.inputs[0].name = type; + this.outputs[0].type = type; + this.outputs[0].name = type; + + if (app.ui.settings.getSettingValue("KJNodes.nodeAutoColor")){ + setColorAndBgColor(this, type); + } + } else { + showAlert(`node ${this.title} input undefined.`, this) + } + } + if (link_info && this.graph && slotType === LiteGraph.OUTPUT && isChangeConnect) { + // Prefer input type; fall back to target's input type + const inputType = this.inputs[0]?.type; + if (inputType && inputType !== '*') { + this.outputs[0].type = inputType; + this.outputs[0].name = inputType; + } else { + const resolve = link_info.resolve(this.graph); + const type = resolve?.input?.type; + if (type && type !== '*') { + this.inputs[0].type = type; + this.inputs[0].name = type; + this.outputs[0].type = type; + this.outputs[0].name = type; + if (app.ui.settings.getSettingValue("KJNodes.nodeAutoColor")){ + setColorAndBgColor(this, type); + } + } + } + } + + //Update either way + this.update(); + } + + // Returns true if the name was changed + validateName(graph, sameGraphOnly) { + let widgetValue = this.widgets[0].value; + + if (widgetValue !== '') { + let tries = 0; + const existingValues = new Set(); + + // sameGraphOnly: only check the immediate graph (for paste/clone) + // otherwise check full scope (own graph + ancestors) + const scopeGraphs = sameGraphOnly ? [graph] : getGraphAncestors(graph); + const scopedSetNodes = collectNodesOfType(scopeGraphs, 'SetNode'); + scopedSetNodes.forEach(entry => { + if (entry.node !== this) { + existingValues.add(entry.node.widgets[0].value); + } + }); + + const originalValue = widgetValue; + // Only strip _N suffix during paste to avoid FOO_0_1_2 accumulation. + // For manual renames, keep the full name as base (user may intend FOO_3). + const baseName = this._justAdded ? widgetValue.replace(/_\d+$/, '') : widgetValue; + while (existingValues.has(widgetValue)) { + widgetValue = baseName + "_" + tries; + tries++; + } + + this.widgets[0].value = widgetValue; + this.title = (!getDisablePrefix() ? "Set_" : "") + widgetValue; + return widgetValue !== originalValue; + } + return false; + } + + clone() { + const cloned = super.clone(); + cloned.inputs[0].name = '*'; + cloned.inputs[0].type = '*'; + cloned.properties.previousName = ''; + cloned.size = cloned.computeSize(); + return cloned; + } + + onAdded() { + this._justAdded = true; + } + + onConfigure() { + // Only run paste logic when actually pasting, not during workflow load + if (this._justAdded && this.graph && !app.configuringGraph) { + const oldName = this.widgets[0].value; + this.validateName(this.graph, true); + this._justAdded = false; + const newName = this.widgets[0].value; + if (newName !== oldName) { + _pasteRenameMap.set(oldName, newName); + // Clear the map after this paste cycle + setTimeout(() => _pasteRenameMap.delete(oldName), 0); + } + // Reset type and color on paste — nothing is connected yet + if (this.inputs[0]?.link == null) { + this.inputs[0].type = '*'; + this.inputs[0].name = '*'; + this.outputs[0].type = '*'; + this.outputs[0].name = '*'; + this.color = null; + this.bgcolor = null; + } + } + this._justAdded = false; + } + + update() { + if (!this.graph) return; + + const getters = this.findGetters(this.graph); + getters.forEach(getter => { + getter.setType(this.inputs[0].type); + }); + + if (this.widgets[0].value && this.properties.previousName) { + const gettersWithPreviousName = this.findGetters(this.graph, true); + gettersWithPreviousName.forEach(getter => { + getter.setName(this.widgets[0].value); + }); + } + app.canvas?.setDirty(true, true); + } + + findGetters(graph, checkForPreviousName) { + const name = checkForPreviousName ? this.properties.previousName : this.widgets[0].value; + if (!name || name === '') return []; + // Scoped: searches own graph + descendant subgraphs + return findGettersByName(graph, name).map(entry => entry.node); + } + + getExtraMenuOptions(_, options) { + options.unshift( + { + content: this.drawConnection ? "Hide connections" : "Show connections", + callback: () => { + this.drawConnection = !this.drawConnection; + const linkType = this.inputs[0].type; + this.slotColor = this.canvas.default_connection_color_byType[linkType]; + this.canvas.setDirty(true, true); + }, + }, + { + content: "Hide all connections", + callback: () => { + for (const n of this.graph._nodes) { + if (n.type === "GetNode" || n.type === "SetNode") n.drawConnection = false; + } + this.canvas.setDirty(true, true); + }, + + }, + ); + options.unshift({ + content: "Convert to links", + callback: () => { + const graph = this.graph; + for (const n of snapshotSelectedNodes(this, 'SetNode')) convertSetGetToLinks(graph, n); + }, + }); + options.unshift({ + content: "Add paired GetNode", + callback: () => { + const graph = this.graph; + const getNode = LiteGraph.createNode("GetNode"); + if (!getNode) return; + getNode.pos = [this.pos[0] + this.size[0] + 30, this.pos[1]]; + graph.add(getNode); + // Set the widget value to match — this drives type, color, and connection + const name = this.widgets[0].value; + if (getNode.widgets?.[0]) { + getNode.widgets[0].value = name; + } + getNode.onRename?.(); + app.canvas.selectNode(getNode, false); + app.canvas.setDirty(true, true); + }, + }); + // Dynamically add a submenu for all getters + const allGettersForMenu = this.findGetters(this.graph); + if (allGettersForMenu.length) { + let gettersSubmenu = allGettersForMenu.map(getter => { + const sameGraph = getter.graph === this.graph; + const sgNode = !sameGraph ? findSubgraphNodeFor(this.graph, getter) : null; + const label = sameGraph + ? `${getter.title} id: ${getter.id}` + : `${getter.title} (in subgraph${sgNode ? ': ' + (sgNode.title || sgNode.type) : ''})`; + return { + content: label, + callback: () => { + if (sameGraph) { + this.canvas.centerOnNode(getter); + this.canvas.selectNode(getter, false); + } else if (sgNode) { + this.canvas.openSubgraph(sgNode.subgraph, sgNode); + // Center on the getter after entering the subgraph + setTimeout(() => { + this.canvas.centerOnNode(getter); + this.canvas.selectNode(getter, false); + }, 0); + } + this.canvas.setDirty(true, true); + }, + }; + }); + + options.unshift({ + content: "Getters", + has_submenu: true, + submenu: { + title: "GetNodes", + options: gettersSubmenu, + } + }); + } + } + } + + LiteGraph.registerNodeType("SetNode", SetNode); + }, +}); + +// region GetNode +app.registerExtension({ + name: "KJNodes.GetNode", + registerCustomNodes() { + class GetNode extends LGraphNode { + static title = "Get"; + static category = "KJNodes"; + serialize_widgets = true; + drawConnection = false; + currentSetter = null; + canvas = app.canvas; + + constructor(title) { + super(title) + if (!this.properties) { + this.properties = {}; + } + this.properties["Node name for S&R"] = "GetNode"; + this.properties["aux_id"] = "kijai/ComfyUI-KJNodes"; + this.isVirtualNode = true; // This node is purely frontend and does not impact the resulting prompt so should not be serialized + const comboOptions = { + getOptionLabel: (value) => { + if (!value) return ""; + const source = _setNameSourceMap.get(value); + if (!source || source === "local") return value; + return `${value} (${source})`; + }, + }; + Object.defineProperty(comboOptions, 'values', { + get: () => { + if (!this.graph) return []; + let filterType = null; + if (app.ui.settings.getSettingValue("KJNodes.filterGetNodeOptions") !== false + && this.outputs[0]?.links?.length) { + const linkId = this.outputs[0].links[0]; + const link = getLink(this.graph, linkId); + if (link) { + const targetNode = this.graph.getNodeById(link.target_id); + filterType = targetNode?.inputs?.[link.target_slot]?.type || null; + } + } + return getVisibleSetNames(this.graph, filterType); + }, + enumerable: true, + configurable: true + }); + this.addWidget("combo", "Constant", "", () => { if (!app.configuringGraph) this.onRename(); }, comboOptions) + this.addOutput("*", '*'); + } + + onConnectionsChange() { + if (app.configuringGraph) return; + this.validateLinks(); + } + + setName(name) { + this.widgets[0].value = name; + this.onRename(); + this.serialize(); + } + + onRename() { + const setter = this.findSetter(this.graph); + if (setter) { + this.setType(setter.inputs[0].type); + this.title = (!getDisablePrefix() ? "Get_" : "") + setter.widgets[0].value; + } else { + this.setType('*'); + const name = this.widgets[0].value; + this.title = name ? (!getDisablePrefix() ? "Get_" : "") + name : "Get"; + } + app.canvas?.setDirty(true, true); + } + + clone() { + const cloned = super.clone(); + cloned.size = cloned.computeSize(); + return cloned; + } + + validateLinks() { + if (this.outputs[0].type !== '*' && this.outputs[0].links && this.graph) { + this.outputs[0].links.filter(linkId => { + const link = getLink(this.graph, linkId); + if (!link || !link.type) return false; + if (link.type === '*') return false; + const targetNode = this.graph.getNodeById(link.target_id); + const targetType = targetNode?.inputs?.[link.target_slot]?.type; + if (targetType === '*') return false; + if (targetType) { + const targetTypes = String(targetType).split(","); + if (targetTypes.includes(this.outputs[0].type)) return false; + } + return !link.type.split(",").includes(this.outputs[0].type); + }).forEach(linkId => { + this.graph.removeLink(linkId); + }); + } + } + + setType(type) { + this.outputs[0].name = type; + this.outputs[0].type = type; + this.validateLinks(); + if (app.ui.settings.getSettingValue("KJNodes.nodeAutoColor")) { + if (type === '*') { + this.color = null; + this.bgcolor = null; + } else { + setColorAndBgColor(this, type); + } + } + } + + findSetter(graph) { + const name = this.widgets[0].value; + // Scoped: searches own graph first, then ancestors + const result = findSetterByName(graph, name); + return result ? result.node : undefined; + } + + goToSetter() { + if (!this.currentSetter) return; + const setterGraph = this.currentSetter.graph; + if (setterGraph && setterGraph !== this.graph) { + this.canvas.setGraph(setterGraph); + setTimeout(() => { + this.canvas.centerOnNode(this.currentSetter); + this.canvas.selectNode(this.currentSetter, false); + this.canvas.setDirty(true, true); + }, 0); + } else { + this.canvas.centerOnNode(this.currentSetter); + this.canvas.selectNode(this.currentSetter, false); + } + } + + onAdded() { + this._justAdded = true; + } + + onConfigure() { + if (this._justAdded && !app.configuringGraph) { + const name = this.widgets[0].value; + if (name) { + // Check if our paired SetNode was renamed during this paste + const newName = _pasteRenameMap.get(name); + if (newName) { + this.widgets[0].value = newName; + } + // Restore type/color from setter after paste + setTimeout(() => this.onRename(), 0); + } + } + this._justAdded = false; + } + + getInputLink(slot) { + // Same-graph: standard resolveOutput path. + // Cross-graph: handled by resolveVirtualOutput. + const name = this.widgets[0].value; + if (!name || name === '') return null; + const setter = this.graph?._nodes?.find( + n => n.type === 'SetNode' && n.widgets[0].value === name + ); + if (setter) { + const slotInfo = setter.inputs[slot]; + if (!slotInfo || slotInfo.link == null) return null; + return getLink(this.graph, slotInfo.link); + } + // Scoped lookup: no setter found in own graph or ancestors + if (name && !findSetterByName(this.graph, name)) { + showAlert("No SetNode found for " + name + "(" + this.type + ")", this); + } + return null; + } + + resolveVirtualOutput(slot) { + const name = this.widgets[0].value; + // Scoped lookup: own graph first, then ancestors + const result = findSetterByName(this.graph, name); + if (!result) return undefined; + + // Same graph — let the standard getInputLink path handle it + if (result.graph === this.graph) return undefined; + + // Warn if multiple SetNodes with this name exist in scope + const scopeGraphs = getGraphAncestors(this.graph); + const scopedSetters = collectNodesOfType(scopeGraphs, 'SetNode') + .filter(e => e.node.widgets[0].value === name); + if (scopedSetters.length > 1) { + showAlert(`Multiple SetNodes named "${name}" found in scope. Rename duplicates or use "Convert to links" to resolve`, [this, ...scopedSetters.map(e => e.node)]); + return undefined; + } + + const { node: setter, graph: setterGraph } = result; + const slotInfo = setter.inputs[slot]; + if (!slotInfo || slotInfo.link == null) return undefined; + + const link = getLink(setterGraph, slotInfo.link); + if (!link) return undefined; + + const sourceNode = setterGraph.getNodeById(link.origin_id); + if (!sourceNode) return undefined; + + return { node: sourceNode, slot: link.origin_slot }; + } + getExtraMenuOptions(_, options) { + this.currentSetter = this.findSetter(this.graph) + if (!this.currentSetter) return + const sameGraph = this.currentSetter.graph === this.graph; + if (sameGraph) { + let menuEntry = this.drawConnection ? "Hide connections" : "Show connections"; + options.unshift( + { + content: "Convert to links", + callback: () => { + const graph = this.graph; + const setters = new Set(snapshotSelectedNodes(this, 'GetNode') + .map(n => n.findSetter?.(graph)).filter(Boolean)); + for (const s of setters) convertSetGetToLinks(graph, s); + }, + }, + { + content: "Go to setter", + callback: () => { + this.goToSetter(); + }, + }, + { + content: menuEntry, + callback: () => { + if (!this.currentSetter) return; + const linkType = this.currentSetter.inputs[0].type; + // Toggle on the SetNode so the canvas-level hook draws it + this.currentSetter.drawConnection = !this.currentSetter.drawConnection; + this.currentSetter.slotColor = this.canvas.default_connection_color_byType[linkType]; + this.drawConnection = this.currentSetter.drawConnection; + this.canvas.setDirty(true, true); + }, + }, + ); + } else { + // Cross-graph setter — navigate to its graph + const setterGraph = this.currentSetter.graph; + const isRoot = setterGraph === findRootGraph(this.graph); + options.unshift( + { + content: `Go to setter (in ${isRoot ? 'parent graph' : 'subgraph'})`, + callback: () => { + const canvas = this.canvas; + canvas.setGraph(setterGraph); + setTimeout(() => { + canvas.centerOnNode(this.currentSetter); + canvas.selectNode(this.currentSetter, false); + canvas.setDirty(true, true); + }, 0); + }, + }, + ); + } + } + } + + LiteGraph.registerNodeType("GetNode", GetNode); + }, +}); + +// region UI: commands, keybindings, canvas menu, draw hook, settings +app.registerExtension({ + name: "KJNodes.SetGetUI", + settings: [ + { + id: "KJNodes.setGetNaming", + name: "Default SetNode widget value", + category: ["KJNodes", "Set & Get", "Default SetNode widget value"], + tooltip: "Initial Constant value when a Set node is first connected to a slot", + type: "combo", + options: ["empty", "slot name", "slot name (lowercase)", "slot name (UPPERCASE)"], + defaultValue: "empty", + }, + { + id: "KJNodes.showSetGetLinks", + name: "Show links", + category: ["KJNodes", "Set & Get", "Show links"], + tooltip: "When to show virtual links between Set/Get pairs", + type: "combo", + options: ["never", "selected", "always"], + defaultValue: "never", + onChange: () => app.canvas?.setDirty(true, true), + }, + ], + commands: [ + { + id: "KJNodes.AddSetNodeToSelected", + label: "Add Set node to selected / at cursor", + function: () => { + const selected = Object.values(app.canvas.selected_nodes || {}); + if (selected.length > 0) { + for (const n of selected) { + window.kjNodes.addNode("SetNode", n, { side: "right", offset: 30 }); + } + } else { + const canvas = app.canvas; + const graph = canvas.graph || app.graph; + const node = LiteGraph.createNode("SetNode"); + if (!node) return; + node.pos = [canvas.graph_mouse[0], canvas.graph_mouse[1]]; + graph.add(node); + canvas.selectNode(node, false); + canvas.setDirty(true, true); + } + }, + }, + { + id: "KJNodes.AddGetNodeAtCursor", + label: "Add Get node to selected / at cursor", + function: () => { + const selected = Object.values(app.canvas.selected_nodes || {}); + if (selected.length > 0) { + for (const n of selected) { + window.kjNodes.addNode("GetNode", n, { side: "left", offset: 30 }); + } + } else { + const canvas = app.canvas; + const graph = canvas.graph || app.graph; + const node = LiteGraph.createNode("GetNode"); + if (!node) return; + node.pos = [canvas.graph_mouse[0], canvas.graph_mouse[1]]; + graph.add(node); + canvas.selectNode(node, false); + canvas.setDirty(true, true); + } + }, + }, + { + id: "KJNodes.ToggleForceShowSetGetLinks", + label: "Toggle force-show all Set/Get connections", + function: () => { + _forceShowAllLinks = !_forceShowAllLinks; + app.canvas.setDirty(true, true); + }, + }, + ], + keybindings: [ + { + commandId: "KJNodes.AddSetNodeToSelected", + combo: { key: "s", ctrl: true, shift: true }, + targetElementId: "graph-canvas", + }, + { + commandId: "KJNodes.AddGetNodeAtCursor", + combo: { key: "g", ctrl: true, shift: true }, + targetElementId: "graph-canvas", + }, + { + commandId: "KJNodes.ToggleForceShowSetGetLinks", + combo: { key: "l", ctrl: true, shift: true }, + targetElementId: "graph-canvas", + }, + ], + getCanvasMenuItems() { + return [ + { + content: "KJNodes", + has_submenu: true, + submenu: { + options: [ + { + content: "Convert outputs on all selected nodes to Set/Get", + callback: () => { + const selected = Object.values(app.canvas.selected_nodes || {}); + if (selected.length === 0) return; + for (const n of selected) convertOutputsToSetGet(app.graph, n); + }, + }, + { + content: "Convert selected Set/Get to links", + callback: () => { + const graph = app.graph; + const selected = Object.values(app.canvas.selected_nodes || {}); + const setNodes = selected.filter(n => n.type === 'SetNode'); + const getNodes = selected.filter(n => n.type === 'GetNode'); + for (const n of setNodes) convertSetGetToLinks(graph, n); + const setters = new Set(getNodes.map(n => n.findSetter?.(graph)).filter(Boolean)); + for (const s of setters) convertSetGetToLinks(graph, s); + }, + }, + ], + }, + }, + ]; + }, + setup() { + // Double-click GetNode to jump to its SetNode (works in both legacy and Vue modes) + document.addEventListener("dblclick", (e) => { + // Don't interfere when a ContextMenu (e.g. combo dropdown) is open + if (document.querySelector(".litecontextmenu")) return; + const canvas = app.canvas; + if (!canvas) return; + const selected = Object.values(canvas.selected_nodes || {}); + if (selected.length !== 1) return; + const node = selected[0]; + if (node.type === "GetNode") { + node.currentSetter = node.findSetter(node.graph); + if (node.currentSetter) node.goToSetter(); + } + }); + // Suppress title rename on collapsed GetNodes so double-click navigates instead + document.addEventListener("litegraph:canvas", (e) => { + if (e.detail?.subType !== 'node-double-click') return; + const node = e.detail.node; + if (node?.type === "GetNode" && node.flags?.collapsed) { + e.stopImmediatePropagation(); + } + }); + + // Monkey-patch: no extension hook exists for filtering visible nodes. + // Keep Set/Get nodes with visible virtual connections in the visible set + // even when offscreen, so the link lines don't get clipped. + const originalComputeVisibleNodes = LGraphCanvas.prototype.computeVisibleNodes; + LGraphCanvas.prototype.computeVisibleNodes = function () { + const visible = originalComputeVisibleNodes.apply(this, arguments); + for (const node of this.graph._nodes) { + if ((node.type === "SetNode" || node.type === "GetNode") && node.drawConnection && !visible.includes(node)) { + visible.push(node); + } + } + return visible; + }; + + // Monkey-patch: no extension hook exists for custom canvas drawing. + // Draws virtual links between Set/Get pairs. + // Handles per-node "Show connections", "selected" mode, and "always" mode. + const origCanvasOnDrawBackground = app.canvas.onDrawBackground; + app.canvas.onDrawBackground = function(ctx, visibleArea) { + origCanvasOnDrawBackground?.call(this, ctx, visibleArea); + + const graph = this.graph || app.graph; + if (!graph?._nodes) return; + const mode = getShowLinksMode(); + + // Build set of selected Set/Get names for "selected" mode + let selectedNames = null; + if (mode === "selected") { + const sel = Object.values(this.selected_nodes || {}); + if (!sel.length) { + // No selection — still honor per-node drawConnection + if (!graph._nodes.some(n => n.type === 'SetNode' && n.drawConnection)) return; + } else { + selectedNames = new Set(); + for (const n of sel) { + if (n.type === 'SetNode' || n.type === 'GetNode') { + selectedNames.add(n.widgets?.[0]?.value ?? n.title); + } + } + if (!selectedNames.size && !graph._nodes.some(n => n.type === 'SetNode' && n.drawConnection)) return; + } + } else if (mode === "never") { + if (!graph._nodes.some(n => n.type === 'SetNode' && n.drawConnection)) return; + } + + // Collect all GetNodes once across current graph + descendants, grouped by name. + // This avoids re-discovering descendant graphs and re-scanning nodes per SetNode. + const gettersByName = new Map(); + const scopeGraphs = [graph, ...getGraphDescendants(graph)]; + for (const g of scopeGraphs) { + if (!g?._nodes) continue; + for (const node of g._nodes) { + if (node.type !== 'GetNode') continue; + const n = node.widgets?.[0]?.value; + if (!n) continue; + let list = gettersByName.get(n); + if (!list) { list = []; gettersByName.set(n, list); } + list.push(node); + } + } + + for (const setNode of graph._nodes) { + if (setNode.type !== 'SetNode') continue; + const name = setNode.widgets?.[0]?.value ?? setNode.title; + const showByMode = mode === "always" || (mode === "selected" && selectedNames?.has(name)); + if (!showByMode && !setNode.drawConnection) continue; + + const allGetters = gettersByName.get(name) || []; + const drawTargets = []; + const seenSubgraphs = new Set(); + for (const getter of allGetters) { + if (getter.graph === graph) { + drawTargets.push(getter); + } else { + const sgNode = findSubgraphNodeFor(graph, getter); + if (sgNode && !seenSubgraphs.has(sgNode)) { + seenSubgraphs.add(sgNode); + drawTargets.push(sgNode); + } + } + } + if (!drawTargets.length) continue; + + const linkType = setNode.inputs[0]?.type; + const slotColor = app.canvas.default_connection_color_byType?.[linkType] + || LGraphCanvas.link_type_colors?.[linkType] + || setNode.bgcolor + || (setNode.slotColor !== "#FFF" ? setNode.slotColor : null) || "#AAA"; + + const startPos = setNode.getConnectionPos(false, 0); + + for (const target of drawTargets) { + const endPos = target.getConnectionPos(true, 0); + const highlighted = setNode.is_selected || target.is_selected; + const color = highlighted ? "#FFF" : slotColor; + app.canvas.renderLink( + ctx, + startPos, + endPos, + null, + false, + null, + color, + LiteGraph.RIGHT, + LiteGraph.LEFT + ); + } + } + }; + + app.ui.settings.addSetting({ + id: "KJNodes.filterGetNodeOptions", + name: "Filter Get node options by type", + category: ["KJNodes", "Set & Get", "Filter Get node options by type"], + tooltip: "When a Get node is connected, only show Set nodes with compatible types in the dropdown", + type: "boolean", + defaultValue: true, + }); + app.ui.settings.addSetting({ + id: "KJNodes.convertAllSetGet", + name: "Convert ALL Set/Get to links", + category: ["KJNodes", "Set & Get", "Convert ALL Set/Get to links"], + tooltip: "Replaces all Set/Get node pairs with direct links, including across subgraph boundaries (irreversible)", + type: () => { + const btn = document.createElement("button"); + btn.textContent = "Convert ALL Set/Get to links"; + btn.style.cssText = "padding: 6px 12px; cursor: pointer;"; + btn.onclick = () => { + if (confirm("This will replace ALL Set/Get pairs with direct links. This is irreversible. Continue?")) { + convertAllSetGetToLinks(app.graph); + app.canvas?.setDirty(true, true); + app.extensionManager.toast.add({ + severity: 'info', + summary: "KJ Set/Get", + detail: "All Set/Get nodes converted to direct links", + life: 3000, + }); + } + }; + return btn; + }, + defaultValue: false, + }); + } +}); + +// Temporary backwards-compat patch: makes cross-subgraph Set/Get work on frontends +// that don't natively support resolveVirtualOutput. Remove when no longer needed. +app.registerExtension({ + name: "KJNodes.CrossGraphSetGet", + setup() { + let patched = false; + + const originalGraphToPrompt = app.graphToPrompt.bind(app); + app.graphToPrompt = async function(...args) { + if (!patched) { + try { + const subgraphNode = app.graph._nodes.find(n => typeof n.getInnerNodes === 'function'); + if (subgraphNode) { + const tempMap = new Map(); + const dtos = subgraphNode.getInnerNodes(tempMap, []); + if (dtos.length > 0) { + const proto = Object.getPrototypeOf(dtos[0]); + const DtoClass = proto.constructor; + const nativeSource = proto.resolveOutput.toString(); + const hasNativeSupport = nativeSource.includes('resolveVirtualOutput'); + console.log(`[KJNodes] Cross-graph Set/Get: frontend native support ${hasNativeSupport ? 'detected, skipping patch' : 'not found, applying patch'}`); + if (!hasNativeSupport) { + const origResolveOutput = proto.resolveOutput; + proto.resolveOutput = function(slot, type, visited) { + if (typeof this.node?.resolveVirtualOutput === 'function') { + const virtualSource = this.node.resolveVirtualOutput(slot); + if (virtualSource) { + const inputNodeDto = [...this.nodesByExecutionId.values()] + .find(dto => dto instanceof DtoClass && dto.node === virtualSource.node); + if (inputNodeDto) { + return inputNodeDto.resolveOutput(virtualSource.slot, type, visited); + } + throw new Error(`KJNodes: No DTO found for cross-graph source node [${virtualSource.node.id}]`); + } + } + return origResolveOutput.call(this, slot, type, visited); + }; + } + patched = true; + } + } + } catch (e) { + console.warn('[KJNodes] Failed to probe ExecutableNodeDTO for cross-graph patch:', e); + } + } + return originalGraphToPrompt(...args); + }; + } +}); + +// Monkey-patch: no hook exists to extend the link context menu. +// Appends a "Convert to Set/Get" entry by counting DOM menus before/after +// the original call to find the newly created one. Fragile but unavoidable. +app.registerExtension({ + name: "KJNodes.LinkToSetGet", + setup() { + const originalShowLinkMenu = LGraphCanvas.prototype.showLinkMenu; + LGraphCanvas.prototype.showLinkMenu = function(segment, e) { + const menusBefore = document.querySelectorAll(".litecontextmenu").length; + const result = originalShowLinkMenu.call(this, segment, e); + + const graph = this.graph; + if (!graph) return result; + + // Get the full link object to access target info + const link = getLink(graph, segment.id); + if (!link || link.origin_id == null || link.target_id == null) return result; + + // Find the newly created context menu + const menus = document.querySelectorAll(".litecontextmenu"); + if (menus.length <= menusBefore) return result; + const lastMenu = menus[menus.length - 1]; + if (!lastMenu) return result; + + const entries = lastMenu.querySelector(".litemenu-entry")?.parentElement; + if (!entries) return result; + + // Create separator + const separator = document.createElement("div"); + separator.className = "litemenu-entry separator"; + entries.appendChild(separator); + + // Create menu entry + const menuItem = document.createElement("div"); + menuItem.className = "litemenu-entry submenu"; + menuItem.textContent = "Convert to Set/Get"; + entries.appendChild(menuItem); + + const canvas = this; + menuItem.addEventListener("click", function() { + // Close menu + lastMenu.remove(); + + const originNode = graph.getNodeById(link.origin_id); + const targetNode = graph.getNodeById(link.target_id); + if (!originNode || !targetNode) return; + + const outputSlot = originNode.outputs[link.origin_slot]; + const linkType = outputSlot?.type || "*"; + const linkName = outputSlot?.name || linkType; + + // Create Set node near the source + const setNode = LiteGraph.createNode("SetNode"); + if (!setNode) return; + setNode.pos = [ + originNode.pos[0] + originNode.size[0] + 30, + originNode.pos[1] + ]; + graph.add(setNode); + + // Create Get node near the target + const getNode = LiteGraph.createNode("GetNode"); + if (!getNode) return; + graph.add(getNode); + getNode.pos = [ + targetNode.pos[0] - getNode.size[0] - 30, + targetNode.pos[1] + ]; + + // Remove the original link + graph.removeLink(link.id); + + // Connect source -> Set node input + originNode.connect(link.origin_slot, setNode, 0); + + // Set the name widget on the Set node + setNode.widgets[0].value = linkName; + setNode.title = (!getDisablePrefix() ? "Set_" : "") + linkName; + setNode.validateName(graph); + setNode.properties.previousName = setNode.widgets[0].value; + + // Update Get node to match + const finalName = setNode.widgets[0].value; + getNode.widgets[0].value = finalName; + getNode.onRename(); + + // Connect Get node output -> target node input + getNode.connect(0, targetNode, link.target_slot); + + canvas.setDirty(true, true); + }); + + return result; + }; + } +}); diff --git a/docs/hel-892/scail-load-reference/kj-file-history.json b/docs/hel-892/scail-load-reference/kj-file-history.json new file mode 100644 index 00000000..07e863d9 --- /dev/null +++ b/docs/hel-892/scail-load-reference/kj-file-history.json @@ -0,0 +1 @@ +[{"sha":"b5316a9e247338dc1460df8e4d01e906c566299c","node_id":"C_kwDOKZZTCtoAKGI1MzE2YTllMjQ3MzM4ZGMxNDYwZGY4ZTRkMDFlOTA2YzU2NjI5OWM","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-10-28T16:05:48Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-10-28T16:05:48Z"},"message":"Cleanup","tree":{"sha":"5544e083629590e7e5a6c4db4c31596d92cfbcca","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/5544e083629590e7e5a6c4db4c31596d92cfbcca"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/b5316a9e247338dc1460df8e4d01e906c566299c","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/b5316a9e247338dc1460df8e4d01e906c566299c","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/b5316a9e247338dc1460df8e4d01e906c566299c","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/b5316a9e247338dc1460df8e4d01e906c566299c/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"08eb21895bbdd151492819ceb68f05c67457e375","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/08eb21895bbdd151492819ceb68f05c67457e375","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/08eb21895bbdd151492819ceb68f05c67457e375"}]},{"sha":"08eb21895bbdd151492819ceb68f05c67457e375","node_id":"C_kwDOKZZTCtoAKDA4ZWIyMTg5NWJiZGQxNTE0OTI4MTljZWI2OGYwNWM2NzQ1N2UzNzU","commit":{"author":{"name":"Vito Sansevero","email":"vito.sansevero@gmail.com","date":"2026-10-28T12:44:56Z"},"committer":{"name":"Vito Sansevero","email":"vito.sansevero@gmail.com","date":"2026-10-28T12:44:56Z"},"message":"fix: resolve Get nodes inside bypassed groups\n\nA bypassed node passes its input through to its output, but GetNode has\nno inputs, so bypassing a group containing a GetNode dropped the value\nfor downstream nodes. While app.graphToPrompt runs, GetNode now reports\nBYPASS as ALWAYS so it still resolves to its SetNode's source. Canvas\ndisplay and the serialized workflow keep the bypassed state.","tree":{"sha":"85d10608aeee93dc57ef1f891c23a34492588729","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/85d10608aeee93dc57ef1f891c23a34492588729"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/08eb21895bbdd151492819ceb68f05c67457e375","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/08eb21895bbdd151492819ceb68f05c67457e375","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/08eb21895bbdd151492819ceb68f05c67457e375","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/08eb21895bbdd151492819ceb68f05c67457e375/comments","author":{"login":"vitosans","id":310935,"node_id":"MDQ6VXNlcjMxMDkzNQ==","avatar_url":"https://avatars.githubusercontent.com/u/310935?v=4","gravatar_id":"","url":"https://api.github.com/users/vitosans","html_url":"https://github.com/vitosans","followers_url":"https://api.github.com/users/vitosans/followers","following_url":"https://api.github.com/users/vitosans/following{/other_user}","gists_url":"https://api.github.com/users/vitosans/gists{/gist_id}","starred_url":"https://api.github.com/users/vitosans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vitosans/subscriptions","organizations_url":"https://api.github.com/users/vitosans/orgs","repos_url":"https://api.github.com/users/vitosans/repos","events_url":"https://api.github.com/users/vitosans/events{/privacy}","received_events_url":"https://api.github.com/users/vitosans/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"vitosans","id":310935,"node_id":"MDQ6VXNlcjMxMDkzNQ==","avatar_url":"https://avatars.githubusercontent.com/u/310935?v=4","gravatar_id":"","url":"https://api.github.com/users/vitosans","html_url":"https://github.com/vitosans","followers_url":"https://api.github.com/users/vitosans/followers","following_url":"https://api.github.com/users/vitosans/following{/other_user}","gists_url":"https://api.github.com/users/vitosans/gists{/gist_id}","starred_url":"https://api.github.com/users/vitosans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vitosans/subscriptions","organizations_url":"https://api.github.com/users/vitosans/orgs","repos_url":"https://api.github.com/users/vitosans/repos","events_url":"https://api.github.com/users/vitosans/events{/privacy}","received_events_url":"https://api.github.com/users/vitosans/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"0209e3091a1f4a9e112d2320c55f47572b00994f","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/0209e3091a1f4a9e112d2320c55f47572b00994f","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/0209e3091a1f4a9e112d2320c55f47572b00994f"}]},{"sha":"0209e3091a1f4a9e112d2320c55f47572b00994f","node_id":"C_kwDOKZZTCtoAKDAyMDllMzA5MWExZjRhOWUxMTJkMjMyMGM1NWY0NzU3MmIwMDk5NGY","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-10-28T10:37:03Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-10-28T10:37:03Z"},"message":"Fix subgraph handling in node swap, recreate, shake and Set/Get conversions","tree":{"sha":"19fe6dabe7c532dcb9c378d3165f4b1403cb86d1","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/19fe6dabe7c532dcb9c378d3165f4b1403cb86d1"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/0209e3091a1f4a9e112d2320c55f47572b00994f","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/0209e3091a1f4a9e112d2320c55f47572b00994f","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/0209e3091a1f4a9e112d2320c55f47572b00994f","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/0209e3091a1f4a9e112d2320c55f47572b00994f/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"abe4786272721c45dcab7542f5469ac794257e70","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/abe4786272721c45dcab7542f5469ac794257e70","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/abe4786272721c45dcab7542f5469ac794257e70"}]},{"sha":"f0ac4537c0541e034dcd77b5f26d6f0cebfa02c2","node_id":"C_kwDOKZZTCtoAKGYwYWM0NTM3YzA1NDFlMDM0ZGNkNzdiNWYyNmQ2ZjBjZWJmYTAyYzI","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-05-30T08:06:58Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-05-30T08:06:58Z"},"message":"SetGet: Fix undo on 2.0\n\nhttps://github.com/kijai/ComfyUI-KJNodes/issues/647","tree":{"sha":"01bae34b041078221098ea9c315f60363c0f985a","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/01bae34b041078221098ea9c315f60363c0f985a"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/f0ac4537c0541e034dcd77b5f26d6f0cebfa02c2","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/f0ac4537c0541e034dcd77b5f26d6f0cebfa02c2","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/f0ac4537c0541e034dcd77b5f26d6f0cebfa02c2","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/f0ac4537c0541e034dcd77b5f26d6f0cebfa02c2/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"da298783bf109c275d31a94966786a9a66a63def","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/da298783bf109c275d31a94966786a9a66a63def","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/da298783bf109c275d31a94966786a9a66a63def"}]},{"sha":"f8fce8ea890557659ef1d454305f2eebecf760ee","node_id":"C_kwDOKZZTCtoAKGY4ZmNlOGVhODkwNTU3NjU5ZWYxZDQ1NDMwNWYyZWViZWNmNzYwZWU","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-05-27T23:01:22Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-05-27T23:01:22Z"},"message":"SetGet: Add small color border in Get menu based on Set type","tree":{"sha":"31d5297dfdb2153a90f571c0aff47c44298c9033","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/31d5297dfdb2153a90f571c0aff47c44298c9033"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/f8fce8ea890557659ef1d454305f2eebecf760ee","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/f8fce8ea890557659ef1d454305f2eebecf760ee","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/f8fce8ea890557659ef1d454305f2eebecf760ee","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/f8fce8ea890557659ef1d454305f2eebecf760ee/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"8383e9c829899dfdc72e4995e00b0f10e59c020d","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/8383e9c829899dfdc72e4995e00b0f10e59c020d","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/8383e9c829899dfdc72e4995e00b0f10e59c020d"}]},{"sha":"768cd8584175cab93d4d51b3f8b047f054a17d10","node_id":"C_kwDOKZZTCtoAKDc2OGNkODU4NDE3NWNhYjkzZDRkNTFiM2Y4YjA0N2YwNTRhMTdkMTA","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-05-26T16:22:14Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-05-26T16:22:14Z"},"message":"SetGet: Work around context menu filter issue\n\nlitegraph wasn't liking the option labels","tree":{"sha":"6d419ae33f3a453cf49b83bb350fd0fa3e628a81","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/6d419ae33f3a453cf49b83bb350fd0fa3e628a81"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/768cd8584175cab93d4d51b3f8b047f054a17d10","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/768cd8584175cab93d4d51b3f8b047f054a17d10","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/768cd8584175cab93d4d51b3f8b047f054a17d10","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/768cd8584175cab93d4d51b3f8b047f054a17d10/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"ee5e6b9a416a1b7168589a562d83d65772acdaf4","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/ee5e6b9a416a1b7168589a562d83d65772acdaf4","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/ee5e6b9a416a1b7168589a562d83d65772acdaf4"}]},{"sha":"ee5e6b9a416a1b7168589a562d83d65772acdaf4","node_id":"C_kwDOKZZTCtoAKGVlNWU2YjlhNDE2YTFiNzE2ODU4OWE1NjJkODNkNjU3NzJhY2RhZjQ","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-05-26T16:07:19Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-05-26T16:07:19Z"},"message":"SetGet: Fixes for nodes 2.0","tree":{"sha":"34b61bc286361bfb177eacfca7a5b9af6a048216","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/34b61bc286361bfb177eacfca7a5b9af6a048216"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/ee5e6b9a416a1b7168589a562d83d65772acdaf4","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/ee5e6b9a416a1b7168589a562d83d65772acdaf4","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/ee5e6b9a416a1b7168589a562d83d65772acdaf4","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/ee5e6b9a416a1b7168589a562d83d65772acdaf4/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"450dc91069e28496bbd67bd657f820ef0cb8d5ba","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/450dc91069e28496bbd67bd657f820ef0cb8d5ba","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/450dc91069e28496bbd67bd657f820ef0cb8d5ba"}]},{"sha":"57ffbc11201eb526b5cdce2a3847677234db80e7","node_id":"C_kwDOKZZTCtoAKDU3ZmZiYzExMjAxZWI1MjZiNWNkY2UyYTM4NDc2NzcyMzRkYjgwZTc","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-04-29T13:03:22Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-04-29T13:03:22Z"},"message":"Rearrange some js code","tree":{"sha":"e58aa68676e47823671e26af5822ed837ae60541","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/e58aa68676e47823671e26af5822ed837ae60541"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/57ffbc11201eb526b5cdce2a3847677234db80e7","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/57ffbc11201eb526b5cdce2a3847677234db80e7","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/57ffbc11201eb526b5cdce2a3847677234db80e7","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/57ffbc11201eb526b5cdce2a3847677234db80e7/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"4e1458c2417db5cc7ae764929b00afad9892e10b","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/4e1458c2417db5cc7ae764929b00afad9892e10b","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/4e1458c2417db5cc7ae764929b00afad9892e10b"}]},{"sha":"81e05df377eb9705930f7c6ecca87e664c58ad89","node_id":"C_kwDOKZZTCtoAKDgxZTA1ZGYzNzdlYjk3MDU5MzBmN2M2ZWNjYTg3ZTY2NGM1OGFkODk","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-31T17:09:26Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-31T17:09:26Z"},"message":"Set/Get code cleanup","tree":{"sha":"71491f044c3813564369745e430685799fc0f5f3","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/71491f044c3813564369745e430685799fc0f5f3"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/81e05df377eb9705930f7c6ecca87e664c58ad89","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/81e05df377eb9705930f7c6ecca87e664c58ad89","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/81e05df377eb9705930f7c6ecca87e664c58ad89","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/81e05df377eb9705930f7c6ecca87e664c58ad89/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"1a3a4f1d34d312ec4c10aa489e914d2e377154bf","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/1a3a4f1d34d312ec4c10aa489e914d2e377154bf","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/1a3a4f1d34d312ec4c10aa489e914d2e377154bf"}]},{"sha":"e56b3061ed49251a7b8a5450a2e18295548ea7a1","node_id":"C_kwDOKZZTCtoAKGU1NmIzMDYxZWQ0OTI1MWE3YjhhNTQ1MGEyZTE4Mjk1NTQ4ZWE3YTE","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-30T23:58:46Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-30T23:58:46Z"},"message":"Update aux_id to match what's expected","tree":{"sha":"0d93d39a73d65a3576ced12b9db54e09a775c127","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/0d93d39a73d65a3576ced12b9db54e09a775c127"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/e56b3061ed49251a7b8a5450a2e18295548ea7a1","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/e56b3061ed49251a7b8a5450a2e18295548ea7a1","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/e56b3061ed49251a7b8a5450a2e18295548ea7a1","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/e56b3061ed49251a7b8a5450a2e18295548ea7a1/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"276955e45fa48c794b47bf49dbc22f2d955d76a8","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/276955e45fa48c794b47bf49dbc22f2d955d76a8","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/276955e45fa48c794b47bf49dbc22f2d955d76a8"}]},{"sha":"903bbfd2ae2c8cac2e80faed32bf1b0424afd327","node_id":"C_kwDOKZZTCtoAKDkwM2JiZmQyYWUyYzhjYWMyZTgwZmFlZDMyYmYxYjA0MjRhZmQzMjc","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-23T10:51:58Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-23T10:51:58Z"},"message":"Scope keybinds to canvas","tree":{"sha":"3399838feb160719c57394f7f5404dce7a4ea42e","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/3399838feb160719c57394f7f5404dce7a4ea42e"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/903bbfd2ae2c8cac2e80faed32bf1b0424afd327","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/903bbfd2ae2c8cac2e80faed32bf1b0424afd327","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/903bbfd2ae2c8cac2e80faed32bf1b0424afd327","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/903bbfd2ae2c8cac2e80faed32bf1b0424afd327/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"e00171035cda47f69f8bff23acd6962fa6cc5c29","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/e00171035cda47f69f8bff23acd6962fa6cc5c29","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/e00171035cda47f69f8bff23acd6962fa6cc5c29"}]},{"sha":"e00171035cda47f69f8bff23acd6962fa6cc5c29","node_id":"C_kwDOKZZTCtoAKGUwMDE3MTAzNWNkYTQ3ZjY5ZjhiZmYyM2FjZDY5NjJmYTZjYzVjMjk","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-22T13:20:07Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-22T13:20:07Z"},"message":"Set/Get: Add filtering to Get node options to only show compatible types\n\nDefault on, option to disable in Settings for the old behaviour.","tree":{"sha":"c5ca11af66b77401057e384cd3437036b26f62b9","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/c5ca11af66b77401057e384cd3437036b26f62b9"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/e00171035cda47f69f8bff23acd6962fa6cc5c29","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/e00171035cda47f69f8bff23acd6962fa6cc5c29","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/e00171035cda47f69f8bff23acd6962fa6cc5c29","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/e00171035cda47f69f8bff23acd6962fa6cc5c29/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"39d4640e8dff571434734a7007fdcbef570e19c2","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/39d4640e8dff571434734a7007fdcbef570e19c2","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/39d4640e8dff571434734a7007fdcbef570e19c2"}]},{"sha":"39d4640e8dff571434734a7007fdcbef570e19c2","node_id":"C_kwDOKZZTCtoAKDM5ZDQ2NDBlOGRmZjU3MTQzNDczNGE3MDA3ZmRjYmVmNTcwZTE5YzI","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-21T10:34:42Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-21T10:34:42Z"},"message":"SetNode: Init previous name on autoname too","tree":{"sha":"b1f13d4fd6130d86df9cf9d490cbdce0b5c0f4ab","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/b1f13d4fd6130d86df9cf9d490cbdce0b5c0f4ab"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/39d4640e8dff571434734a7007fdcbef570e19c2","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/39d4640e8dff571434734a7007fdcbef570e19c2","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/39d4640e8dff571434734a7007fdcbef570e19c2","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/39d4640e8dff571434734a7007fdcbef570e19c2/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"35a5a1ffea9061e698d1a742ac071b287b843dd3","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/35a5a1ffea9061e698d1a742ac071b287b843dd3","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/35a5a1ffea9061e698d1a742ac071b287b843dd3"}]},{"sha":"35a5a1ffea9061e698d1a742ac071b287b843dd3","node_id":"C_kwDOKZZTCtoAKDM1YTVhMWZmZWE5MDYxZTY5OGQxYTc0MmFjMDcxYjI4N2I4NDNkZDM","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-21T10:24:42Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-21T10:24:42Z"},"message":"GetNode: Update canvas instantly when changing value","tree":{"sha":"97a84e0531d484a5086605fc9175c332eba716e7","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/97a84e0531d484a5086605fc9175c332eba716e7"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/35a5a1ffea9061e698d1a742ac071b287b843dd3","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/35a5a1ffea9061e698d1a742ac071b287b843dd3","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/35a5a1ffea9061e698d1a742ac071b287b843dd3","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/35a5a1ffea9061e698d1a742ac071b287b843dd3/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"d5c9b0a341a5578861766241cc5352d1d5cb755d","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/d5c9b0a341a5578861766241cc5352d1d5cb755d","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/d5c9b0a341a5578861766241cc5352d1d5cb755d"}]},{"sha":"d5c9b0a341a5578861766241cc5352d1d5cb755d","node_id":"C_kwDOKZZTCtoAKGQ1YzliMGEzNDFhNTU3ODg2MTc2NjI0MWNjNTM1MmQxZDVjYjc1NWQ","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-19T15:51:13Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-19T15:51:13Z"},"message":"Set/Get: Better separation between workflow loading and node copying","tree":{"sha":"b49009aa8788a16718d6f5113e3ccc349c7bf1d8","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/b49009aa8788a16718d6f5113e3ccc349c7bf1d8"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/d5c9b0a341a5578861766241cc5352d1d5cb755d","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/d5c9b0a341a5578861766241cc5352d1d5cb755d","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/d5c9b0a341a5578861766241cc5352d1d5cb755d","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/d5c9b0a341a5578861766241cc5352d1d5cb755d/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"535d7cb6e0338f8bf3e958c4af7a1702dc215a51","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/535d7cb6e0338f8bf3e958c4af7a1702dc215a51","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/535d7cb6e0338f8bf3e958c4af7a1702dc215a51"}]},{"sha":"00af95b9cb5a092dfffece6b7efd6cba76099a90","node_id":"C_kwDOKZZTCtoAKDAwYWY5NWI5Y2I1YTA5MmRmZmZlY2U2YjdlZmQ2Y2JhNzYwOTlhOTA","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-18T23:29:04Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-18T23:29:04Z"},"message":"Set/Get complete overhaul","tree":{"sha":"df647c2addfbc4f94a5b2589f7e4133f87791612","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/df647c2addfbc4f94a5b2589f7e4133f87791612"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/00af95b9cb5a092dfffece6b7efd6cba76099a90","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/00af95b9cb5a092dfffece6b7efd6cba76099a90","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/00af95b9cb5a092dfffece6b7efd6cba76099a90","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/00af95b9cb5a092dfffece6b7efd6cba76099a90/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"f12007dd57bd539052d3a92597b35365a49e7b06","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/f12007dd57bd539052d3a92597b35365a49e7b06","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/f12007dd57bd539052d3a92597b35365a49e7b06"}]},{"sha":"db419cd37b237b60efef67b3cf5e074c19730386","node_id":"C_kwDOKZZTCtoAKGRiNDE5Y2QzN2IyMzdiNjBlZmVmNjdiM2NmNWUwNzRjMTk3MzAzODY","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-12T14:19:22Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-12T14:19:22Z"},"message":"Add ability to convert links to Set/Get pairs, and other way around\n\nLeft click on the link midpoint to convert to Set/Get pair\nRight click context menu on either Set or Get to convert to a link","tree":{"sha":"c3d4bbaad96b671891ad528ac3b551a65cdba57f","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/c3d4bbaad96b671891ad528ac3b551a65cdba57f"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/db419cd37b237b60efef67b3cf5e074c19730386","comment_count":1,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/db419cd37b237b60efef67b3cf5e074c19730386","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/db419cd37b237b60efef67b3cf5e074c19730386","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/db419cd37b237b60efef67b3cf5e074c19730386/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"4329dbc4c44a169970d76251b3970536de4606bd","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/4329dbc4c44a169970d76251b3970536de4606bd","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/4329dbc4c44a169970d76251b3970536de4606bd"}]},{"sha":"4329dbc4c44a169970d76251b3970536de4606bd","node_id":"C_kwDOKZZTCtoAKDQzMjlkYmM0YzQ0YTE2OTk3MGQ3NjI1MWIzOTcwNTM2ZGU0NjA2YmQ","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-12T13:28:17Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-12T13:28:17Z"},"message":"Allow converting set/get nodes to subgraph\n\nThis doesn't mean set/get pairs still would work through main workflow - subgraph barrier though, as they are virtual links.","tree":{"sha":"631bcc2e5d399692657c43e8ea55e32a41782422","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/631bcc2e5d399692657c43e8ea55e32a41782422"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/4329dbc4c44a169970d76251b3970536de4606bd","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/4329dbc4c44a169970d76251b3970536de4606bd","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/4329dbc4c44a169970d76251b3970536de4606bd","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/4329dbc4c44a169970d76251b3970536de4606bd/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"f2d63a2cf7c68b52bc2bc16e6bd5ebe1b41c5e9e","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/f2d63a2cf7c68b52bc2bc16e6bd5ebe1b41c5e9e","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/f2d63a2cf7c68b52bc2bc16e6bd5ebe1b41c5e9e"}]},{"sha":"13101465f14df2b725694ad5e16ed29c838ec8f2","node_id":"C_kwDOKZZTCtoAKDEzMTAxNDY1ZjE0ZGYyYjcyNTY5NGFkNWUxNmVkMjljODM4ZWM4ZjI","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-05T13:49:13Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-03-05T13:49:13Z"},"message":"Fix Set/Get for Nodes 2.0","tree":{"sha":"3d4c76efb3c0ee5c3fd9065740bf1fcfdb209779","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/3d4c76efb3c0ee5c3fd9065740bf1fcfdb209779"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/13101465f14df2b725694ad5e16ed29c838ec8f2","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/13101465f14df2b725694ad5e16ed29c838ec8f2","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/13101465f14df2b725694ad5e16ed29c838ec8f2","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/13101465f14df2b725694ad5e16ed29c838ec8f2/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"5edfa4fabc25ae2ab243ec74dea5c2676f9b3395","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/5edfa4fabc25ae2ab243ec74dea5c2676f9b3395","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/5edfa4fabc25ae2ab243ec74dea5c2676f9b3395"}]},{"sha":"0145113d6a65990b2beedfd5c5af696160f84f92","node_id":"C_kwDOKZZTCtoAKDAxNDUxMTNkNmE2NTk5MGIyYmVlZGZkNWM1YWY2OTYxNjBmODRmOTI","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-02-22T12:54:06Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2026-02-22T12:54:06Z"},"message":"Improved error message","tree":{"sha":"619efe1844569f2763de649e4a54bb82a082da1b","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/619efe1844569f2763de649e4a54bb82a082da1b"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/0145113d6a65990b2beedfd5c5af696160f84f92","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/0145113d6a65990b2beedfd5c5af696160f84f92","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/0145113d6a65990b2beedfd5c5af696160f84f92","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/0145113d6a65990b2beedfd5c5af696160f84f92/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"7ea6ead6f60c5b39249c01b8d5641926716d2502","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/7ea6ead6f60c5b39249c01b8d5641926716d2502","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/7ea6ead6f60c5b39249c01b8d5641926716d2502"}]},{"sha":"836b4c3e4145f872fdf40f272cb7534e9a58f0e2","node_id":"C_kwDOKZZTCtoAKDgzNmI0YzNlNDE0NWY4NzJmZGY0MGYyNzJjYjc1MzRlOWE1OGYwZTI","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2025-11-05T12:05:43Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2025-11-05T12:05:43Z"},"message":"Fix deprecated js imports","tree":{"sha":"093ee6c26ccef515d0a0b976590eb70af10f43a9","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/093ee6c26ccef515d0a0b976590eb70af10f43a9"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/836b4c3e4145f872fdf40f272cb7534e9a58f0e2","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/836b4c3e4145f872fdf40f272cb7534e9a58f0e2","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/836b4c3e4145f872fdf40f272cb7534e9a58f0e2","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/836b4c3e4145f872fdf40f272cb7534e9a58f0e2/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"1585f9b52386b981bf9c63fb5fba997a3896e7c7","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/1585f9b52386b981bf9c63fb5fba997a3896e7c7","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/1585f9b52386b981bf9c63fb5fba997a3896e7c7"}]},{"sha":"d7aba8086fb5ca2f5adfc396ed8769ac56143c81","node_id":"C_kwDOKZZTCtoAKGQ3YWJhODA4NmZiNWNhMmY1YWRmYzM5NmVkODc2OWFjNTYxNDNjODE","commit":{"author":{"name":"Austin Mroz","email":"AustinMroz@utexas.edu","date":"2025-10-19T03:11:04Z"},"committer":{"name":"Austin Mroz","email":"AustinMroz@utexas.edu","date":"2025-10-19T03:12:33Z"},"message":"Fix type resolution at subgraph boundary","tree":{"sha":"ba1c23105eab31c6ed34642ed8433a4cd2f9e6b8","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/ba1c23105eab31c6ed34642ed8433a4cd2f9e6b8"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/d7aba8086fb5ca2f5adfc396ed8769ac56143c81","comment_count":0,"verification":{"verified":true,"reason":"valid","signature":"-----BEGIN SSH SIGNATURE-----\nU1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgNwNKF+ZEvBztsANtwRxZgsJ/pA\nwUL2RgdjnS9lrplwgAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5\nAAAAQJN8gXcFlSo8DEKoHjXd6kgCvVU1asl5ZlJKzT5b5azAOwJ3msds4qOITrp1Ztfk1O\nOKWTYZdaAW5VTMNSKc0gY=\n-----END SSH SIGNATURE-----","payload":"tree ba1c23105eab31c6ed34642ed8433a4cd2f9e6b8\nparent 405c99ec16e32dfd122de5e9113da8cebf11ed2f\nauthor Austin Mroz 1760843464 -0700\ncommitter Austin Mroz 1760843553 -0700\n\nFix type resolution at subgraph boundary\n","verified_at":"2025-10-19T03:13:05Z"}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/d7aba8086fb5ca2f5adfc396ed8769ac56143c81","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/d7aba8086fb5ca2f5adfc396ed8769ac56143c81","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/d7aba8086fb5ca2f5adfc396ed8769ac56143c81/comments","author":{"login":"AustinMroz","id":4284322,"node_id":"MDQ6VXNlcjQyODQzMjI=","avatar_url":"https://avatars.githubusercontent.com/u/4284322?v=4","gravatar_id":"","url":"https://api.github.com/users/AustinMroz","html_url":"https://github.com/AustinMroz","followers_url":"https://api.github.com/users/AustinMroz/followers","following_url":"https://api.github.com/users/AustinMroz/following{/other_user}","gists_url":"https://api.github.com/users/AustinMroz/gists{/gist_id}","starred_url":"https://api.github.com/users/AustinMroz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AustinMroz/subscriptions","organizations_url":"https://api.github.com/users/AustinMroz/orgs","repos_url":"https://api.github.com/users/AustinMroz/repos","events_url":"https://api.github.com/users/AustinMroz/events{/privacy}","received_events_url":"https://api.github.com/users/AustinMroz/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"AustinMroz","id":4284322,"node_id":"MDQ6VXNlcjQyODQzMjI=","avatar_url":"https://avatars.githubusercontent.com/u/4284322?v=4","gravatar_id":"","url":"https://api.github.com/users/AustinMroz","html_url":"https://github.com/AustinMroz","followers_url":"https://api.github.com/users/AustinMroz/followers","following_url":"https://api.github.com/users/AustinMroz/following{/other_user}","gists_url":"https://api.github.com/users/AustinMroz/gists{/gist_id}","starred_url":"https://api.github.com/users/AustinMroz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AustinMroz/subscriptions","organizations_url":"https://api.github.com/users/AustinMroz/orgs","repos_url":"https://api.github.com/users/AustinMroz/repos","events_url":"https://api.github.com/users/AustinMroz/events{/privacy}","received_events_url":"https://api.github.com/users/AustinMroz/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"405c99ec16e32dfd122de5e9113da8cebf11ed2f","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/405c99ec16e32dfd122de5e9113da8cebf11ed2f","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/405c99ec16e32dfd122de5e9113da8cebf11ed2f"}]},{"sha":"774fca91294478cfc1d9d856c6687e076274625d","node_id":"C_kwDOKZZTCtoAKDc3NGZjYTkxMjk0NDc4Y2ZjMWQ5ZDg1NmM2Njg3ZTA3NjI3NDYyNWQ","commit":{"author":{"name":"Austin Mroz","email":"AustinMroz@utexas.edu","date":"2025-10-18T16:43:10Z"},"committer":{"name":"Austin Mroz","email":"AustinMroz@utexas.edu","date":"2025-10-18T16:43:10Z"},"message":"Rework context menu options for getter nodes.","tree":{"sha":"44435e0e71b0bcf4b30bcfef927d75b359af6118","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/44435e0e71b0bcf4b30bcfef927d75b359af6118"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/774fca91294478cfc1d9d856c6687e076274625d","comment_count":0,"verification":{"verified":true,"reason":"valid","signature":"-----BEGIN SSH SIGNATURE-----\nU1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgNwNKF+ZEvBztsANtwRxZgsJ/pA\nwUL2RgdjnS9lrplwgAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5\nAAAAQNUtCIU2Lpfbr/d2grnKldW7O6JOmBcweqE27xeBjpP3fchSC4ms/lZAuunnKHMcmt\nET6h5OHqdpq35S9CS+dwQ=\n-----END SSH SIGNATURE-----","payload":"tree 44435e0e71b0bcf4b30bcfef927d75b359af6118\nparent 3af232e755bea331c0d4558a74ee8d210e1fa43f\nauthor Austin Mroz 1760805790 -0700\ncommitter Austin Mroz 1760805790 -0700\n\nRework context menu options for getter nodes.\n","verified_at":"2025-10-18T16:48:12Z"}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/774fca91294478cfc1d9d856c6687e076274625d","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/774fca91294478cfc1d9d856c6687e076274625d","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/774fca91294478cfc1d9d856c6687e076274625d/comments","author":{"login":"AustinMroz","id":4284322,"node_id":"MDQ6VXNlcjQyODQzMjI=","avatar_url":"https://avatars.githubusercontent.com/u/4284322?v=4","gravatar_id":"","url":"https://api.github.com/users/AustinMroz","html_url":"https://github.com/AustinMroz","followers_url":"https://api.github.com/users/AustinMroz/followers","following_url":"https://api.github.com/users/AustinMroz/following{/other_user}","gists_url":"https://api.github.com/users/AustinMroz/gists{/gist_id}","starred_url":"https://api.github.com/users/AustinMroz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AustinMroz/subscriptions","organizations_url":"https://api.github.com/users/AustinMroz/orgs","repos_url":"https://api.github.com/users/AustinMroz/repos","events_url":"https://api.github.com/users/AustinMroz/events{/privacy}","received_events_url":"https://api.github.com/users/AustinMroz/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"AustinMroz","id":4284322,"node_id":"MDQ6VXNlcjQyODQzMjI=","avatar_url":"https://avatars.githubusercontent.com/u/4284322?v=4","gravatar_id":"","url":"https://api.github.com/users/AustinMroz","html_url":"https://github.com/AustinMroz","followers_url":"https://api.github.com/users/AustinMroz/followers","following_url":"https://api.github.com/users/AustinMroz/following{/other_user}","gists_url":"https://api.github.com/users/AustinMroz/gists{/gist_id}","starred_url":"https://api.github.com/users/AustinMroz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AustinMroz/subscriptions","organizations_url":"https://api.github.com/users/AustinMroz/orgs","repos_url":"https://api.github.com/users/AustinMroz/repos","events_url":"https://api.github.com/users/AustinMroz/events{/privacy}","received_events_url":"https://api.github.com/users/AustinMroz/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"3af232e755bea331c0d4558a74ee8d210e1fa43f","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/3af232e755bea331c0d4558a74ee8d210e1fa43f","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/3af232e755bea331c0d4558a74ee8d210e1fa43f"}]},{"sha":"5dcda71011870278c35d92ff77a677ed2e538f2d","node_id":"C_kwDOKZZTCtoAKDVkY2RhNzEwMTE4NzAyNzhjMzVkOTJmZjc3YTY3N2VkMmU1MzhmMmQ","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2025-05-13T14:10:22Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2025-05-13T14:10:22Z"},"message":"bugfix on deleting node connected to Set node","tree":{"sha":"a2ba449a655dec2993a5817a775d36044121041c","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/a2ba449a655dec2993a5817a775d36044121041c"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/5dcda71011870278c35d92ff77a677ed2e538f2d","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/5dcda71011870278c35d92ff77a677ed2e538f2d","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/5dcda71011870278c35d92ff77a677ed2e538f2d","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/5dcda71011870278c35d92ff77a677ed2e538f2d/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"bec42252c690c1b5b2064b5a6732ad11cc452759","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/bec42252c690c1b5b2064b5a6732ad11cc452759","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/bec42252c690c1b5b2064b5a6732ad11cc452759"}]},{"sha":"29a77e764a06666bdda770cf43facdf331b3d505","node_id":"C_kwDOKZZTCtoAKDI5YTc3ZTc2NGEwNjY2NmJkZGE3NzBjZjQzZmFjZGYzMzFiM2Q1MDU","commit":{"author":{"name":"Austin Mroz","email":"AustinMroz@utexas.edu","date":"2025-03-12T18:16:52Z"},"committer":{"name":"Austin Mroz","email":"AustinMroz@utexas.edu","date":"2025-03-12T18:16:52Z"},"message":"Support comma separated types with get/set nodes\n\nResolves #221","tree":{"sha":"01177e6745c1b28c44d045532a2373225e1e46d4","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/01177e6745c1b28c44d045532a2373225e1e46d4"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/29a77e764a06666bdda770cf43facdf331b3d505","comment_count":0,"verification":{"verified":true,"reason":"valid","signature":"-----BEGIN SSH SIGNATURE-----\nU1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgNwNKF+ZEvBztsANtwRxZgsJ/pA\nwUL2RgdjnS9lrplwgAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5\nAAAAQAA8EnXz8TJEU3jO5Abfa313Custgui8UNpxNr+PpSeBHB/y0Efu26qq13eQvFQ56q\nosTobRwVZBmwLvPIBIfQI=\n-----END SSH SIGNATURE-----","payload":"tree 01177e6745c1b28c44d045532a2373225e1e46d4\nparent 7ecb190ef91d988420cf0e682efb79ac7433c0b7\nauthor Austin Mroz 1741803412 -0500\ncommitter Austin Mroz 1741803412 -0500\n\nSupport comma separated types with get/set nodes\n\nResolves #221\n","verified_at":"2025-03-12T18:29:05Z"}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/29a77e764a06666bdda770cf43facdf331b3d505","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/29a77e764a06666bdda770cf43facdf331b3d505","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/29a77e764a06666bdda770cf43facdf331b3d505/comments","author":{"login":"AustinMroz","id":4284322,"node_id":"MDQ6VXNlcjQyODQzMjI=","avatar_url":"https://avatars.githubusercontent.com/u/4284322?v=4","gravatar_id":"","url":"https://api.github.com/users/AustinMroz","html_url":"https://github.com/AustinMroz","followers_url":"https://api.github.com/users/AustinMroz/followers","following_url":"https://api.github.com/users/AustinMroz/following{/other_user}","gists_url":"https://api.github.com/users/AustinMroz/gists{/gist_id}","starred_url":"https://api.github.com/users/AustinMroz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AustinMroz/subscriptions","organizations_url":"https://api.github.com/users/AustinMroz/orgs","repos_url":"https://api.github.com/users/AustinMroz/repos","events_url":"https://api.github.com/users/AustinMroz/events{/privacy}","received_events_url":"https://api.github.com/users/AustinMroz/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"AustinMroz","id":4284322,"node_id":"MDQ6VXNlcjQyODQzMjI=","avatar_url":"https://avatars.githubusercontent.com/u/4284322?v=4","gravatar_id":"","url":"https://api.github.com/users/AustinMroz","html_url":"https://github.com/AustinMroz","followers_url":"https://api.github.com/users/AustinMroz/followers","following_url":"https://api.github.com/users/AustinMroz/following{/other_user}","gists_url":"https://api.github.com/users/AustinMroz/gists{/gist_id}","starred_url":"https://api.github.com/users/AustinMroz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AustinMroz/subscriptions","organizations_url":"https://api.github.com/users/AustinMroz/orgs","repos_url":"https://api.github.com/users/AustinMroz/repos","events_url":"https://api.github.com/users/AustinMroz/events{/privacy}","received_events_url":"https://api.github.com/users/AustinMroz/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"7ecb190ef91d988420cf0e682efb79ac7433c0b7","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/7ecb190ef91d988420cf0e682efb79ac7433c0b7","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/7ecb190ef91d988420cf0e682efb79ac7433c0b7"}]},{"sha":"4c5c26a2c91de356212419ac8bc7fcf9869527e9","node_id":"C_kwDOKZZTCtoAKDRjNWMyNmEyYzkxZGUzNTYyMTI0MTlhYzhiYzdmY2Y5ODY5NTI3ZTk","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-12-25T11:17:03Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-12-25T11:17:03Z"},"message":"Fix hangup with Show connections on Set/Get nodes","tree":{"sha":"2fa38f2cae5b5ab1d54c46cb3db393cc499b3068","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/2fa38f2cae5b5ab1d54c46cb3db393cc499b3068"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/4c5c26a2c91de356212419ac8bc7fcf9869527e9","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/4c5c26a2c91de356212419ac8bc7fcf9869527e9","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/4c5c26a2c91de356212419ac8bc7fcf9869527e9","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/4c5c26a2c91de356212419ac8bc7fcf9869527e9/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"7a190ce8c1fe8abccd4fe58c5c4f4732ca2ac7cd","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/7a190ce8c1fe8abccd4fe58c5c4f4732ca2ac7cd","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/7a190ce8c1fe8abccd4fe58c5c4f4732ca2ac7cd"}]},{"sha":"f38b89ba7f2f063a7fe679170782e964793ea438","node_id":"C_kwDOKZZTCtoAKGYzOGI4OWJhN2YyZjA2M2E3ZmU2NzkxNzA3ODJlOTY0NzkzZWE0Mzg","commit":{"author":{"name":"Mel Massadian","email":"mel@melmassadian.com","date":"2024-12-23T17:29:20Z"},"committer":{"name":"Mel Massadian","email":"mel@melmassadian.com","date":"2024-12-23T17:29:20Z"},"message":"fix: 🐛 message","tree":{"sha":"4d316e4f64b0748fac3fe53f8917834d5bf1dba5","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/4d316e4f64b0748fac3fe53f8917834d5bf1dba5"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/f38b89ba7f2f063a7fe679170782e964793ea438","comment_count":0,"verification":{"verified":true,"reason":"valid","signature":"-----BEGIN PGP SIGNATURE-----\n\niIsEABYKADMWIQRH8UJWspDSAvvcnYEd/w6fccfIWgUCZ2md8RUcbWVsQG1lbG1h\nc3NhZGlhbi5jb20ACgkQHf8On3HHyFpCRAEAzbeI30cVdoT/STs7bYZFKBrOOteE\nkwl3tthQQDBS0M0BAP/QbbWglMTVwqqsu3GIn5xa4wlMZE8j0wKUQNCWRBoE\n=FNeB\n-----END PGP SIGNATURE-----","payload":"tree 4d316e4f64b0748fac3fe53f8917834d5bf1dba5\nparent 3c6bb87083c4b04a40dd97510afba6233dbb8dee\nauthor Mel Massadian 1734974960 +0100\ncommitter Mel Massadian 1734974960 +0100\n\nfix: 🐛 message\n","verified_at":"2024-12-23T17:29:34Z"}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/f38b89ba7f2f063a7fe679170782e964793ea438","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/f38b89ba7f2f063a7fe679170782e964793ea438","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/f38b89ba7f2f063a7fe679170782e964793ea438/comments","author":{"login":"melMass","id":7041726,"node_id":"MDQ6VXNlcjcwNDE3MjY=","avatar_url":"https://avatars.githubusercontent.com/u/7041726?v=4","gravatar_id":"","url":"https://api.github.com/users/melMass","html_url":"https://github.com/melMass","followers_url":"https://api.github.com/users/melMass/followers","following_url":"https://api.github.com/users/melMass/following{/other_user}","gists_url":"https://api.github.com/users/melMass/gists{/gist_id}","starred_url":"https://api.github.com/users/melMass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melMass/subscriptions","organizations_url":"https://api.github.com/users/melMass/orgs","repos_url":"https://api.github.com/users/melMass/repos","events_url":"https://api.github.com/users/melMass/events{/privacy}","received_events_url":"https://api.github.com/users/melMass/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"melMass","id":7041726,"node_id":"MDQ6VXNlcjcwNDE3MjY=","avatar_url":"https://avatars.githubusercontent.com/u/7041726?v=4","gravatar_id":"","url":"https://api.github.com/users/melMass","html_url":"https://github.com/melMass","followers_url":"https://api.github.com/users/melMass/followers","following_url":"https://api.github.com/users/melMass/following{/other_user}","gists_url":"https://api.github.com/users/melMass/gists{/gist_id}","starred_url":"https://api.github.com/users/melMass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melMass/subscriptions","organizations_url":"https://api.github.com/users/melMass/orgs","repos_url":"https://api.github.com/users/melMass/repos","events_url":"https://api.github.com/users/melMass/events{/privacy}","received_events_url":"https://api.github.com/users/melMass/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"3c6bb87083c4b04a40dd97510afba6233dbb8dee","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/3c6bb87083c4b04a40dd97510afba6233dbb8dee","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/3c6bb87083c4b04a40dd97510afba6233dbb8dee"}]},{"sha":"3c6bb87083c4b04a40dd97510afba6233dbb8dee","node_id":"C_kwDOKZZTCtoAKDNjNmJiODcwODNjNGIwNGE0MGRkOTc1MTBhZmJhNjIzM2RiYjhkZWU","commit":{"author":{"name":"Mel Massadian","email":"mel@melmassadian.com","date":"2024-12-23T17:24:54Z"},"committer":{"name":"Mel Massadian","email":"mel@melmassadian.com","date":"2024-12-23T17:24:54Z"},"message":"fix: 🐛 simplify set/get alerts\n\nNow use the builtin toast api","tree":{"sha":"311a081068b1ed7c0d70487a64a4504a4d616b94","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/311a081068b1ed7c0d70487a64a4504a4d616b94"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/3c6bb87083c4b04a40dd97510afba6233dbb8dee","comment_count":0,"verification":{"verified":true,"reason":"valid","signature":"-----BEGIN PGP SIGNATURE-----\n\niIsEABYKADMWIQRH8UJWspDSAvvcnYEd/w6fccfIWgUCZ2mc5xUcbWVsQG1lbG1h\nc3NhZGlhbi5jb20ACgkQHf8On3HHyFqQOwD+MqrwnSnZc+e+yojaASwfLirI/2Fk\n6NdAdwnETz/x24YBAOuUrGQPnF8UALY1QoU6PfCZQgIDnB2hfuDK/0T0lQUO\n=X/Od\n-----END PGP SIGNATURE-----","payload":"tree 311a081068b1ed7c0d70487a64a4504a4d616b94\nparent cdbd38213fa612adcd9e7e4787334777c86f0930\nauthor Mel Massadian 1734974694 +0100\ncommitter Mel Massadian 1734974694 +0100\n\nfix: 🐛 simplify set/get alerts\n\nNow use the builtin toast api\n","verified_at":"2024-12-23T17:26:40Z"}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/3c6bb87083c4b04a40dd97510afba6233dbb8dee","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/3c6bb87083c4b04a40dd97510afba6233dbb8dee","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/3c6bb87083c4b04a40dd97510afba6233dbb8dee/comments","author":{"login":"melMass","id":7041726,"node_id":"MDQ6VXNlcjcwNDE3MjY=","avatar_url":"https://avatars.githubusercontent.com/u/7041726?v=4","gravatar_id":"","url":"https://api.github.com/users/melMass","html_url":"https://github.com/melMass","followers_url":"https://api.github.com/users/melMass/followers","following_url":"https://api.github.com/users/melMass/following{/other_user}","gists_url":"https://api.github.com/users/melMass/gists{/gist_id}","starred_url":"https://api.github.com/users/melMass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melMass/subscriptions","organizations_url":"https://api.github.com/users/melMass/orgs","repos_url":"https://api.github.com/users/melMass/repos","events_url":"https://api.github.com/users/melMass/events{/privacy}","received_events_url":"https://api.github.com/users/melMass/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"melMass","id":7041726,"node_id":"MDQ6VXNlcjcwNDE3MjY=","avatar_url":"https://avatars.githubusercontent.com/u/7041726?v=4","gravatar_id":"","url":"https://api.github.com/users/melMass","html_url":"https://github.com/melMass","followers_url":"https://api.github.com/users/melMass/followers","following_url":"https://api.github.com/users/melMass/following{/other_user}","gists_url":"https://api.github.com/users/melMass/gists{/gist_id}","starred_url":"https://api.github.com/users/melMass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melMass/subscriptions","organizations_url":"https://api.github.com/users/melMass/orgs","repos_url":"https://api.github.com/users/melMass/repos","events_url":"https://api.github.com/users/melMass/events{/privacy}","received_events_url":"https://api.github.com/users/melMass/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"cdbd38213fa612adcd9e7e4787334777c86f0930","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/cdbd38213fa612adcd9e7e4787334777c86f0930","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/cdbd38213fa612adcd9e7e4787334777c86f0930"}]},{"sha":"7235a3dccf371e327453c45a839dd824f6e86794","node_id":"C_kwDOKZZTCtoAKDcyMzVhM2RjY2YzNzFlMzI3NDUzYzQ1YTgzOWRkODI0ZjZlODY3OTQ","commit":{"author":{"name":"filtered","email":"176114999+webfiltered@users.noreply.github.com","date":"2024-08-12T15:16:21Z"},"committer":{"name":"filtered","email":"176114999+webfiltered@users.noreply.github.com","date":"2024-08-12T15:16:21Z"},"message":"Adds support for LiteGraph LiteGraph ES6 classes\n\nThis should continue to work unchanged on old versions of ComfyUI.\n\nThe changes just allow the set/get nodes to also work with the latest version of litegraph - conversion to proper classes is slowly going on.","tree":{"sha":"eea227b4bfbe5086a1aec93b07203a0dce7839a9","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/eea227b4bfbe5086a1aec93b07203a0dce7839a9"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/7235a3dccf371e327453c45a839dd824f6e86794","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/7235a3dccf371e327453c45a839dd824f6e86794","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/7235a3dccf371e327453c45a839dd824f6e86794","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/7235a3dccf371e327453c45a839dd824f6e86794/comments","author":{"login":"webfiltered","id":176114999,"node_id":"U_kgDOCn9NNw","avatar_url":"https://avatars.githubusercontent.com/u/176114999?v=4","gravatar_id":"","url":"https://api.github.com/users/webfiltered","html_url":"https://github.com/webfiltered","followers_url":"https://api.github.com/users/webfiltered/followers","following_url":"https://api.github.com/users/webfiltered/following{/other_user}","gists_url":"https://api.github.com/users/webfiltered/gists{/gist_id}","starred_url":"https://api.github.com/users/webfiltered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webfiltered/subscriptions","organizations_url":"https://api.github.com/users/webfiltered/orgs","repos_url":"https://api.github.com/users/webfiltered/repos","events_url":"https://api.github.com/users/webfiltered/events{/privacy}","received_events_url":"https://api.github.com/users/webfiltered/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"webfiltered","id":176114999,"node_id":"U_kgDOCn9NNw","avatar_url":"https://avatars.githubusercontent.com/u/176114999?v=4","gravatar_id":"","url":"https://api.github.com/users/webfiltered","html_url":"https://github.com/webfiltered","followers_url":"https://api.github.com/users/webfiltered/followers","following_url":"https://api.github.com/users/webfiltered/following{/other_user}","gists_url":"https://api.github.com/users/webfiltered/gists{/gist_id}","starred_url":"https://api.github.com/users/webfiltered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webfiltered/subscriptions","organizations_url":"https://api.github.com/users/webfiltered/orgs","repos_url":"https://api.github.com/users/webfiltered/repos","events_url":"https://api.github.com/users/webfiltered/events{/privacy}","received_events_url":"https://api.github.com/users/webfiltered/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"b751e3438355db4684ca459517673931617ad537","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/b751e3438355db4684ca459517673931617ad537","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/b751e3438355db4684ca459517673931617ad537"}]},{"sha":"2f843db54e3e9553c9a2c801b96a377eb6195829","node_id":"C_kwDOKZZTCtoAKDJmODQzZGI1NGUzZTk1NTNjOWEyYzgwMWI5NmEzNzdlYjYxOTU4Mjk","commit":{"author":{"name":"Kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-05-16T12:04:33Z"},"committer":{"name":"Kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-05-16T12:04:33Z"},"message":"More Set/Get autocolors","tree":{"sha":"7dcfd1d3dbde8124c2b78c2c42a1e29a2cdf92e5","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/7dcfd1d3dbde8124c2b78c2c42a1e29a2cdf92e5"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/2f843db54e3e9553c9a2c801b96a377eb6195829","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/2f843db54e3e9553c9a2c801b96a377eb6195829","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/2f843db54e3e9553c9a2c801b96a377eb6195829","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/2f843db54e3e9553c9a2c801b96a377eb6195829/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"fca2e8285397420f45600f2afa0342db64925114","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/fca2e8285397420f45600f2afa0342db64925114","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/fca2e8285397420f45600f2afa0342db64925114"}]},{"sha":"cba1cb92c1bc11bd7cbdf2cf21a4e96dbc428816","node_id":"C_kwDOKZZTCtoAKGNiYTFjYjkyYzFiYzExYmQ3Y2JkZjJjZjIxYTRlOTZkYmM0Mjg4MTY","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-05-09T18:25:15Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-05-09T18:25:15Z"},"message":"Update setgetnodes.js","tree":{"sha":"c8621bdf956e1a044ddfd54dd38b7b12f84916d3","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/c8621bdf956e1a044ddfd54dd38b7b12f84916d3"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/cba1cb92c1bc11bd7cbdf2cf21a4e96dbc428816","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/cba1cb92c1bc11bd7cbdf2cf21a4e96dbc428816","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/cba1cb92c1bc11bd7cbdf2cf21a4e96dbc428816","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/cba1cb92c1bc11bd7cbdf2cf21a4e96dbc428816/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"148c805a15dbbf9657cc9f50a21efa5993db87c7","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/148c805a15dbbf9657cc9f50a21efa5993db87c7","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/148c805a15dbbf9657cc9f50a21efa5993db87c7"}]},{"sha":"b4480e0ccce40d31e45ac1d82c3280b5903a1668","node_id":"C_kwDOKZZTCtoAKGI0NDgwZTBjY2NlNDBkMzFlNDVhYzFkODJjMzI4MGI1OTAzYTE2Njg","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-04-25T09:25:35Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-04-25T09:25:35Z"},"message":"Update setgetnodes.js","tree":{"sha":"6abf3c3f0c089ae146b9b6e62cc12adb2955d9a8","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/6abf3c3f0c089ae146b9b6e62cc12adb2955d9a8"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/b4480e0ccce40d31e45ac1d82c3280b5903a1668","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/b4480e0ccce40d31e45ac1d82c3280b5903a1668","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/b4480e0ccce40d31e45ac1d82c3280b5903a1668","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/b4480e0ccce40d31e45ac1d82c3280b5903a1668/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"1f6dfab05d8a9bc0d52393e00d45575b34b075c2","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/1f6dfab05d8a9bc0d52393e00d45575b34b075c2","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/1f6dfab05d8a9bc0d52393e00d45575b34b075c2"}]},{"sha":"6cb0e8e334c867f52968b4c8f71380618a55613a","node_id":"C_kwDOKZZTCtoAKDZjYjBlOGUzMzRjODY3ZjUyOTY4YjRjOGY3MTM4MDYxOGE1NTYxM2E","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-04-24T18:30:07Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-04-24T18:30:07Z"},"message":"set/get tweaks","tree":{"sha":"a27eec5429654399fc50d1a4b318350b5e15e68a","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/a27eec5429654399fc50d1a4b318350b5e15e68a"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/6cb0e8e334c867f52968b4c8f71380618a55613a","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/6cb0e8e334c867f52968b4c8f71380618a55613a","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/6cb0e8e334c867f52968b4c8f71380618a55613a","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/6cb0e8e334c867f52968b4c8f71380618a55613a/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"473ea60f78b98a937097f1e616feafe7bc3c880b","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/473ea60f78b98a937097f1e616feafe7bc3c880b","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/473ea60f78b98a937097f1e616feafe7bc3c880b"}]},{"sha":"473ea60f78b98a937097f1e616feafe7bc3c880b","node_id":"C_kwDOKZZTCtoAKDQ3M2VhNjBmNzhiOThhOTM3MDk3ZjFlNjE2ZmVhZmU3YmMzYzg4MGI","commit":{"author":{"name":"Kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-04-24T14:18:51Z"},"committer":{"name":"Kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-04-24T14:18:51Z"},"message":"Update setgetnodes.js","tree":{"sha":"a225ac218f4d982d736f75db28bbb4ff7971c4cb","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/a225ac218f4d982d736f75db28bbb4ff7971c4cb"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/473ea60f78b98a937097f1e616feafe7bc3c880b","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/473ea60f78b98a937097f1e616feafe7bc3c880b","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/473ea60f78b98a937097f1e616feafe7bc3c880b","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/473ea60f78b98a937097f1e616feafe7bc3c880b/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"a0ea96593d528247ac325892e6d7a7cf16ae10a8","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/a0ea96593d528247ac325892e6d7a7cf16ae10a8","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/a0ea96593d528247ac325892e6d7a7cf16ae10a8"}]},{"sha":"a0ea96593d528247ac325892e6d7a7cf16ae10a8","node_id":"C_kwDOKZZTCtoAKGEwZWE5NjU5M2Q1MjgyNDdhYzMyNTg5MmU2ZDdhN2NmMTZhZTEwYTg","commit":{"author":{"name":"Kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-04-24T11:34:11Z"},"committer":{"name":"Kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-04-24T11:34:11Z"},"message":"Update setgetnodes.js","tree":{"sha":"609edf89d5782cac65c5735df497430e366b8f96","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/609edf89d5782cac65c5735df497430e366b8f96"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/a0ea96593d528247ac325892e6d7a7cf16ae10a8","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/a0ea96593d528247ac325892e6d7a7cf16ae10a8","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/a0ea96593d528247ac325892e6d7a7cf16ae10a8","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/a0ea96593d528247ac325892e6d7a7cf16ae10a8/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"2f5264d4b612539e0cc3733a4ded4f7a0964f011","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/2f5264d4b612539e0cc3733a4ded4f7a0964f011","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/2f5264d4b612539e0cc3733a4ded4f7a0964f011"}]},{"sha":"2f5264d4b612539e0cc3733a4ded4f7a0964f011","node_id":"C_kwDOKZZTCtoAKDJmNTI2NGQ0YjYxMjUzOWUwY2MzNzMzYTRkZWQ0ZjdhMDk2NGYwMTE","commit":{"author":{"name":"Kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-04-24T11:31:58Z"},"committer":{"name":"Kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-04-24T11:31:58Z"},"message":"Merge branch 'pr/50'","tree":{"sha":"44a54be9b66e77f6a1dd90d400919c297a4f6c6d","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/44a54be9b66e77f6a1dd90d400919c297a4f6c6d"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/2f5264d4b612539e0cc3733a4ded4f7a0964f011","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/2f5264d4b612539e0cc3733a4ded4f7a0964f011","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/2f5264d4b612539e0cc3733a4ded4f7a0964f011","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/2f5264d4b612539e0cc3733a4ded4f7a0964f011/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"7c92f70927f6d58eb8639e79bcb95efe0aed5d79","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/7c92f70927f6d58eb8639e79bcb95efe0aed5d79","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/7c92f70927f6d58eb8639e79bcb95efe0aed5d79"},{"sha":"fafaa60f372adbd65a2cea7c93a626d5e0c2d7f8","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/fafaa60f372adbd65a2cea7c93a626d5e0c2d7f8","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/fafaa60f372adbd65a2cea7c93a626d5e0c2d7f8"}]},{"sha":"e9b8af8fd0263c65d8a7665c5b9d5589226e7fd0","node_id":"C_kwDOKZZTCtoAKGU5YjhhZjhmZDAyNjNjNjVkOGE3NjY1YzViOWQ1NTg5MjI2ZTdmZDA","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-04-21T18:13:07Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-04-21T18:13:07Z"},"message":"Update setgetnodes.js","tree":{"sha":"7633fe07b2461e495cc539a9f51c35dba828170b","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/7633fe07b2461e495cc539a9f51c35dba828170b"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/e9b8af8fd0263c65d8a7665c5b9d5589226e7fd0","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/e9b8af8fd0263c65d8a7665c5b9d5589226e7fd0","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/e9b8af8fd0263c65d8a7665c5b9d5589226e7fd0","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/e9b8af8fd0263c65d8a7665c5b9d5589226e7fd0/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"38646a82b20a65360eb47c0ec2299c6d7c06cc89","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/38646a82b20a65360eb47c0ec2299c6d7c06cc89","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/38646a82b20a65360eb47c0ec2299c6d7c06cc89"}]},{"sha":"38646a82b20a65360eb47c0ec2299c6d7c06cc89","node_id":"C_kwDOKZZTCtoAKDM4NjQ2YTgyYjIwYTY1MzYwZWI0N2MwZWMyMjk5YzZkN2MwNmNjODk","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-04-21T13:16:21Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-04-21T13:16:21Z"},"message":"Add menu entry to jump to Set node from Get node","tree":{"sha":"7fe1b0ab651b55fe271a72812066e9b21562b282","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/7fe1b0ab651b55fe271a72812066e9b21562b282"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/38646a82b20a65360eb47c0ec2299c6d7c06cc89","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/38646a82b20a65360eb47c0ec2299c6d7c06cc89","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/38646a82b20a65360eb47c0ec2299c6d7c06cc89","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/38646a82b20a65360eb47c0ec2299c6d7c06cc89/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"469d932019df7205dde99624562f24a141c174ff","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/469d932019df7205dde99624562f24a141c174ff","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/469d932019df7205dde99624562f24a141c174ff"}]},{"sha":"fafaa60f372adbd65a2cea7c93a626d5e0c2d7f8","node_id":"C_kwDOKZZTCtoAKGZhZmFhNjBmMzcyYWRiZDY1YTJjZWE3YzkzYTYyNmQ1ZTBjMmQ3Zjg","commit":{"author":{"name":"Maoxie","email":"edwardyzt@gmail.com","date":"2024-04-19T10:41:07Z"},"committer":{"name":"Maoxie","email":"edwardyzt@gmail.com","date":"2024-04-19T10:41:07Z"},"message":"when selected, display links between GetNodes & SetNode","tree":{"sha":"5d75aab81f1b35ca6d879e6fe91bdf8c68174dc1","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/5d75aab81f1b35ca6d879e6fe91bdf8c68174dc1"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/fafaa60f372adbd65a2cea7c93a626d5e0c2d7f8","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/fafaa60f372adbd65a2cea7c93a626d5e0c2d7f8","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/fafaa60f372adbd65a2cea7c93a626d5e0c2d7f8","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/fafaa60f372adbd65a2cea7c93a626d5e0c2d7f8/comments","author":{"login":"maoXyzt","id":28984159,"node_id":"MDQ6VXNlcjI4OTg0MTU5","avatar_url":"https://avatars.githubusercontent.com/u/28984159?v=4","gravatar_id":"","url":"https://api.github.com/users/maoXyzt","html_url":"https://github.com/maoXyzt","followers_url":"https://api.github.com/users/maoXyzt/followers","following_url":"https://api.github.com/users/maoXyzt/following{/other_user}","gists_url":"https://api.github.com/users/maoXyzt/gists{/gist_id}","starred_url":"https://api.github.com/users/maoXyzt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maoXyzt/subscriptions","organizations_url":"https://api.github.com/users/maoXyzt/orgs","repos_url":"https://api.github.com/users/maoXyzt/repos","events_url":"https://api.github.com/users/maoXyzt/events{/privacy}","received_events_url":"https://api.github.com/users/maoXyzt/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"maoXyzt","id":28984159,"node_id":"MDQ6VXNlcjI4OTg0MTU5","avatar_url":"https://avatars.githubusercontent.com/u/28984159?v=4","gravatar_id":"","url":"https://api.github.com/users/maoXyzt","html_url":"https://github.com/maoXyzt","followers_url":"https://api.github.com/users/maoXyzt/followers","following_url":"https://api.github.com/users/maoXyzt/following{/other_user}","gists_url":"https://api.github.com/users/maoXyzt/gists{/gist_id}","starred_url":"https://api.github.com/users/maoXyzt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maoXyzt/subscriptions","organizations_url":"https://api.github.com/users/maoXyzt/orgs","repos_url":"https://api.github.com/users/maoXyzt/repos","events_url":"https://api.github.com/users/maoXyzt/events{/privacy}","received_events_url":"https://api.github.com/users/maoXyzt/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"85724229f4777eee966a9772e439fcb901427d47","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/85724229f4777eee966a9772e439fcb901427d47","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/85724229f4777eee966a9772e439fcb901427d47"}]},{"sha":"10d4debafcc2066aa3224a08fe23e30d428860df","node_id":"C_kwDOKZZTCtoAKDEwZDRkZWJhZmNjMjA2NmFhMzIyNGEwOGZlMjNlMzBkNDI4ODYwZGY","commit":{"author":{"name":"Kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-04-08T10:22:10Z"},"committer":{"name":"Kijai","email":"40791699+kijai@users.noreply.github.com","date":"2024-04-08T10:22:10Z"},"message":"Menu settings updates","tree":{"sha":"1fbb08510ed716f02d3d49b495c64b9bbd5043e7","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/1fbb08510ed716f02d3d49b495c64b9bbd5043e7"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/10d4debafcc2066aa3224a08fe23e30d428860df","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/10d4debafcc2066aa3224a08fe23e30d428860df","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/10d4debafcc2066aa3224a08fe23e30d428860df","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/10d4debafcc2066aa3224a08fe23e30d428860df/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"0d46ee88660419b5424eacbe6666ffc8a6a0f40f","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/0d46ee88660419b5424eacbe6666ffc8a6a0f40f","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/0d46ee88660419b5424eacbe6666ffc8a6a0f40f"}]},{"sha":"52e98cfa153c5b3978af9f9ce37f80871dd45009","node_id":"C_kwDOKZZTCtoAKDUyZTk4Y2ZhMTUzYzViMzk3OGFmOWY5Y2UzN2Y4MDg3MWRkNDUwMDk","commit":{"author":{"name":"Harel Cain","email":"harel@lightricks.com","date":"2024-03-19T11:42:49Z"},"committer":{"name":"Harel Cain","email":"harel@lightricks.com","date":"2024-03-19T11:44:03Z"},"message":"Fix a bug that causes comfy to hang","tree":{"sha":"a46c5f7780dd886aaace0c20a2d86f572a1779c4","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/a46c5f7780dd886aaace0c20a2d86f572a1779c4"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/52e98cfa153c5b3978af9f9ce37f80871dd45009","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/52e98cfa153c5b3978af9f9ce37f80871dd45009","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/52e98cfa153c5b3978af9f9ce37f80871dd45009","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/52e98cfa153c5b3978af9f9ce37f80871dd45009/comments","author":{"login":"harelc","id":3287673,"node_id":"MDQ6VXNlcjMyODc2NzM=","avatar_url":"https://avatars.githubusercontent.com/u/3287673?v=4","gravatar_id":"","url":"https://api.github.com/users/harelc","html_url":"https://github.com/harelc","followers_url":"https://api.github.com/users/harelc/followers","following_url":"https://api.github.com/users/harelc/following{/other_user}","gists_url":"https://api.github.com/users/harelc/gists{/gist_id}","starred_url":"https://api.github.com/users/harelc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harelc/subscriptions","organizations_url":"https://api.github.com/users/harelc/orgs","repos_url":"https://api.github.com/users/harelc/repos","events_url":"https://api.github.com/users/harelc/events{/privacy}","received_events_url":"https://api.github.com/users/harelc/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"harelc","id":3287673,"node_id":"MDQ6VXNlcjMyODc2NzM=","avatar_url":"https://avatars.githubusercontent.com/u/3287673?v=4","gravatar_id":"","url":"https://api.github.com/users/harelc","html_url":"https://github.com/harelc","followers_url":"https://api.github.com/users/harelc/followers","following_url":"https://api.github.com/users/harelc/following{/other_user}","gists_url":"https://api.github.com/users/harelc/gists{/gist_id}","starred_url":"https://api.github.com/users/harelc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harelc/subscriptions","organizations_url":"https://api.github.com/users/harelc/orgs","repos_url":"https://api.github.com/users/harelc/repos","events_url":"https://api.github.com/users/harelc/events{/privacy}","received_events_url":"https://api.github.com/users/harelc/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"970a23467d1f4030a3d0295b9b2201c48f1d28ec","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/970a23467d1f4030a3d0295b9b2201c48f1d28ec","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/970a23467d1f4030a3d0295b9b2201c48f1d28ec"}]},{"sha":"2acf45063c1c1c2b4cbc22275baffbbed7cd1440","node_id":"C_kwDOKZZTCtoAKDJhY2Y0NTA2M2MxYzFjMmI0Y2JjMjIyNzViYWZmYmJlZDdjZDE0NDA","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2023-12-15T22:19:26Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2023-12-15T22:19:26Z"},"message":"Make set node error an alert again, but throttled","tree":{"sha":"ff2025c3019c598b2fd4869ee9a37539894acd8c","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/ff2025c3019c598b2fd4869ee9a37539894acd8c"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/2acf45063c1c1c2b4cbc22275baffbbed7cd1440","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/2acf45063c1c1c2b4cbc22275baffbbed7cd1440","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/2acf45063c1c1c2b4cbc22275baffbbed7cd1440","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/2acf45063c1c1c2b4cbc22275baffbbed7cd1440/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"004c4120e8d807203ea785b7c8c96cae2c1ef6e8","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/004c4120e8d807203ea785b7c8c96cae2c1ef6e8","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/004c4120e8d807203ea785b7c8c96cae2c1ef6e8"}]},{"sha":"431c8d57aad5296cd09f8640ab82e63fb2190de9","node_id":"C_kwDOKZZTCtoAKDQzMWM4ZDU3YWFkNTI5NmNkMDlmODY0MGFiODJlNjNmYjIxOTBkZTk","commit":{"author":{"name":"kijai","email":"jukka.seppanen@poke.fi","date":"2023-12-14T13:16:31Z"},"committer":{"name":"kijai","email":"jukka.seppanen@poke.fi","date":"2023-12-14T13:16:31Z"},"message":"bugfix","tree":{"sha":"7426de1f189e62eaa671dff37a95a98589521dd0","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/7426de1f189e62eaa671dff37a95a98589521dd0"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/431c8d57aad5296cd09f8640ab82e63fb2190de9","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/431c8d57aad5296cd09f8640ab82e63fb2190de9","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/431c8d57aad5296cd09f8640ab82e63fb2190de9","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/431c8d57aad5296cd09f8640ab82e63fb2190de9/comments","author":null,"committer":null,"parents":[{"sha":"788bb7936a77ffb8cdedfb62cff4c59345783334","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/788bb7936a77ffb8cdedfb62cff4c59345783334","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/788bb7936a77ffb8cdedfb62cff4c59345783334"}]},{"sha":"f6354e7850b234a4cbc9f65141b9a50189d95ae1","node_id":"C_kwDOKZZTCtoAKGY2MzU0ZTc4NTBiMjM0YTRjYmM5ZjY1MTQxYjlhNTAxODlkOTVhZTE","commit":{"author":{"name":"kijai","email":"jukka.seppanen@poke.fi","date":"2023-12-11T12:26:43Z"},"committer":{"name":"kijai","email":"jukka.seppanen@poke.fi","date":"2023-12-11T12:26:43Z"},"message":"Make set/get node automatic coloring optional","tree":{"sha":"4d3f0342e5ad907177c742c021baaa8178bc12e4","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/4d3f0342e5ad907177c742c021baaa8178bc12e4"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/f6354e7850b234a4cbc9f65141b9a50189d95ae1","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/f6354e7850b234a4cbc9f65141b9a50189d95ae1","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/f6354e7850b234a4cbc9f65141b9a50189d95ae1","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/f6354e7850b234a4cbc9f65141b9a50189d95ae1/comments","author":null,"committer":null,"parents":[{"sha":"2665f00db985a05ea04f83bfaceb48d69b3d3b8f","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/2665f00db985a05ea04f83bfaceb48d69b3d3b8f","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/2665f00db985a05ea04f83bfaceb48d69b3d3b8f"}]},{"sha":"c1859358c064917548ffbe50c23adba171add74e","node_id":"C_kwDOKZZTCtoAKGMxODU5MzU4YzA2NDkxNzU0OGZmYmU1MGMyM2FkYmExNzFhZGQ3NGU","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2023-12-10T18:07:03Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2023-12-10T18:07:03Z"},"message":"new experiments","tree":{"sha":"204f4bfad149010f6638641a5ccc71c0d4e6993f","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/204f4bfad149010f6638641a5ccc71c0d4e6993f"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/c1859358c064917548ffbe50c23adba171add74e","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/c1859358c064917548ffbe50c23adba171add74e","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/c1859358c064917548ffbe50c23adba171add74e","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/c1859358c064917548ffbe50c23adba171add74e/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"dd242e614f39d712f3e5109557a88e3599d5cf62","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/dd242e614f39d712f3e5109557a88e3599d5cf62","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/dd242e614f39d712f3e5109557a88e3599d5cf62"}]},{"sha":"8a8e4db2df084c6a86b48c1b801499fd47693b0d","node_id":"C_kwDOKZZTCtoAKDhhOGU0ZGIyZGYwODRjNmE4NmI0OGMxYjgwMTQ5OWZkNDc2OTNiMGQ","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2023-12-02T19:58:16Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2023-12-02T19:58:16Z"},"message":"Experimental noise stuff","tree":{"sha":"1301ed26a6c7b8a940a7bdb9a0cde4ae476a380b","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/1301ed26a6c7b8a940a7bdb9a0cde4ae476a380b"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/8a8e4db2df084c6a86b48c1b801499fd47693b0d","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/8a8e4db2df084c6a86b48c1b801499fd47693b0d","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/8a8e4db2df084c6a86b48c1b801499fd47693b0d","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/8a8e4db2df084c6a86b48c1b801499fd47693b0d/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"826d38635c729435c318b5dad92b81a9138c8e90","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/826d38635c729435c318b5dad92b81a9138c8e90","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/826d38635c729435c318b5dad92b81a9138c8e90"}]},{"sha":"1cbf8e5499ef1042491963b9ba0c916190c8fbed","node_id":"C_kwDOKZZTCtoAKDFjYmY4ZTU0OTllZjEwNDI0OTE5NjNiOWJhMGM5MTYxOTBjOGZiZWQ","commit":{"author":{"name":"kijai","email":"jukka.seppanen@poke.fi","date":"2023-11-02T14:14:15Z"},"committer":{"name":"kijai","email":"jukka.seppanen@poke.fi","date":"2023-11-02T14:14:15Z"},"message":"Add FloatConstant, new INT color and bugfixes","tree":{"sha":"0d6637f0808a38f7bb163f6362c84e15edc46708","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/0d6637f0808a38f7bb163f6362c84e15edc46708"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/1cbf8e5499ef1042491963b9ba0c916190c8fbed","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/1cbf8e5499ef1042491963b9ba0c916190c8fbed","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/1cbf8e5499ef1042491963b9ba0c916190c8fbed","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/1cbf8e5499ef1042491963b9ba0c916190c8fbed/comments","author":null,"committer":null,"parents":[{"sha":"26cf8043a50446fdac66ce51d45a64b6f2a466b0","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/26cf8043a50446fdac66ce51d45a64b6f2a466b0","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/26cf8043a50446fdac66ce51d45a64b6f2a466b0"}]},{"sha":"c78d261698f9b60f11024bea7d0ebf2ab36cb020","node_id":"C_kwDOKZZTCtoAKGM3OGQyNjE2OThmOWI2MGYxMTAyNGJlYTdkMGViZjJhYjM2Y2IwMjA","commit":{"author":{"name":"kijai","email":"jukka.seppanen@poke.fi","date":"2023-10-10T10:01:25Z"},"committer":{"name":"kijai","email":"jukka.seppanen@poke.fi","date":"2023-10-10T10:01:25Z"},"message":"Improve error handling","tree":{"sha":"4bd305603b94f593b9e0d2f31eec46d933d1b404","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/4bd305603b94f593b9e0d2f31eec46d933d1b404"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/c78d261698f9b60f11024bea7d0ebf2ab36cb020","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/c78d261698f9b60f11024bea7d0ebf2ab36cb020","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/c78d261698f9b60f11024bea7d0ebf2ab36cb020","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/c78d261698f9b60f11024bea7d0ebf2ab36cb020/comments","author":null,"committer":null,"parents":[{"sha":"3f42ff5d058525b96a20577ee3386f93d3751f0a","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/3f42ff5d058525b96a20577ee3386f93d3751f0a","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/3f42ff5d058525b96a20577ee3386f93d3751f0a"}]},{"sha":"69422c9ea90d4a8ab45729e663a4ca97fc3cba01","node_id":"C_kwDOKZZTCtoAKDY5NDIyYzllYTkwZDRhOGFiNDU3MjllNjYzYTRjYTk3ZmMzY2JhMDE","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2023-10-01T11:10:22Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2023-10-01T11:10:22Z"},"message":"Fix condmulticombine","tree":{"sha":"d2316bb845b044426e1b541336cfffd7d68559ae","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/d2316bb845b044426e1b541336cfffd7d68559ae"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/69422c9ea90d4a8ab45729e663a4ca97fc3cba01","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/69422c9ea90d4a8ab45729e663a4ca97fc3cba01","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/69422c9ea90d4a8ab45729e663a4ca97fc3cba01","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/69422c9ea90d4a8ab45729e663a4ca97fc3cba01/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"ca73cb8e8e20dbf85b4480e3146d6ca81609e3db","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/ca73cb8e8e20dbf85b4480e3146d6ca81609e3db","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/ca73cb8e8e20dbf85b4480e3146d6ca81609e3db"}]},{"sha":"ca73cb8e8e20dbf85b4480e3146d6ca81609e3db","node_id":"C_kwDOKZZTCtoAKGNhNzNjYjhlOGUyMGRiZjg1YjQ0ODBlMzE0NmQ2Y2E4MTYwOWUzZGI","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2023-09-30T23:33:02Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2023-09-30T23:33:02Z"},"message":"New nodes and bugfixing\n\nAdded GrowMaskWithBlur -node\nfixing set/get functionality, still buggy especially when loading workflows, added .js alert for the errors to troubleshoot","tree":{"sha":"b99c41e70936f0a2eeb21fdc4143d3f5191c4f8e","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/b99c41e70936f0a2eeb21fdc4143d3f5191c4f8e"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/ca73cb8e8e20dbf85b4480e3146d6ca81609e3db","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/ca73cb8e8e20dbf85b4480e3146d6ca81609e3db","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/ca73cb8e8e20dbf85b4480e3146d6ca81609e3db","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/ca73cb8e8e20dbf85b4480e3146d6ca81609e3db/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"0e27281ac537ceec70d16ae64e67101bef3ae335","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/0e27281ac537ceec70d16ae64e67101bef3ae335","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/0e27281ac537ceec70d16ae64e67101bef3ae335"}]},{"sha":"0e27281ac537ceec70d16ae64e67101bef3ae335","node_id":"C_kwDOKZZTCtoAKDBlMjcyODFhYzUzN2NlZWM3MGQxNmFlNjRlNjcxMDFiZWYzYWUzMzU","commit":{"author":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2023-09-29T22:31:28Z"},"committer":{"name":"kijai","email":"40791699+kijai@users.noreply.github.com","date":"2023-09-29T22:31:28Z"},"message":"Update setgetnodes.js","tree":{"sha":"d941f691776216fb20b6958f85bd464729a06b69","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/d941f691776216fb20b6958f85bd464729a06b69"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/0e27281ac537ceec70d16ae64e67101bef3ae335","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/0e27281ac537ceec70d16ae64e67101bef3ae335","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/0e27281ac537ceec70d16ae64e67101bef3ae335","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/0e27281ac537ceec70d16ae64e67101bef3ae335/comments","author":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"kijai","id":40791699,"node_id":"MDQ6VXNlcjQwNzkxNjk5","avatar_url":"https://avatars.githubusercontent.com/u/40791699?v=4","gravatar_id":"","url":"https://api.github.com/users/kijai","html_url":"https://github.com/kijai","followers_url":"https://api.github.com/users/kijai/followers","following_url":"https://api.github.com/users/kijai/following{/other_user}","gists_url":"https://api.github.com/users/kijai/gists{/gist_id}","starred_url":"https://api.github.com/users/kijai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kijai/subscriptions","organizations_url":"https://api.github.com/users/kijai/orgs","repos_url":"https://api.github.com/users/kijai/repos","events_url":"https://api.github.com/users/kijai/events{/privacy}","received_events_url":"https://api.github.com/users/kijai/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"76d32c98229677b357795248f7337bef2d62851c","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/76d32c98229677b357795248f7337bef2d62851c","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/76d32c98229677b357795248f7337bef2d62851c"}]},{"sha":"76d32c98229677b357795248f7337bef2d62851c","node_id":"C_kwDOKZZTCtoAKDc2ZDMyYzk4MjI5Njc3YjM1Nzc5NTI0OGY3MzM3YmVmMmQ2Mjg1MWM","commit":{"author":{"name":"kijai","email":"jukka.seppanen@poke.fi","date":"2023-09-29T15:00:42Z"},"committer":{"name":"kijai","email":"jukka.seppanen@poke.fi","date":"2023-09-29T15:00:42Z"},"message":"First commit\n\nMost stuff probably still buggy","tree":{"sha":"9639d0a7a1a2ec40d8337e382d7d46795abfc7e7","url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/trees/9639d0a7a1a2ec40d8337e382d7d46795abfc7e7"},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/git/commits/76d32c98229677b357795248f7337bef2d62851c","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/76d32c98229677b357795248f7337bef2d62851c","html_url":"https://github.com/kijai/ComfyUI-KJNodes/commit/76d32c98229677b357795248f7337bef2d62851c","comments_url":"https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/76d32c98229677b357795248f7337bef2d62851c/comments","author":null,"committer":null,"parents":[]}] \ No newline at end of file diff --git a/docs/hel-892/scail-load-reference/pr-start.json b/docs/hel-892/scail-load-reference/pr-start.json new file mode 100644 index 00000000..efd9c383 --- /dev/null +++ b/docs/hel-892/scail-load-reference/pr-start.json @@ -0,0 +1,14 @@ +{ + "number": 25, + "state": "open", + "merged": false, + "html_url": "http://gitea.xbay.cc/leefer/aigc-home/pulls/25", + "head": { + "ref": "agent/agent/a64a969a6a44", + "sha": "821e33dd87e28d8ede95dc08e62c87ba64a07815" + }, + "base": { + "ref": "main", + "sha": "1fc8bdb8bb2a88ccace6f21a507fd77bcf22f532" + } +} diff --git a/docs/hel-892/scail-load-reference/pyproject.toml b/docs/hel-892/scail-load-reference/pyproject.toml new file mode 100644 index 00000000..a575fb94 --- /dev/null +++ b/docs/hel-892/scail-load-reference/pyproject.toml @@ -0,0 +1,15 @@ +[project] +name = "comfyui-videohelpersuite" +description = "Nodes related to video workflows" +version = "1.7.4" +license = { file = "LICENSE" } +dependencies = ["opencv-python", "imageio-ffmpeg"] + +[project.urls] +Repository = "https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite" + +# Used by Comfy Registry https://comfyregistry.org +[tool.comfy] +PublisherId = "kosinkadink" +DisplayName = "ComfyUI-VideoHelperSuite" +Icon = "" diff --git a/docs/hel-892/scail-load-reference/sources.json b/docs/hel-892/scail-load-reference/sources.json new file mode 100644 index 00000000..c16e5650 --- /dev/null +++ b/docs/hel-892/scail-load-reference/sources.json @@ -0,0 +1,445 @@ +{ + "sources": [ + { + "id": "VHS@8e4d79471bf1952154768e8435a9300077b534fa:videohelpersuite/nodes.py", + "commit": "8e4d79471bf1952154768e8435a9300077b534fa", + "raw_url": "https://raw.githubusercontent.com/Kosinkadink/ComfyUI-VideoHelperSuite/8e4d79471bf1952154768e8435a9300077b534fa/videohelpersuite/nodes.py", + "local_file": "videohelpersuite__nodes.py", + "sha256": "a7e1ee2f0222a0b4271464256e8390b7bc18604eebe4d7228fbca9dee7a5d365", + "retrieved_at": "2026-10-29T21:40:56.842956+00:00", + "license": "GPL-3.0", + "lines": [ + [ + 1, + 1110 + ] + ], + "rule_locations": { + "\"VHS_LoadVideo\": LoadVideoUpload,#1025": [ + 1025, + 1025 + ] + } + }, + { + "id": "VHS@8e4d79471bf1952154768e8435a9300077b534fa:videohelpersuite/load_video_nodes.py", + "commit": "8e4d79471bf1952154768e8435a9300077b534fa", + "raw_url": "https://raw.githubusercontent.com/Kosinkadink/ComfyUI-VideoHelperSuite/8e4d79471bf1952154768e8435a9300077b534fa/videohelpersuite/load_video_nodes.py", + "local_file": "videohelpersuite__load_video_nodes.py", + "sha256": "a62df0fad987729e3de500dc85c786587b609d9eb571f09fdc92d25b9d530e26", + "retrieved_at": "2026-10-29T21:40:57.261271+00:00", + "license": "GPL-3.0", + "lines": [ + [ + 1, + 671 + ] + ], + "rule_locations": { + "class LoadVideoUpload:#423": [ + 423, + 423 + ], + "def get_load_formats():#42": [ + 42, + 42 + ], + "VHSLoadFormats = {#24": [ + 24, + 24 + ], + "VHSLoadFormats = {#40": [ + 40, + 40 + ], + "RETURN_TYPES = (imageOrLatent, \"INT\", \"AUDIO\", \"VHS_VIDEOINFO\")#455": [ + 455, + 455 + ], + "RETURN_TYPES = (imageOrLatent, \"INT\", \"AUDIO\", \"VHS_VIDEOINFO\")#502": [ + 502, + 502 + ], + "\"loaded_fps\"#410": [ + 410, + 410 + ], + "\"custom_width\": (\"INT\"#436": [ + 436, + 436 + ], + "\"custom_width\": (\"INT\"#483": [ + 483, + 483 + ], + "\"custom_width\": (\"INT\"#535": [ + 535, + 535 + ], + "\"custom_width\": (\"INT\"#585": [ + 585, + 585 + ], + "\"custom_width\": (\"INT\"#634": [ + 634, + 634 + ] + } + }, + { + "id": "VHS@8e4d79471bf1952154768e8435a9300077b534fa:web/js/VHS.core.js", + "commit": "8e4d79471bf1952154768e8435a9300077b534fa", + "raw_url": "https://raw.githubusercontent.com/Kosinkadink/ComfyUI-VideoHelperSuite/8e4d79471bf1952154768e8435a9300077b534fa/web/js/VHS.core.js", + "local_file": "web__js__VHS.core.js", + "sha256": "4256a14d27f4dbc4cf415e4d61103df89e7fabe193991b14ac3b7e132d76767e", + "retrieved_at": "2026-10-29T21:40:57.735605+00:00", + "license": "GPL-3.0", + "lines": [ + [ + 1, + 2463 + ] + ], + "rule_locations": { + "function useKVState#41": [ + 41, + 41 + ], + "w.value = widgetDict[w.name]#110": [ + 110, + 110 + ], + "w.callback?.(w.value)#111": [ + 111, + 111 + ], + "w.callback?.(w.value)#117": [ + 117, + 117 + ], + "w.callback?.(w.value)#139": [ + 139, + 139 + ], + "function initializeLoadFormat#680": [ + 680, + 680 + ], + "let wasDefault#719": [ + 719, + 719 + ], + "function addLoadCommon#1223": [ + 1223, + 1223 + ], + "addVAEOutputToggle(nodeType#525": [ + 525, + 525 + ], + "addVAEOutputToggle(nodeType#1924": [ + 1924, + 1924 + ], + "addVAEOutputToggle(nodeType#1947": [ + 1947, + 1947 + ], + "addVAEOutputToggle(nodeType#1951": [ + 1951, + 1951 + ], + "uploadWidget.options.serialize = false#851": [ + 851, + 851 + ], + "VHSFLOAT(node#2121": [ + 2121, + 2121 + ], + "VHSINT(node#2157": [ + 2157, + 2157 + ], + "if (v == 0)#2174": [ + 2174, + 2174 + ], + "const s = this.options.step#2177": [ + 2177, + 2177 + ], + "Math.round((v - sh) / s)#2179": [ + 2179, + 2179 + ], + "nodeData?.name == \"VHS_LoadVideo\"#1903": [ + 1903, + 1903 + ], + "serialize: false#862": [ + 862, + 862 + ], + "serialize: false#2366": [ + 2366, + 2366 + ], + "w.name in inputs && w.config#142": [ + 142, + 142 + ] + } + }, + { + "id": "VHS@8e4d79471bf1952154768e8435a9300077b534fa:web/js/videoinfo.js", + "commit": "8e4d79471bf1952154768e8435a9300077b534fa", + "raw_url": "https://raw.githubusercontent.com/Kosinkadink/ComfyUI-VideoHelperSuite/8e4d79471bf1952154768e8435a9300077b534fa/web/js/videoinfo.js", + "local_file": "web__js__videoinfo.js", + "sha256": "29db4800fe2b86303619bd1768b97aabdad0fe300db93da7135bdffa43f07970", + "retrieved_at": "2026-10-29T21:40:58.127704+00:00", + "license": "GPL-3.0", + "lines": [ + [ + 1, + 101 + ] + ], + "rule_locations": {} + }, + { + "id": "VHS@8e4d79471bf1952154768e8435a9300077b534fa:__init__.py", + "commit": "8e4d79471bf1952154768e8435a9300077b534fa", + "raw_url": "https://raw.githubusercontent.com/Kosinkadink/ComfyUI-VideoHelperSuite/8e4d79471bf1952154768e8435a9300077b534fa/__init__.py", + "local_file": "__init__.py", + "sha256": "d3e74626bfdd628d0e96b190b2c07e25fa1e5ee9f1f402c7c650446f86b0838f", + "retrieved_at": "2026-10-29T21:40:58.582998+00:00", + "license": "GPL-3.0", + "lines": [ + [ + 1, + 9 + ] + ], + "rule_locations": {} + }, + { + "id": "VHS@8e4d79471bf1952154768e8435a9300077b534fa:LICENSE", + "commit": "8e4d79471bf1952154768e8435a9300077b534fa", + "raw_url": "https://raw.githubusercontent.com/Kosinkadink/ComfyUI-VideoHelperSuite/8e4d79471bf1952154768e8435a9300077b534fa/LICENSE", + "local_file": "LICENSE", + "sha256": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986", + "retrieved_at": "2026-10-29T21:40:58.981468+00:00", + "license": "GPL-3.0", + "lines": [ + [ + 1, + 674 + ] + ], + "rule_locations": {} + }, + { + "id": "VHS@8e4d79471bf1952154768e8435a9300077b534fa:pyproject.toml", + "commit": "8e4d79471bf1952154768e8435a9300077b534fa", + "raw_url": "https://raw.githubusercontent.com/Kosinkadink/ComfyUI-VideoHelperSuite/8e4d79471bf1952154768e8435a9300077b534fa/pyproject.toml", + "local_file": "pyproject.toml", + "sha256": "db8eb5916336b880055ae03daca158af481722c57150bf16859dc59c4113d9c9", + "retrieved_at": "2026-10-29T21:40:59.490613+00:00", + "license": "GPL-3.0", + "lines": [ + [ + 1, + 15 + ] + ], + "rule_locations": {} + }, + { + "id": "VHS@8e4d79471bf1952154768e8435a9300077b534fa:videohelpersuite/utils.py", + "commit": "8e4d79471bf1952154768e8435a9300077b534fa", + "raw_url": "https://raw.githubusercontent.com/Kosinkadink/ComfyUI-VideoHelperSuite/8e4d79471bf1952154768e8435a9300077b534fa/videohelpersuite/utils.py", + "local_file": "videohelpersuite__utils.py", + "sha256": "53560f3ce411f788491a6546cb044f3fa019e4deafe8128b5e6e5f6a45997504", + "retrieved_at": "2026-10-29T21:40:59.884674+00:00", + "license": "GPL-3.0", + "lines": [ + [ + 1, + 426 + ] + ], + "rule_locations": { + "DIMMAX =#21": [ + 21, + 21 + ], + "BIGMAX =#19": [ + 19, + 19 + ], + "MultiInput IMAGE/LATENT": [ + 43, + 56 + ] + } + }, + { + "id": "kj-aux-change.json", + "commit": "e56b3061ed49251a7b8a5450a2e18295548ea7a1", + "raw_url": "https://api.github.com/repos/kijai/ComfyUI-KJNodes/commits/e56b3061ed49251a7b8a5450a2e18295548ea7a1", + "local_file": "kj-aux-change.json", + "sha256": "a97cd1b70a1f9c2fe51f06ecefeaa541c4330fe355b0d3898b5effe6d9cb5c50", + "retrieved_at": "2026-10-29T21:41:22.428584+00:00", + "license": "GPL-3.0", + "lines": [ + [ + 1, + 1 + ] + ], + "rule_locations": {} + }, + { + "id": "kj-e56b3061ed49251a7b8a5450a2e18295548ea7a1__setgetnodes.js", + "commit": "e56b3061ed49251a7b8a5450a2e18295548ea7a1", + "raw_url": "https://raw.githubusercontent.com/kijai/ComfyUI-KJNodes/e56b3061ed49251a7b8a5450a2e18295548ea7a1/web/js/setgetnodes.js", + "local_file": "kj-e56b3061ed49251a7b8a5450a2e18295548ea7a1__setgetnodes.js", + "sha256": "6df8c1bfffcc82ae87aaf488f646b3dac3dcc61c9623b43258522dfb91094972", + "retrieved_at": "2026-10-29T21:41:22.858792+00:00", + "license": "GPL-3.0", + "lines": [ + [ + 1, + 1566 + ] + ], + "rule_locations": { + "this.properties[\"aux_id\"]#543": [ + 543, + 543 + ], + "this.properties[\"aux_id\"]#876": [ + 876, + 876 + ], + "onConfigure()#718": [ + 718, + 718 + ], + "onConfigure()#999": [ + 999, + 999 + ], + "getInputLink(slot)#1015": [ + 1015, + 1015 + ], + "LiteGraph.registerNodeType#854": [ + 854, + 854 + ], + "LiteGraph.registerNodeType#1122": [ + 1122, + 1122 + ] + } + }, + { + "id": "kj-e56b3061ed49251a7b8a5450a2e18295548ea7a1__LICENSE", + "commit": "e56b3061ed49251a7b8a5450a2e18295548ea7a1", + "raw_url": "https://raw.githubusercontent.com/kijai/ComfyUI-KJNodes/e56b3061ed49251a7b8a5450a2e18295548ea7a1/LICENSE", + "local_file": "kj-e56b3061ed49251a7b8a5450a2e18295548ea7a1__LICENSE", + "sha256": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986", + "retrieved_at": "2026-10-29T21:41:23.274573+00:00", + "license": "GPL-3.0", + "lines": [ + [ + 1, + 674 + ] + ], + "rule_locations": {} + }, + { + "id": "kj-276955e45fa48c794b47bf49dbc22f2d955d76a8__setgetnodes.js", + "commit": "276955e45fa48c794b47bf49dbc22f2d955d76a8", + "raw_url": "https://raw.githubusercontent.com/kijai/ComfyUI-KJNodes/276955e45fa48c794b47bf49dbc22f2d955d76a8/web/js/setgetnodes.js", + "local_file": "kj-276955e45fa48c794b47bf49dbc22f2d955d76a8__setgetnodes.js", + "sha256": "327f870c89aa22450e1851b7f575e8e629257a4721a4faf3e6c1e7545469cf60", + "retrieved_at": "2026-10-29T21:41:23.696363+00:00", + "license": "GPL-3.0", + "lines": [ + [ + 1, + 1566 + ] + ], + "rule_locations": { + "this.properties[\"aux_id\"]#543": [ + 543, + 543 + ], + "this.properties[\"aux_id\"]#876": [ + 876, + 876 + ], + "onConfigure()#718": [ + 718, + 718 + ], + "onConfigure()#999": [ + 999, + 999 + ], + "getInputLink(slot)#1015": [ + 1015, + 1015 + ], + "LiteGraph.registerNodeType#854": [ + 854, + 854 + ], + "LiteGraph.registerNodeType#1122": [ + 1122, + 1122 + ], + "function findSetterByName#161": [ + 161, + 161 + ] + } + }, + { + "id": "kj-276955e45fa48c794b47bf49dbc22f2d955d76a8__LICENSE", + "commit": "276955e45fa48c794b47bf49dbc22f2d955d76a8", + "raw_url": "https://raw.githubusercontent.com/kijai/ComfyUI-KJNodes/276955e45fa48c794b47bf49dbc22f2d955d76a8/LICENSE", + "local_file": "kj-276955e45fa48c794b47bf49dbc22f2d955d76a8__LICENSE", + "sha256": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986", + "retrieved_at": "2026-10-29T21:41:24.105008+00:00", + "license": "GPL-3.0", + "lines": [ + [ + 1, + 674 + ] + ], + "rule_locations": {} + }, + { + "id": "VHS@8e4d79471bf1952154768e8435a9300077b534fa:tree", + "commit": "8e4d79471bf1952154768e8435a9300077b534fa", + "raw_url": "https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/trees/8e4d79471bf1952154768e8435a9300077b534fa?recursive=1", + "local_file": "vhs-tree.json", + "sha256": "be3546eb24246d7f50238d6b1a8ba3dac9127adeb10315095dc7843d6c8647ca", + "retrieved_at": "2026-10-29T21:47:25.558679+00:00", + "license": "GPL-3.0", + "lines": [ + [ + 1, + 1 + ] + ] + } + ] +} diff --git a/docs/hel-892/scail-load-reference/vhs-tree.json b/docs/hel-892/scail-load-reference/vhs-tree.json new file mode 100644 index 00000000..98f916da --- /dev/null +++ b/docs/hel-892/scail-load-reference/vhs-tree.json @@ -0,0 +1 @@ +{"sha":"8e4d79471bf1952154768e8435a9300077b534fa","url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/trees/8e4d79471bf1952154768e8435a9300077b534fa","tree":[{"path":".github","mode":"040000","type":"tree","sha":"7a7002793ebbe7911dded77df496f4b141a46661","url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/trees/7a7002793ebbe7911dded77df496f4b141a46661"},{"path":".github/workflows","mode":"040000","type":"tree","sha":"a0920d307e4ff5f6199f39cf7cd22e853ed9c139","url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/trees/a0920d307e4ff5f6199f39cf7cd22e853ed9c139"},{"path":".github/workflows/publish.yml","mode":"100644","type":"blob","sha":"27bcdb11695ea19286da34cd5f36cf75155a4dbb","size":640,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/27bcdb11695ea19286da34cd5f36cf75155a4dbb"},{"path":".gitignore","mode":"100644","type":"blob","sha":"9b5379e8f93da3909706b0a7d37f5c8ab5e2a2a5","size":3101,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/9b5379e8f93da3909706b0a7d37f5c8ab5e2a2a5"},{"path":"LICENSE","mode":"100644","type":"blob","sha":"f288702d2fa16d3cdf0035b15a9fcbc552cd88e7","size":35149,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/f288702d2fa16d3cdf0035b15a9fcbc552cd88e7"},{"path":"README.md","mode":"100644","type":"blob","sha":"753fcecf9979b40b2427869c6ad5bed1b61df482","size":8877,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/753fcecf9979b40b2427869c6ad5bed1b61df482"},{"path":"__init__.py","mode":"100755","type":"blob","sha":"9fa995f0ac7e296a62bcba9df68b5250a0f7d041","size":398,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/9fa995f0ac7e296a62bcba9df68b5250a0f7d041"},{"path":"pyproject.toml","mode":"100644","type":"blob","sha":"a575fb9464aa1c3829ecf82c9b33a1824d512790","size":425,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/a575fb9464aa1c3829ecf82c9b33a1824d512790"},{"path":"requirements.txt","mode":"100644","type":"blob","sha":"4fa34aa21b85c4b974e2a2b6891eae5fd6dd4164","size":29,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/4fa34aa21b85c4b974e2a2b6891eae5fd6dd4164"},{"path":"testframework","mode":"040000","type":"tree","sha":"cb29518c671c9b91a4c2799b026d19260d5dfc33","url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/trees/cb29518c671c9b91a4c2799b026d19260d5dfc33"},{"path":"testframework/README.md","mode":"100644","type":"blob","sha":"93cd503563080c9c7d785d419bef7dddc4c11cd8","size":466,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/93cd503563080c9c7d785d419bef7dddc4c11cd8"},{"path":"testframework/__init__.py","mode":"100755","type":"blob","sha":"c75b11c164596ef873898dd843700c7164cc0932","size":184,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/c75b11c164596ef873898dd843700c7164cc0932"},{"path":"testframework/server.py","mode":"100644","type":"blob","sha":"a9c20ea3eab31bab288d6089a89410ff409d43ad","size":2836,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/a9c20ea3eab31bab288d6089a89410ff409d43ad"},{"path":"testframework/web","mode":"040000","type":"tree","sha":"5beb5445842a7c69a29942eadbd100ec0458556f","url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/trees/5beb5445842a7c69a29942eadbd100ec0458556f"},{"path":"testframework/web/js","mode":"040000","type":"tree","sha":"a351c437f1cccb93448fb0140d8e0fc17ffab368","url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/trees/a351c437f1cccb93448fb0140d8e0fc17ffab368"},{"path":"testframework/web/js/testRunner.js","mode":"100644","type":"blob","sha":"521a2204b9a2a3202441818461231872ea8a15c8","size":3132,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/521a2204b9a2a3202441818461231872ea8a15c8"},{"path":"tests","mode":"040000","type":"tree","sha":"6341d1c56315d281322b2d4dd4a9abd4ef3cb345","url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/trees/6341d1c56315d281322b2d4dd4a9abd4ef3cb345"},{"path":"tests/README.md","mode":"100644","type":"blob","sha":"ec025a7d169c7783f34523c63a0a6ae9a2e00fdb","size":140,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/ec025a7d169c7783f34523c63a0a6ae9a2e00fdb"},{"path":"tests/audio.json","mode":"100644","type":"blob","sha":"cae3d766731f7fe3ae4866f6fa8c0cc86a2ca46d","size":6092,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/cae3d766731f7fe3ae4866f6fa8c0cc86a2ca46d"},{"path":"tests/batch4x4.json","mode":"100644","type":"blob","sha":"34b9647329642a9e5ca233a60b8bbf2ca8f72aca","size":10236,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/34b9647329642a9e5ca233a60b8bbf2ca8f72aca"},{"path":"tests/converted-format-input.json","mode":"100644","type":"blob","sha":"e9722580df540b89a4b9185260a8de180ddd63aa","size":4514,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/e9722580df540b89a4b9185260a8de180ddd63aa"},{"path":"tests/converted-input.json","mode":"100644","type":"blob","sha":"41a93a049ea95ea9ddda92ed3a5152b55581938f","size":5917,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/41a93a049ea95ea9ddda92ed3a5152b55581938f"},{"path":"tests/loop.json","mode":"100644","type":"blob","sha":"aa5dd4ecdaac29d04b71dbf3bbc8349f2d1210af","size":3643,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/aa5dd4ecdaac29d04b71dbf3bbc8349f2d1210af"},{"path":"tests/old-prores.json","mode":"100644","type":"blob","sha":"17e77c1547663d39b5356ac15d74f807c69dc671","size":8694,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/17e77c1547663d39b5356ac15d74f807c69dc671"},{"path":"tests/old-vae-conversion.json","mode":"100644","type":"blob","sha":"e751918b6473cae2f38536d8433bc40b2283a3f6","size":4430,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/e751918b6473cae2f38536d8433bc40b2283a3f6"},{"path":"tests/simple.json","mode":"100644","type":"blob","sha":"4d7f8ddd68a24cc90519ecd127daae9d8ab81b85","size":2820,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/4d7f8ddd68a24cc90519ecd127daae9d8ab81b85"},{"path":"video_formats","mode":"040000","type":"tree","sha":"c57d50f7b1ccbfe75f8b8785e661c3d9abe163dc","url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/trees/c57d50f7b1ccbfe75f8b8785e661c3d9abe163dc"},{"path":"video_formats/16bit-png.json","mode":"100644","type":"blob","sha":"b768bdbcfe8950cb7bde37d02444f0191ad29f51","size":139,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/b768bdbcfe8950cb7bde37d02444f0191ad29f51"},{"path":"video_formats/8bit-png.json","mode":"100644","type":"blob","sha":"88b27a75f9c979f18979ec46da8c8843a82e0759","size":75,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/88b27a75f9c979f18979ec46da8c8843a82e0759"},{"path":"video_formats/ProRes.json","mode":"100644","type":"blob","sha":"eddd3acf931c5ab3486197c18ba88a3959d3e1d6","size":943,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/eddd3acf931c5ab3486197c18ba88a3959d3e1d6"},{"path":"video_formats/av1-webm.json","mode":"100644","type":"blob","sha":"659ea166fb140e18109f09f3d5710363af9c2294","size":625,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/659ea166fb140e18109f09f3d5710363af9c2294"},{"path":"video_formats/ffmpeg-gif.json","mode":"100644","type":"blob","sha":"3ca0865033c7dabc06176c737652f375e7badb27","size":366,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/3ca0865033c7dabc06176c737652f375e7badb27"},{"path":"video_formats/ffv1-mkv.json","mode":"100644","type":"blob","sha":"549e727febfd1c0d662a2fc67ad90106841ebdcb","size":1072,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/549e727febfd1c0d662a2fc67ad90106841ebdcb"},{"path":"video_formats/gifski.json","mode":"100644","type":"blob","sha":"c96b358ab0ae59dbd97c52a699c8ee9825c5d351","size":287,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/c96b358ab0ae59dbd97c52a699c8ee9825c5d351"},{"path":"video_formats/h264-mp4.json","mode":"100644","type":"blob","sha":"89d290c92cd44674e2fe6dca8d0a240d6bf9695b","size":585,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/89d290c92cd44674e2fe6dca8d0a240d6bf9695b"},{"path":"video_formats/h265-mp4.json","mode":"100644","type":"blob","sha":"b5d0150bf9cdb21f396f026a0d7721626c698822","size":611,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/b5d0150bf9cdb21f396f026a0d7721626c698822"},{"path":"video_formats/nvenc_av1-mp4.json","mode":"100644","type":"blob","sha":"0996c65b3f586897a2b131997ff1faaa6a4b828e","size":572,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/0996c65b3f586897a2b131997ff1faaa6a4b828e"},{"path":"video_formats/nvenc_h264-mp4.json","mode":"100644","type":"blob","sha":"1c39913ab6419fb2f7b1c0a6241b7fea1cc2cb11","size":573,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/1c39913ab6419fb2f7b1c0a6241b7fea1cc2cb11"},{"path":"video_formats/nvenc_hevc-mp4.json","mode":"100644","type":"blob","sha":"2ec6f4169d02466287026e4989b930ec3b64c200","size":598,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/2ec6f4169d02466287026e4989b930ec3b64c200"},{"path":"video_formats/webm.json","mode":"100644","type":"blob","sha":"6323f619ad2850ba60cd5e31b32cdfc060e030c9","size":589,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/6323f619ad2850ba60cd5e31b32cdfc060e030c9"},{"path":"videohelpersuite","mode":"040000","type":"tree","sha":"5549644688556396de4ecb1b433b001e49bbeca5","url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/trees/5549644688556396de4ecb1b433b001e49bbeca5"},{"path":"videohelpersuite/batched_nodes.py","mode":"100644","type":"blob","sha":"624bb84f73cce1d8e51abf4fef0b80367ad4b9a3","size":1790,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/624bb84f73cce1d8e51abf4fef0b80367ad4b9a3"},{"path":"videohelpersuite/documentation.py","mode":"100644","type":"blob","sha":"857de6c6a5b4a3917f49d0b1c5c142f274203f22","size":43805,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/857de6c6a5b4a3917f49d0b1c5c142f274203f22"},{"path":"videohelpersuite/image_latent_nodes.py","mode":"100644","type":"blob","sha":"62b4e3e6452b51b42e3e49852d27a1bb9921edc2","size":19039,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/62b4e3e6452b51b42e3e49852d27a1bb9921edc2"},{"path":"videohelpersuite/latent_preview.py","mode":"100644","type":"blob","sha":"d30a97bb2078f44ff28542192052b370d7c9e2a7","size":5282,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/d30a97bb2078f44ff28542192052b370d7c9e2a7"},{"path":"videohelpersuite/load_images_nodes.py","mode":"100644","type":"blob","sha":"43f3387c4f907d7372c207f7f1aeb626c27b836b","size":8120,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/43f3387c4f907d7372c207f7f1aeb626c27b836b"},{"path":"videohelpersuite/load_video_nodes.py","mode":"100644","type":"blob","sha":"2c4ee3fabb8726e225bea625a5163a90948ca1c0","size":29026,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/2c4ee3fabb8726e225bea625a5163a90948ca1c0"},{"path":"videohelpersuite/logger.py","mode":"100755","type":"blob","sha":"6e7b8d64bda275608ba6bf8ee28d2a2112e3e2be","size":1057,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/6e7b8d64bda275608ba6bf8ee28d2a2112e3e2be"},{"path":"videohelpersuite/nodes.py","mode":"100755","type":"blob","sha":"a7e67449644350999f830e513923d1c6195a2b75","size":47690,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/a7e67449644350999f830e513923d1c6195a2b75"},{"path":"videohelpersuite/server.py","mode":"100755","type":"blob","sha":"afb3140c8d0e54e3d98e00b35acbd52155214bbc","size":10342,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/afb3140c8d0e54e3d98e00b35acbd52155214bbc"},{"path":"videohelpersuite/utils.py","mode":"100644","type":"blob","sha":"75431d5a9e151ae50257d3fd14c03ffbc7570d39","size":16463,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/75431d5a9e151ae50257d3fd14c03ffbc7570d39"},{"path":"web","mode":"040000","type":"tree","sha":"a4550b9e7772c5253405c3d5e4e9905ad270fb2d","url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/trees/a4550b9e7772c5253405c3d5e4e9905ad270fb2d"},{"path":"web/js","mode":"040000","type":"tree","sha":"9a9860e835ba7aeb8f888357b51c78af052f6dff","url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/trees/9a9860e835ba7aeb8f888357b51c78af052f6dff"},{"path":"web/js/VHS.core.js","mode":"100755","type":"blob","sha":"e9026e46c42a49a3d76359ed6ff68327ef2cb04f","size":102671,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/e9026e46c42a49a3d76359ed6ff68327ef2cb04f"},{"path":"web/js/videoinfo.js","mode":"100644","type":"blob","sha":"b1a9871067e07dc09b37a8dd666ce531c2c5f56b","size":4313,"url":"https://api.github.com/repos/Kosinkadink/ComfyUI-VideoHelperSuite/git/blobs/b1a9871067e07dc09b37a8dd666ce531c2c5f56b"}],"truncated":false} \ No newline at end of file diff --git a/docs/hel-892/scail-load-reference/videohelpersuite__load_video_nodes.py b/docs/hel-892/scail-load-reference/videohelpersuite__load_video_nodes.py new file mode 100644 index 00000000..2c4ee3fa --- /dev/null +++ b/docs/hel-892/scail-load-reference/videohelpersuite__load_video_nodes.py @@ -0,0 +1,671 @@ +import os +import itertools +import numpy as np +import torch +from PIL import Image, ImageOps +import cv2 +import psutil +import subprocess +import re +import time + +import folder_paths +from comfy.utils import common_upscale, ProgressBar +import nodes +from comfy.k_diffusion.utils import FolderOfImages +from .logger import logger +from .utils import BIGMAX, DIMMAX, calculate_file_hash, get_sorted_dir_files_from_directory,\ + lazy_get_audio, hash_path, validate_path, strip_path, try_download_video, \ + is_url, imageOrLatent, ffmpeg_path, ENCODE_ARGS, floatOrInt + + +video_extensions = ['webm', 'mp4', 'mkv', 'gif', 'mov'] + +VHSLoadFormats = { + 'None': {}, + 'AnimateDiff': {'target_rate': 8, 'dim': (8,0,512,512)}, + 'Mochi': {'target_rate': 24, 'dim': (16,0,848,480), 'frames':(6,1)}, + 'LTXV': {'target_rate': 24, 'dim': (32,0,768,512), 'frames':(8,1)}, + 'Hunyuan': {'target_rate': 24, 'dim': (16,0,848,480), 'frames':(4,1)}, + 'Cosmos': {'target_rate': 24, 'dim': (16,0,1280,704), 'frames':(8,1)}, + 'Wan': {'target_rate': 16, 'dim': (8,0,832,480), 'frames':(4,1)}, +} +""" +External plugins may add additional formats to nodes.VHSLoadFormats +In addition to shorthand options, direct widget names will map a given dict to options. +Adding a third arguement to a frames tuple can enable strict checks on number +of loaded frames, i.e (8,1,True) +""" +if not hasattr(nodes, 'VHSLoadFormats'): + nodes.VHSLoadFormats = {} + +def get_load_formats(): + #TODO: check if {**extra_config.VHSLoafFormats, **VHSLoadFormats} has minimum version + formats = {} + formats.update(nodes.VHSLoadFormats) + formats.update(VHSLoadFormats) + return (list(formats.keys()), + {'default': 'AnimateDiff', 'formats': formats}) +def get_format(format): + if format in VHSLoadFormats: + return VHSLoadFormats[format] + return nodes.VHSLoadFormats.get(format, {}) + +def is_gif(filename) -> bool: + file_parts = filename.split('.') + return len(file_parts) > 1 and file_parts[-1] == "gif" + + +def target_size(width, height, custom_width, custom_height, downscale_ratio=8) -> tuple[int, int]: + if downscale_ratio is None: + downscale_ratio = 8 + if custom_width == 0 and custom_height == 0: + pass + elif custom_height == 0: + height *= custom_width/width + width = custom_width + elif custom_width == 0: + width *= custom_height/height + height = custom_height + else: + width = custom_width + height = custom_height + width = int(width/downscale_ratio + 0.5) * downscale_ratio + height = int(height/downscale_ratio + 0.5) * downscale_ratio + return (width, height) + +def cv_frame_generator(video, force_rate, frame_load_cap, skip_first_frames, + select_every_nth, meta_batch=None, unique_id=None): + video_cap = cv2.VideoCapture(video) + if not video_cap.isOpened() or not video_cap.grab(): + raise ValueError(f"{video} could not be loaded with cv.") + + # extract video metadata + fps = video_cap.get(cv2.CAP_PROP_FPS) + width = int(video_cap.get(cv2.CAP_PROP_FRAME_WIDTH)) + height = int(video_cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) + total_frames = int(video_cap.get(cv2.CAP_PROP_FRAME_COUNT)) + duration = total_frames / fps + + width = 0 + + if width <=0 or height <=0: + _, frame = video_cap.retrieve() + height, width, _ = frame.shape + + # set video_cap to look at start_index frame + total_frame_count = 0 + total_frames_evaluated = -1 + frames_added = 0 + base_frame_time = 1 / fps + prev_frame = None + + if force_rate == 0: + target_frame_time = base_frame_time + else: + target_frame_time = 1/force_rate + + if total_frames > 0: + if force_rate != 0: + yieldable_frames = int(total_frames / fps * force_rate) + else: + yieldable_frames = total_frames + if select_every_nth: + yieldable_frames //= select_every_nth + if frame_load_cap != 0: + yieldable_frames = min(frame_load_cap, yieldable_frames) + else: + yieldable_frames = 0 + yield (width, height, fps, duration, total_frames, target_frame_time, yieldable_frames) + pbar = ProgressBar(yieldable_frames) + time_offset=target_frame_time + while video_cap.isOpened(): + if time_offset < target_frame_time: + is_returned = video_cap.grab() + # if didn't return frame, video has ended + if not is_returned: + break + time_offset += base_frame_time + if time_offset < target_frame_time: + continue + time_offset -= target_frame_time + # if not at start_index, skip doing anything with frame + total_frame_count += 1 + if total_frame_count <= skip_first_frames: + continue + else: + total_frames_evaluated += 1 + + # if should not be selected, skip doing anything with frame + if total_frames_evaluated%select_every_nth != 0: + continue + + # opencv loads images in BGR format (yuck), so need to convert to RGB for ComfyUI use + # follow up: can videos ever have an alpha channel? + # To my testing: No. opencv has no support for alpha + unused, frame = video_cap.retrieve() + frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) + # convert frame to comfyui's expected format + # TODO: frame contains no exif information. Check if opencv2 has already applied + frame = np.array(frame, dtype=np.float32) + torch.from_numpy(frame).div_(255) + if prev_frame is not None: + inp = yield prev_frame + if inp is not None: + #ensure the finally block is called + return + prev_frame = frame + frames_added += 1 + if pbar is not None: + pbar.update_absolute(frames_added, yieldable_frames) + # if cap exists and we've reached it, stop processing frames + if frame_load_cap > 0 and frames_added >= frame_load_cap: + break + if meta_batch is not None: + meta_batch.inputs.pop(unique_id) + meta_batch.has_closed_inputs = True + if prev_frame is not None: + yield prev_frame + +def ffmpeg_frame_generator(video, force_rate, frame_load_cap, start_time, + custom_width, custom_height, downscale_ratio=8, + meta_batch=None, unique_id=None): + args_input = ["-i", video] + args_dummy = [ffmpeg_path] + args_input +['-c', 'copy', '-frames:v', '1', "-f", "null", "-"] + size_base = None + fps_base = None + try: + dummy_res = subprocess.run(args_dummy, stdout=subprocess.DEVNULL, + stderr=subprocess.PIPE, check=True) + except subprocess.CalledProcessError as e: + raise Exception("An error occurred in the ffmpeg subprocess:\n" \ + + e.stderr.decode(*ENCODE_ARGS)) + lines = dummy_res.stderr.decode(*ENCODE_ARGS) + if "Video: vp9 " in lines: + args_input = ["-c:v", "libvpx-vp9"] + args_input + args_dummy = [ffmpeg_path] + args_input +['-c', 'copy', '-frames:v', '1', "-f", "null", "-"] + try: + dummy_res = subprocess.run(args_dummy, stdout=subprocess.DEVNULL, + stderr=subprocess.PIPE, check=True) + except subprocess.CalledProcessError as e: + raise Exception("An error occurred in the ffmpeg subprocess:\n" \ + + e.stderr.decode(*ENCODE_ARGS)) + lines = dummy_res.stderr.decode(*ENCODE_ARGS) + + for line in lines.split('\n'): + match = re.search("^ *Stream .* Video.*, ([1-9]|\\d{2,})x(\\d+)", line) + if match is not None: + size_base = [int(match.group(1)), int(match.group(2))] + fps_match = re.search(", ([\\d\\.]+) fps", line) + if fps_match: + fps_base = float(fps_match.group(1)) + else: + fps_base = 1 + alpha = re.search("(yuva|rgba|bgra)", line) is not None + break + else: + raise Exception("Failed to parse video/image information. FFMPEG output:\n" + lines) + + durs_match = re.search("Duration: (\\d+:\\d+:\\d+\\.\\d+),", lines) + if durs_match: + durs = durs_match.group(1).split(':') + duration = int(durs[0])*360 + int(durs[1])*60 + float(durs[2]) + else: + duration = 0 + + if start_time > 0: + if start_time > 4: + post_seek = ['-ss', '4'] + args_input = ['-ss', str(start_time - 4)] + args_input + else: + post_seek = ['-ss', str(start_time)] + else: + post_seek = [] + args_all_frames = [ffmpeg_path, "-v", "error", "-an"] + \ + args_input + ["-pix_fmt", "rgba64le"] + post_seek + + vfilters = [] + if force_rate != 0: + vfilters.append("fps=fps="+str(force_rate)) + if custom_width != 0 or custom_height != 0: + size = target_size(size_base[0], size_base[1], custom_width, + custom_height, downscale_ratio=downscale_ratio) + ar = float(size[0])/float(size[1]) + if abs(size_base[0]*ar-size_base[1]) >= 1: + #Aspect ratio is changed. Crop to new aspect ratio before scale + vfilters.append(f"crop=if(gt({ar}\\,a)\\,iw\\,ih*{ar}):if(gt({ar}\\,a)\\,iw/{ar}\\,ih)") + size_arg = ':'.join(map(str,size)) + vfilters.append(f"scale={size_arg}") + else: + size = size_base + if len(vfilters) > 0: + args_all_frames += ["-vf", ",".join(vfilters)] + yieldable_frames = (force_rate or fps_base)*duration + if frame_load_cap > 0: + args_all_frames += ["-frames:v", str(frame_load_cap)] + yieldable_frames = min(yieldable_frames, frame_load_cap) + yield (size_base[0], size_base[1], fps_base, duration, fps_base * duration, + 1/(force_rate or fps_base), yieldable_frames, size[0], size[1], alpha) + + args_all_frames += ["-f", "rawvideo", "-"] + pbar = ProgressBar(yieldable_frames) + try: + with subprocess.Popen(args_all_frames, stdout=subprocess.PIPE) as proc: + #Manually buffer enough bytes for an image + bpi = size[0] * size[1] * 8 + current_bytes = bytearray(bpi) + current_offset=0 + prev_frame = None + while True: + bytes_read = proc.stdout.read(bpi - current_offset) + if bytes_read is None:#sleep to wait for more data + time.sleep(.1) + continue + if len(bytes_read) == 0:#EOF + break + current_bytes[current_offset:len(bytes_read)] = bytes_read + current_offset+=len(bytes_read) + if current_offset == bpi: + if prev_frame is not None: + yield prev_frame + pbar.update(1) + prev_frame = np.frombuffer(current_bytes, dtype=np.dtype(np.uint16).newbyteorder("<")).reshape(size[1], size[0], 4) / (2**16-1) + if not alpha: + prev_frame = prev_frame[:, :, :-1] + current_offset = 0 + except BrokenPipeError as e: + raise Exception("An error occured in the ffmpeg subprocess:\n" \ + + proc.stderr.read().decode(*ENCODE_ARGS)) + if meta_batch is not None: + meta_batch.inputs.pop(unique_id) + meta_batch.has_closed_inputs = True + if prev_frame is not None: + yield prev_frame + +#Python 3.12 adds an itertools.batched, but it's easily replicated for legacy support +def batched(it, n): + while batch := tuple(itertools.islice(it, n)): + yield batch +def batched_vae_encode(images, vae, frames_per_batch): + for batch in batched(images, frames_per_batch): + image_batch = torch.from_numpy(np.array(batch)) + yield from vae.encode(image_batch).numpy() +def resized_cv_frame_gen(custom_width, custom_height, downscale_ratio, **kwargs): + gen = cv_frame_generator(**kwargs) + info = next(gen) + width, height = info[0], info[1] + frames_per_batch = (1920 * 1080 * 16) // (width * height) or 1 + if kwargs.get('meta_batch', None) is not None: + frames_per_batch = min(frames_per_batch, kwargs['meta_batch'].frames_per_batch) + if custom_width != 0 or custom_height != 0 or downscale_ratio is not None: + new_size = target_size(width, height, custom_width, custom_height, downscale_ratio) + yield (*info, new_size[0], new_size[1], False) + if new_size[0] != width or new_size[1] != height: + def rescale(frame): + s = torch.from_numpy(np.fromiter(frame, np.dtype((np.float32, (height, width, 3))))) + s = s.movedim(-1,1) + s = common_upscale(s, new_size[0], new_size[1], "lanczos", "center") + return s.movedim(1,-1).numpy() + yield from itertools.chain.from_iterable(map(rescale, batched(gen, frames_per_batch))) + return + else: + yield (*info, info[0], info[1], False) + yield from gen + +def load_video(meta_batch=None, unique_id=None, memory_limit_mb=None, vae=None, + generator=resized_cv_frame_gen, format='None', **kwargs): + if 'force_size' in kwargs: + kwargs.pop('force_size') + logger.warn("force_size has been removed. Did you reload the webpage after updating?") + format = get_format(format) + kwargs['video'] = strip_path(kwargs['video']) + if vae is not None: + downscale_ratio = getattr(vae, "downscale_ratio", 8) + else: + downscale_ratio = format.get('dim', (1,))[0] + if meta_batch is None or unique_id not in meta_batch.inputs: + gen = generator(meta_batch=meta_batch, unique_id=unique_id, downscale_ratio=downscale_ratio, **kwargs) + (width, height, fps, duration, total_frames, target_frame_time, yieldable_frames, new_width, new_height, alpha) = next(gen) + + if meta_batch is not None: + meta_batch.inputs[unique_id] = (gen, width, height, fps, duration, total_frames, target_frame_time, yieldable_frames, new_width, new_height, alpha) + if yieldable_frames: + meta_batch.total_frames = min(meta_batch.total_frames, yieldable_frames) + + else: + (gen, width, height, fps, duration, total_frames, target_frame_time, yieldable_frames, new_width, new_height, alpha) = meta_batch.inputs[unique_id] + + memory_limit = None + if memory_limit_mb is not None: + memory_limit *= 2 ** 20 + else: + #TODO: verify if garbage collection should be performed here. + #leaves ~128 MB unreserved for safety + try: + memory_limit = (psutil.virtual_memory().available + psutil.swap_memory().free) - 2 ** 27 + except: + logger.warn("Failed to calculate available memory. Memory load limit has been disabled") + memory_limit = BIGMAX + if vae is not None: + #space required to load as f32, exist as latent with wiggle room, decode to f32 + max_loadable_frames = int(memory_limit//(width*height*3*(4+4+1/10))) + else: + #TODO: use better estimate for when vae is not None + #Consider completely ignoring for load_latent case? + max_loadable_frames = int(memory_limit//(width*height*3*(.1))) + if meta_batch is not None: + if 'frames' in format: + if meta_batch.frames_per_batch % format['frames'][0] != format['frames'][1]: + error = (meta_batch.frames_per_batch - format['frames'][1]) % format['frames'][0] + suggested = meta_batch.frames_per_batch - error + if error > format['frames'][0] / 2: + suggested += format['frames'][0] + raise RuntimeError(f"The chosen frames per batch is incompatible with the selected format. Try {suggested}") + if meta_batch.frames_per_batch > max_loadable_frames: + raise RuntimeError(f"Meta Batch set to {meta_batch.frames_per_batch} frames but only {max_loadable_frames} can fit in memory") + gen = itertools.islice(gen, meta_batch.frames_per_batch) + else: + original_gen = gen + gen = itertools.islice(gen, max_loadable_frames) + frames_per_batch = (1920 * 1080 * 16) // (width * height) or 1 + if vae is not None: + gen = batched_vae_encode(gen, vae, frames_per_batch) + vw,vh = new_width//downscale_ratio, new_height//downscale_ratio + channels = getattr(vae, 'latent_channels', 4) + images = torch.from_numpy(np.fromiter(gen, np.dtype((np.float32, (channels,vh,vw))))) + else: + #Some minor wizardry to eliminate a copy and reduce max memory by a factor of ~2 + images = torch.from_numpy(np.fromiter(gen, np.dtype((np.float32, (new_height, new_width, 4 if alpha else 3))))) + if meta_batch is None and memory_limit is not None: + try: + next(original_gen) + raise RuntimeError(f"Memory limit hit after loading {len(images)} frames. Stopping execution.") + except StopIteration: + pass + if len(images) == 0: + raise RuntimeError("No frames generated") + if 'frames' in format and len(images) % format['frames'][0] != format['frames'][1]: + err_msg = f"The number of frames loaded {len(images)}, does not match the requirements of the currently selected format." + if len(format['frames']) > 2 and format['frames'][2]: + raise RuntimeError(err_msg) + div, mod = format['frames'][:2] + frames = (len(images) - mod) // div * div + mod + images = images[:frames] + #Commenting out log message since it's displayed in UI. consider further + #logger.warn(err_msg + f" Output has been truncated to {len(images)} frames.") + if 'start_time' in kwargs: + start_time = kwargs['start_time'] + else: + start_time = kwargs['skip_first_frames'] * target_frame_time + target_frame_time *= kwargs.get('select_every_nth', 1) + #Setup lambda for lazy audio capture + audio = lazy_get_audio(kwargs['video'], start_time, kwargs['frame_load_cap']*target_frame_time) + #Adjust target_frame_time for select_every_nth + video_info = { + "source_fps": fps, + "source_frame_count": total_frames, + "source_duration": duration, + "source_width": width, + "source_height": height, + "loaded_fps": 1/target_frame_time, + "loaded_frame_count": len(images), + "loaded_duration": len(images) * target_frame_time, + "loaded_width": new_width, + "loaded_height": new_height, + } + if vae is None: + return (images, len(images), audio, video_info) + else: + return ({"samples": images}, len(images), audio, video_info) + + + +class LoadVideoUpload: + @classmethod + def INPUT_TYPES(s): + input_dir = folder_paths.get_input_directory() + files = [] + for f in os.listdir(input_dir): + if os.path.isfile(os.path.join(input_dir, f)): + file_parts = f.split('.') + if len(file_parts) > 1 and (file_parts[-1].lower() in video_extensions): + files.append(f) + return {"required": { + "video": (sorted(files),), + "force_rate": (floatOrInt, {"default": 0, "min": 0, "max": 60, "step": 1, "disable": 0}), + "custom_width": ("INT", {"default": 0, "min": 0, "max": DIMMAX, 'disable': 0}), + "custom_height": ("INT", {"default": 0, "min": 0, "max": DIMMAX, 'disable': 0}), + "frame_load_cap": ("INT", {"default": 0, "min": 0, "max": BIGMAX, "step": 1, "disable": 0}), + "skip_first_frames": ("INT", {"default": 0, "min": 0, "max": BIGMAX, "step": 1}), + "select_every_nth": ("INT", {"default": 1, "min": 1, "max": BIGMAX, "step": 1}), + }, + "optional": { + "meta_batch": ("VHS_BatchManager",), + "vae": ("VAE",), + "format": get_load_formats(), + }, + "hidden": { + "force_size": "STRING", + "unique_id": "UNIQUE_ID" + }, + } + + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢" + + RETURN_TYPES = (imageOrLatent, "INT", "AUDIO", "VHS_VIDEOINFO") + RETURN_NAMES = ("IMAGE", "frame_count", "audio", "video_info") + + FUNCTION = "load_video" + + def load_video(self, **kwargs): + kwargs['video'] = folder_paths.get_annotated_filepath(strip_path(kwargs['video'])) + return load_video(**kwargs) + + @classmethod + def IS_CHANGED(s, video, **kwargs): + image_path = folder_paths.get_annotated_filepath(video) + return calculate_file_hash(image_path) + + @classmethod + def VALIDATE_INPUTS(s, video): + if not folder_paths.exists_annotated_filepath(video): + return "Invalid video file: {}".format(video) + return True + + +class LoadVideoPath: + @classmethod + def INPUT_TYPES(s): + return { + "required": { + "video": ("STRING", {"placeholder": "X://insert/path/here.mp4", "vhs_path_extensions": video_extensions}), + "force_rate": (floatOrInt, {"default": 0, "min": 0, "max": 60, "step": 1, "disable": 0}), + "custom_width": ("INT", {"default": 0, "min": 0, "max": DIMMAX, 'disable': 0}), + "custom_height": ("INT", {"default": 0, "min": 0, "max": DIMMAX, 'disable': 0}), + "frame_load_cap": ("INT", {"default": 0, "min": 0, "max": BIGMAX, "step": 1, "disable": 0}), + "skip_first_frames": ("INT", {"default": 0, "min": 0, "max": BIGMAX, "step": 1}), + "select_every_nth": ("INT", {"default": 1, "min": 1, "max": BIGMAX, "step": 1}), + }, + "optional": { + "meta_batch": ("VHS_BatchManager",), + "vae": ("VAE",), + "format": get_load_formats(), + }, + "hidden": { + "force_size": "STRING", + "unique_id": "UNIQUE_ID" + }, + } + + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢" + + RETURN_TYPES = (imageOrLatent, "INT", "AUDIO", "VHS_VIDEOINFO") + RETURN_NAMES = ("IMAGE", "frame_count", "audio", "video_info") + + FUNCTION = "load_video" + + def load_video(self, **kwargs): + if kwargs['video'] is None or validate_path(kwargs['video']) != True: + raise Exception("video is not a valid path: " + kwargs['video']) + if is_url(kwargs['video']): + kwargs['video'] = try_download_video(kwargs['video']) or kwargs['video'] + return load_video(**kwargs) + + @classmethod + def IS_CHANGED(s, video, **kwargs): + return hash_path(video) + + @classmethod + def VALIDATE_INPUTS(s, video): + return validate_path(video, allow_none=True) + +class LoadVideoFFmpegUpload: + @classmethod + def INPUT_TYPES(s): + input_dir = folder_paths.get_input_directory() + files = [] + for f in os.listdir(input_dir): + if os.path.isfile(os.path.join(input_dir, f)): + file_parts = f.split('.') + if len(file_parts) > 1 and (file_parts[-1].lower() in video_extensions): + files.append(f) + return {"required": { + "video": (sorted(files),), + "force_rate": (floatOrInt, {"default": 0, "min": 0, "max": 60, "step": 1, "disable": 0}), + "custom_width": ("INT", {"default": 0, "min": 0, "max": DIMMAX, 'disable': 0}), + "custom_height": ("INT", {"default": 0, "min": 0, "max": DIMMAX, 'disable': 0}), + "frame_load_cap": ("INT", {"default": 0, "min": 0, "max": BIGMAX, "step": 1, "disable": 0}), + "start_time": ("FLOAT", {"default": 0, "min": 0, "max": BIGMAX, "step": .001, "widgetType": "VHSTIMESTAMP"}), + }, + "optional": { + "meta_batch": ("VHS_BatchManager",), + "vae": ("VAE",), + "format": get_load_formats(), + }, + "hidden": { + "force_size": "STRING", + "unique_id": "UNIQUE_ID" + + }, + } + + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢" + + RETURN_TYPES = (imageOrLatent, "MASK", "AUDIO", "VHS_VIDEOINFO") + RETURN_NAMES = ("IMAGE", "mask", "audio", "video_info") + + FUNCTION = "load_video" + + def load_video(self, **kwargs): + kwargs['video'] = folder_paths.get_annotated_filepath(strip_path(kwargs['video'])) + image, _, audio, video_info = load_video(**kwargs, generator=ffmpeg_frame_generator) + if image.size(3) == 4: + return (image[:,:,:,:3], 1-image[:,:,:,3], audio, video_info) + return (image, torch.zeros(image.size(0), 64, 64, device="cpu"), audio, video_info) + + @classmethod + def IS_CHANGED(s, video, **kwargs): + image_path = folder_paths.get_annotated_filepath(video) + return calculate_file_hash(image_path) + + @classmethod + def VALIDATE_INPUTS(s, video): + if not folder_paths.exists_annotated_filepath(video): + return "Invalid video file: {}".format(video) + return True + + +class LoadVideoFFmpegPath: + @classmethod + def INPUT_TYPES(s): + return { + "required": { + "video": ("STRING", {"placeholder": "X://insert/path/here.mp4", "vhs_path_extensions": video_extensions}), + "force_rate": (floatOrInt, {"default": 0, "min": 0, "max": 60, "step": 1, "disable": 0}), + "custom_width": ("INT", {"default": 0, "min": 0, "max": DIMMAX, 'disable': 0}), + "custom_height": ("INT", {"default": 0, "min": 0, "max": DIMMAX, 'disable': 0}), + "frame_load_cap": ("INT", {"default": 0, "min": 0, "max": BIGMAX, "step": 1, "disable": 0}), + "start_time": ("FLOAT", {"default": 0, "min": 0, "max": BIGMAX, "step": .001, "widgetType": "VHSTIMESTAMP"}), + }, + "optional": { + "meta_batch": ("VHS_BatchManager",), + "vae": ("VAE",), + "format": get_load_formats(), + }, + "hidden": { + "force_size": "STRING", + "unique_id": "UNIQUE_ID" + }, + } + + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢" + + RETURN_TYPES = (imageOrLatent, "MASK", "AUDIO", "VHS_VIDEOINFO") + RETURN_NAMES = ("IMAGE", "mask", "audio", "video_info") + + FUNCTION = "load_video" + + def load_video(self, **kwargs): + if kwargs['video'] is None or validate_path(kwargs['video']) != True: + raise Exception("video is not a valid path: " + kwargs['video']) + if is_url(kwargs['video']): + kwargs['video'] = try_download_video(kwargs['video']) or kwargs['video'] + image, _, audio, video_info = load_video(**kwargs, generator=ffmpeg_frame_generator) + if isinstance(image, dict): + return (image, None, audio, video_info) + if image.size(3) == 4: + return (image[:,:,:,:3], 1-image[:,:,:,3], audio, video_info) + return (image, torch.zeros(image.size(0), 64, 64, device="cpu"), audio, video_info) + + @classmethod + def IS_CHANGED(s, video, **kwargs): + return hash_path(video) + + @classmethod + def VALIDATE_INPUTS(s, video): + return validate_path(video, allow_none=True) + +class LoadImagePath: + @classmethod + def INPUT_TYPES(s): + return { + "required": { + "image": ("STRING", {"placeholder": "X://insert/path/here.png", "vhs_path_extensions": list(FolderOfImages.IMG_EXTENSIONS)}), + "custom_width": ("INT", {"default": 0, "min": 0, "max": DIMMAX, "step": 8, 'disable': 0}), + "custom_height": ("INT", {"default": 0, "min": 0, "max": DIMMAX, "step": 8, 'disable': 0}), + }, + "optional": { + "vae": ("VAE",), + }, + "hidden": { + "force_size": "STRING", + }, + } + + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢" + + RETURN_TYPES = (imageOrLatent, "MASK") + RETURN_NAMES = ("IMAGE", "mask") + + FUNCTION = "load_image" + + def load_image(self, **kwargs): + if kwargs['image'] is None or validate_path(kwargs['image']) != True: + raise Exception("image is not a valid path: " + kwargs['image']) + kwargs.update({'video': kwargs['image'], 'force_rate': 0, 'frame_load_cap': 0, + 'start_time': 0}) + kwargs.pop('image') + image, _, _, _ = load_video(**kwargs, generator=ffmpeg_frame_generator) + if isinstance(image, dict): + return (image, None) + if image.size(3) == 4: + return (image[:,:,:,:3], 1-image[:,:,:,3]) + return (image, torch.zeros(image.size(0), 64, 64, device="cpu")) + + @classmethod + def IS_CHANGED(s, image, **kwargs): + return hash_path(image) + + @classmethod + def VALIDATE_INPUTS(s, image): + return validate_path(image, allow_none=True) diff --git a/docs/hel-892/scail-load-reference/videohelpersuite__nodes.py b/docs/hel-892/scail-load-reference/videohelpersuite__nodes.py new file mode 100644 index 00000000..a7e67449 --- /dev/null +++ b/docs/hel-892/scail-load-reference/videohelpersuite__nodes.py @@ -0,0 +1,1110 @@ +import os +import sys +import json +import subprocess +import numpy as np +import re +import datetime +from typing import List +import torch +from PIL import Image, ExifTags +from PIL.PngImagePlugin import PngInfo +from pathlib import Path +from string import Template +import itertools +import functools + +import folder_paths +from .logger import logger +from .image_latent_nodes import * +from .load_video_nodes import LoadVideoUpload, LoadVideoPath, LoadVideoFFmpegUpload, LoadVideoFFmpegPath, LoadImagePath +from .load_images_nodes import LoadImagesFromDirectoryUpload, LoadImagesFromDirectoryPath +from .batched_nodes import VAEEncodeBatched, VAEDecodeBatched +from .utils import ffmpeg_path, get_audio, hash_path, validate_path, requeue_workflow, \ + gifski_path, calculate_file_hash, strip_path, try_download_video, is_url, \ + imageOrLatent, BIGMAX, merge_filter_args, ENCODE_ARGS, floatOrInt, cached, \ + ContainsAll +from comfy.utils import ProgressBar + +if 'VHS_video_formats' not in folder_paths.folder_names_and_paths: + folder_paths.folder_names_and_paths["VHS_video_formats"] = ((),{".json"}) +if len(folder_paths.folder_names_and_paths['VHS_video_formats'][1]) == 0: + folder_paths.folder_names_and_paths["VHS_video_formats"][1].add(".json") +audio_extensions = ['mp3', 'mp4', 'wav', 'ogg'] + +def flatten_list(l): + ret = [] + for e in l: + if isinstance(e, list): + ret.extend(e) + else: + ret.append(e) + return ret + +def iterate_format(video_format, for_widgets=True): + """Provides an iterator over widgets, or arguments""" + def indirector(cont, index): + if isinstance(cont[index], list) and (not for_widgets + or len(cont[index])> 1 and not isinstance(cont[index][1], dict)): + inp = yield cont[index] + if inp is not None: + cont[index] = inp + yield + for k in video_format: + if k == "extra_widgets": + if for_widgets: + yield from video_format["extra_widgets"] + elif k.endswith("_pass"): + for i in range(len(video_format[k])): + yield from indirector(video_format[k], i) + if not for_widgets: + video_format[k] = flatten_list(video_format[k]) + else: + yield from indirector(video_format, k) + +base_formats_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "video_formats") +@cached(5) +def get_video_formats(): + format_files = {} + for format_name in folder_paths.get_filename_list("VHS_video_formats"): + format_files[format_name] = folder_paths.get_full_path("VHS_video_formats", format_name) + for item in os.scandir(base_formats_dir): + if not item.is_file() or not item.name.endswith('.json'): + continue + format_files[item.name[:-5]] = item.path + formats = [] + format_widgets = {} + for format_name, path in format_files.items(): + with open(path, 'r') as stream: + video_format = json.load(stream) + if "gifski_pass" in video_format and gifski_path is None: + #Skip format + continue + widgets = list(iterate_format(video_format)) + formats.append("video/" + format_name) + if (len(widgets) > 0): + format_widgets["video/"+ format_name] = widgets + return formats, format_widgets + +def apply_format_widgets(format_name, kwargs): + if os.path.exists(os.path.join(base_formats_dir, format_name + ".json")): + video_format_path = os.path.join(base_formats_dir, format_name + ".json") + else: + video_format_path = folder_paths.get_full_path("VHS_video_formats", format_name) + with open(video_format_path, 'r') as stream: + video_format = json.load(stream) + for w in iterate_format(video_format): + if w[0] not in kwargs: + if len(w) > 2 and 'default' in w[2]: + default = w[2]['default'] + else: + if type(w[1]) is list: + default = w[1][0] + else: + #NOTE: This doesn't respect max/min, but should be good enough as a fallback to a fallback to a fallback + default = {"BOOLEAN": False, "INT": 0, "FLOAT": 0, "STRING": ""}[w[1]] + kwargs[w[0]] = default + logger.warn(f"Missing input for {w[0][0]} has been set to {default}") + wit = iterate_format(video_format, False) + for w in wit: + while isinstance(w, list): + if len(w) == 1: + #TODO: mapping=kwargs should be safer, but results in key errors, investigate why + w = [Template(x).substitute(**kwargs) for x in w[0]] + break + elif isinstance(w[1], dict): + w = w[1][str(kwargs[w[0]])] + elif len(w) > 3: + w = Template(w[3]).substitute(val=kwargs[w[0]]) + else: + w = str(kwargs[w[0]]) + wit.send(w) + return video_format + +def tensor_to_int(tensor, bits): + tensor = tensor.cpu().numpy() * (2**bits-1) + 0.5 + return np.clip(tensor, 0, (2**bits-1)) +def tensor_to_shorts(tensor): + return tensor_to_int(tensor, 16).astype(np.uint16) +def tensor_to_bytes(tensor): + return tensor_to_int(tensor, 8).astype(np.uint8) + +def ffmpeg_process(args, video_format, video_metadata, file_path, env): + + res = None + frame_data = yield + total_frames_output = 0 + if video_format.get('save_metadata', 'False') != 'False': + os.makedirs(folder_paths.get_temp_directory(), exist_ok=True) + metadata = json.dumps(video_metadata) + metadata_path = os.path.join(folder_paths.get_temp_directory(), "metadata.txt") + #metadata from file should escape = ; # \ and newline + metadata = metadata.replace("\\","\\\\") + metadata = metadata.replace(";","\\;") + metadata = metadata.replace("#","\\#") + metadata = metadata.replace("=","\\=") + metadata = metadata.replace("\n","\\\n") + metadata = "comment=" + metadata + with open(metadata_path, "w") as f: + f.write(";FFMETADATA1\n") + f.write(metadata) + m_args = args[:1] + ["-i", metadata_path] + args[1:] + ["-metadata", "creation_time=now"] + with subprocess.Popen(m_args + [file_path], stderr=subprocess.PIPE, + stdin=subprocess.PIPE, env=env) as proc: + try: + while frame_data is not None: + proc.stdin.write(frame_data) + #TODO: skip flush for increased speed + frame_data = yield + total_frames_output+=1 + proc.stdin.flush() + proc.stdin.close() + res = proc.stderr.read() + except BrokenPipeError as e: + err = proc.stderr.read() + #Check if output file exists. If it does, the re-execution + #will also fail. This obscures the cause of the error + #and seems to never occur concurrent to the metadata issue + if os.path.exists(file_path): + raise Exception("An error occurred in the ffmpeg subprocess:\n" \ + + err.decode(*ENCODE_ARGS)) + #Res was not set + print(err.decode(*ENCODE_ARGS), end="", file=sys.stderr) + logger.warn("An error occurred when saving with metadata") + if res != b'': + with subprocess.Popen(args + [file_path], stderr=subprocess.PIPE, + stdin=subprocess.PIPE, env=env) as proc: + try: + while frame_data is not None: + proc.stdin.write(frame_data) + frame_data = yield + total_frames_output+=1 + proc.stdin.flush() + proc.stdin.close() + res = proc.stderr.read() + except BrokenPipeError as e: + res = proc.stderr.read() + raise Exception("An error occurred in the ffmpeg subprocess:\n" \ + + res.decode(*ENCODE_ARGS)) + yield total_frames_output + if len(res) > 0: + print(res.decode(*ENCODE_ARGS), end="", file=sys.stderr) + +def gifski_process(args, dimensions, video_format, file_path, env): + frame_data = yield + with subprocess.Popen(args + video_format['main_pass'] + ['-f', 'yuv4mpegpipe', '-'], + stderr=subprocess.PIPE, stdin=subprocess.PIPE, + stdout=subprocess.PIPE, env=env) as procff: + with subprocess.Popen([gifski_path] + video_format['gifski_pass'] + + ['-W', f'{dimensions[0]}', '-H', f'{dimensions[1]}'] + + ['-q', '-o', file_path, '-'], stderr=subprocess.PIPE, + stdin=procff.stdout, stdout=subprocess.PIPE, + env=env) as procgs: + try: + while frame_data is not None: + procff.stdin.write(frame_data) + frame_data = yield + procff.stdin.flush() + procff.stdin.close() + resff = procff.stderr.read() + resgs = procgs.stderr.read() + outgs = procgs.stdout.read() + except BrokenPipeError as e: + procff.stdin.close() + resff = procff.stderr.read() + resgs = procgs.stderr.read() + raise Exception("An error occurred while creating gifski output\n" \ + + "Make sure you are using gifski --version >=1.32.0\nffmpeg: " \ + + resff.decode(*ENCODE_ARGS) + '\ngifski: ' + resgs.decode(*ENCODE_ARGS)) + if len(resff) > 0: + print(resff.decode(*ENCODE_ARGS), end="", file=sys.stderr) + if len(resgs) > 0: + print(resgs.decode(*ENCODE_ARGS), end="", file=sys.stderr) + #should always be empty as the quiet flag is passed + if len(outgs) > 0: + print(outgs.decode(*ENCODE_ARGS)) + +def to_pingpong(inp): + if not hasattr(inp, "__getitem__"): + inp = list(inp) + yield from inp + for i in range(len(inp)-2,0,-1): + yield inp[i] + +class VideoCombine: + @classmethod + def INPUT_TYPES(s): + ffmpeg_formats, format_widgets = get_video_formats() + format_widgets["image/webp"] = [['lossless', "BOOLEAN", {'default': True}]] + return { + "required": { + "images": (imageOrLatent,), + "frame_rate": ( + floatOrInt, + {"default": 8, "min": 1, "step": 1}, + ), + "loop_count": ("INT", {"default": 0, "min": 0, "max": 100, "step": 1}), + "filename_prefix": ("STRING", {"default": "AnimateDiff"}), + "format": (["image/gif", "image/webp"] + ffmpeg_formats, {'formats': format_widgets}), + "pingpong": ("BOOLEAN", {"default": False}), + "save_output": ("BOOLEAN", {"default": True}), + }, + "optional": { + "audio": ("AUDIO",), + "meta_batch": ("VHS_BatchManager",), + "vae": ("VAE",), + }, + "hidden": ContainsAll({ + "prompt": "PROMPT", + "extra_pnginfo": "EXTRA_PNGINFO", + "unique_id": "UNIQUE_ID" + }), + } + + RETURN_TYPES = ("VHS_FILENAMES",) + RETURN_NAMES = ("Filenames",) + OUTPUT_NODE = True + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢" + FUNCTION = "combine_video" + + def combine_video( + self, + frame_rate: int, + loop_count: int, + images=None, + latents=None, + filename_prefix="AnimateDiff", + format="image/gif", + pingpong=False, + save_output=True, + prompt=None, + extra_pnginfo=None, + audio=None, + unique_id=None, + manual_format_widgets=None, + meta_batch=None, + vae=None, + **kwargs + ): + if latents is not None: + images = latents + if images is None: + return ((save_output, []),) + if vae is not None: + if isinstance(images, dict): + images = images['samples'] + else: + vae = None + + if isinstance(images, torch.Tensor) and images.size(0) == 0: + return ((save_output, []),) + num_frames = len(images) + pbar = ProgressBar(num_frames) + if vae is not None: + downscale_ratio = getattr(vae, "downscale_ratio", 8) + width = images.size(-1)*downscale_ratio + height = images.size(-2)*downscale_ratio + frames_per_batch = (1920 * 1080 * 16) // (width * height) or 1 + #Python 3.12 adds an itertools.batched, but it's easily replicated for legacy support + def batched(it, n): + while batch := tuple(itertools.islice(it, n)): + yield batch + def batched_encode(images, vae, frames_per_batch): + for batch in batched(iter(images), frames_per_batch): + image_batch = torch.from_numpy(np.array(batch)) + yield from vae.decode(image_batch) + images = batched_encode(images, vae, frames_per_batch) + first_image = next(images) + #repush first_image + images = itertools.chain([first_image], images) + #A single image has 3 dimensions. Discard higher dimensions + while len(first_image.shape) > 3: + first_image = first_image[0] + else: + first_image = images[0] + images = iter(images) + # get output information + output_dir = ( + folder_paths.get_output_directory() + if save_output + else folder_paths.get_temp_directory() + ) + ( + full_output_folder, + filename, + _, + subfolder, + _, + ) = folder_paths.get_save_image_path(filename_prefix, output_dir) + output_files = [] + + metadata = PngInfo() + video_metadata = {} + if prompt is not None: + metadata.add_text("prompt", json.dumps(prompt)) + video_metadata["prompt"] = json.dumps(prompt) + if extra_pnginfo is not None: + for x in extra_pnginfo: + metadata.add_text(x, json.dumps(extra_pnginfo[x])) + video_metadata[x] = extra_pnginfo[x] + extra_options = extra_pnginfo.get('workflow', {}).get('extra', {}) + else: + extra_options = {} + metadata.add_text("CreationTime", datetime.datetime.now().isoformat(" ")[:19]) + + if meta_batch is not None and unique_id in meta_batch.outputs: + (counter, output_process) = meta_batch.outputs[unique_id] + else: + # comfy counter workaround + max_counter = 0 + + # Loop through the existing files + matcher = re.compile(f"{re.escape(filename)}_(\\d+)\\D*\\..+", re.IGNORECASE) + for existing_file in os.listdir(full_output_folder): + # Check if the file matches the expected format + match = matcher.fullmatch(existing_file) + if match: + # Extract the numeric portion of the filename + file_counter = int(match.group(1)) + # Update the maximum counter value if necessary + if file_counter > max_counter: + max_counter = file_counter + + # Increment the counter by 1 to get the next available value + counter = max_counter + 1 + output_process = None + + # save first frame as png to keep metadata + first_image_file = f"{filename}_{counter:05}.png" + file_path = os.path.join(full_output_folder, first_image_file) + if extra_options.get('VHS_MetadataImage', True) != False: + Image.fromarray(tensor_to_bytes(first_image)).save( + file_path, + pnginfo=metadata, + compress_level=4, + ) + output_files.append(file_path) + + format_type, format_ext = format.split("/") + if format_type == "image": + if meta_batch is not None: + raise Exception("Pillow('image/') formats are not compatible with batched output") + image_kwargs = {} + if format_ext == "gif": + image_kwargs['disposal'] = 2 + if format_ext == "webp": + #Save timestamp information + exif = Image.Exif() + exif[ExifTags.IFD.Exif] = {36867: datetime.datetime.now().isoformat(" ")[:19]} + image_kwargs['exif'] = exif + image_kwargs['lossless'] = kwargs.get("lossless", True) + file = f"{filename}_{counter:05}.{format_ext}" + file_path = os.path.join(full_output_folder, file) + if pingpong: + images = to_pingpong(images) + def frames_gen(images): + for i in images: + pbar.update(1) + yield Image.fromarray(tensor_to_bytes(i)) + frames = frames_gen(images) + # Use pillow directly to save an animated image + next(frames).save( + file_path, + format=format_ext.upper(), + save_all=True, + append_images=frames, + duration=round(1000 / frame_rate), + loop=loop_count, + compress_level=4, + **image_kwargs + ) + output_files.append(file_path) + else: + # Use ffmpeg to save a video + if ffmpeg_path is None: + raise ProcessLookupError(f"ffmpeg is required for video outputs and could not be found.\nIn order to use video outputs, you must either:\n- Install imageio-ffmpeg with pip,\n- Place a ffmpeg executable in {os.path.abspath('')}, or\n- Install ffmpeg and add it to the system path.") + + if manual_format_widgets is not None: + logger.warn("Format args can now be passed directly. The manual_format_widgets argument is now deprecated") + kwargs.update(manual_format_widgets) + + has_alpha = first_image.shape[-1] == 4 + kwargs["has_alpha"] = has_alpha + video_format = apply_format_widgets(format_ext, kwargs) + dim_alignment = video_format.get("dim_alignment", 2) + if (first_image.shape[1] % dim_alignment) or (first_image.shape[0] % dim_alignment): + #output frames must be padded + to_pad = (-first_image.shape[1] % dim_alignment, + -first_image.shape[0] % dim_alignment) + padding = (to_pad[0]//2, to_pad[0] - to_pad[0]//2, + to_pad[1]//2, to_pad[1] - to_pad[1]//2) + padfunc = torch.nn.ReplicationPad2d(padding) + def pad(image): + image = image.permute((2,0,1))#HWC to CHW + padded = padfunc(image.to(dtype=torch.float32)) + return padded.permute((1,2,0)) + images = map(pad, images) + dimensions = (-first_image.shape[1] % dim_alignment + first_image.shape[1], + -first_image.shape[0] % dim_alignment + first_image.shape[0]) + logger.warn("Output images were not of valid resolution and have had padding applied") + else: + dimensions = (first_image.shape[1], first_image.shape[0]) + if pingpong: + if meta_batch is not None: + logger.error("pingpong is incompatible with batched output") + images = to_pingpong(images) + if num_frames > 2: + num_frames += num_frames -2 + pbar.total = num_frames + if loop_count > 0: + loop_args = ["-vf", "loop=loop=" + str(loop_count)+":size=" + str(num_frames)] + else: + loop_args = [] + if video_format.get('input_color_depth', '8bit') == '16bit': + images = map(tensor_to_shorts, images) + if has_alpha: + i_pix_fmt = 'rgba64' + else: + i_pix_fmt = 'rgb48' + else: + images = map(tensor_to_bytes, images) + if has_alpha: + i_pix_fmt = 'rgba' + else: + i_pix_fmt = 'rgb24' + file = f"{filename}_{counter:05}.{video_format['extension']}" + file_path = os.path.join(full_output_folder, file) + bitrate_arg = [] + bitrate = video_format.get('bitrate') + if bitrate is not None: + bitrate_arg = ["-b:v", str(bitrate) + "M" if video_format.get('megabit') == 'True' else str(bitrate) + "K"] + args = [ffmpeg_path, "-v", "error", "-f", "rawvideo", "-pix_fmt", i_pix_fmt, + # The image data is in an undefined generic RGB color space, which in practice means sRGB. + # sRGB has the same primaries and matrix as BT.709, but a different transfer function (gamma), + # called by the sRGB standard name IEC 61966-2-1. However, video hosting platforms like YouTube + # standardize on full BT.709 and will convert the colors accordingly. This last minute change + # in colors can be confusing to users. We can counter it by lying about the transfer function + # on a per format basis, i.e. for video we will lie to FFmpeg that it is already BT.709. Also, + # because the input data is in RGB (not YUV) it is more efficient (fewer scale filter invocations) + # to specify the input color space as RGB and then later, if the format actually wants YUV, + # to convert it to BT.709 YUV via FFmpeg's -vf "scale=out_color_matrix=bt709". + "-color_range", "pc", "-colorspace", "rgb", "-color_primaries", "bt709", + "-color_trc", video_format.get("fake_trc", "iec61966-2-1"), + "-s", f"{dimensions[0]}x{dimensions[1]}", "-r", str(frame_rate), "-i", "-"] \ + + loop_args + + images = map(lambda x: x.tobytes(), images) + env=os.environ.copy() + if "environment" in video_format: + env.update(video_format["environment"]) + + if "pre_pass" in video_format: + if meta_batch is not None: + #Performing a prepass requires keeping access to all frames. + #Potential solutions include keeping just output frames in + #memory or using 3 passes with intermediate file, but + #very long gifs probably shouldn't be encouraged + raise Exception("Formats which require a pre_pass are incompatible with Batch Manager.") + images = [b''.join(images)] + os.makedirs(folder_paths.get_temp_directory(), exist_ok=True) + in_args_len = args.index("-i") + 2 # The index after ["-i", "-"] + pre_pass_args = args[:in_args_len] + video_format['pre_pass'] + merge_filter_args(pre_pass_args) + try: + subprocess.run(pre_pass_args, input=images[0], env=env, + capture_output=True, check=True) + except subprocess.CalledProcessError as e: + raise Exception("An error occurred in the ffmpeg prepass:\n" \ + + e.stderr.decode(*ENCODE_ARGS)) + if "inputs_main_pass" in video_format: + in_args_len = args.index("-i") + 2 # The index after ["-i", "-"] + args = args[:in_args_len] + video_format['inputs_main_pass'] + args[in_args_len:] + + if output_process is None: + if 'gifski_pass' in video_format: + format = 'image/gif' + output_process = gifski_process(args, dimensions, video_format, file_path, env) + audio = None + else: + args += video_format['main_pass'] + bitrate_arg + merge_filter_args(args) + output_process = ffmpeg_process(args, video_format, video_metadata, file_path, env) + #Proceed to first yield + output_process.send(None) + if meta_batch is not None: + meta_batch.outputs[unique_id] = (counter, output_process) + + for image in images: + pbar.update(1) + output_process.send(image) + if meta_batch is not None: + requeue_workflow((meta_batch.unique_id, not meta_batch.has_closed_inputs)) + if meta_batch is None or meta_batch.has_closed_inputs: + #Close pipe and wait for termination. + try: + total_frames_output = output_process.send(None) + output_process.send(None) + except StopIteration: + pass + if meta_batch is not None: + meta_batch.outputs.pop(unique_id) + if len(meta_batch.outputs) == 0: + meta_batch.reset() + else: + #batch is unfinished + #TODO: Check if empty output breaks other custom nodes + return {"ui": {"unfinished_batch": [True]}, "result": ((save_output, []),)} + + output_files.append(file_path) + + + a_waveform = None + if audio is not None: + try: + #safely check if audio produced by VHS_LoadVideo actually exists + a_waveform = audio['waveform'] + except: + pass + if a_waveform is not None: + # Create audio file if input was provided + output_file_with_audio = f"{filename}_{counter:05}-audio.{video_format['extension']}" + output_file_with_audio_path = os.path.join(full_output_folder, output_file_with_audio) + if "audio_pass" not in video_format: + logger.warn("Selected video format does not have explicit audio support") + video_format["audio_pass"] = ["-c:a", "libopus"] + + + # FFmpeg command with audio re-encoding + #TODO: expose audio quality options if format widgets makes it in + #Reconsider forcing apad/shortest + channels = audio['waveform'].size(1) + min_audio_dur = total_frames_output / frame_rate + 1 + if video_format.get('trim_to_audio', 'False') != 'False': + apad = [] + else: + apad = ["-af", "apad=whole_dur="+str(min_audio_dur)] + mux_args = [ffmpeg_path, "-v", "error", "-n", "-i", file_path, + "-ar", str(audio['sample_rate']), "-ac", str(channels), + "-f", "f32le", "-i", "-", "-c:v", "copy"] \ + + video_format["audio_pass"] \ + + apad + ["-shortest", output_file_with_audio_path] + + audio_data = audio['waveform'].squeeze(0).transpose(0,1) \ + .numpy().tobytes() + merge_filter_args(mux_args, '-af') + try: + res = subprocess.run(mux_args, input=audio_data, + env=env, capture_output=True, check=True) + except subprocess.CalledProcessError as e: + raise Exception("An error occured in the ffmpeg subprocess:\n" \ + + e.stderr.decode(*ENCODE_ARGS)) + if res.stderr: + print(res.stderr.decode(*ENCODE_ARGS), end="", file=sys.stderr) + output_files.append(output_file_with_audio_path) + #Return this file with audio to the webui. + #It will be muted unless opened or saved with right click + file = output_file_with_audio + if extra_options.get('VHS_KeepIntermediate', True) == False: + for intermediate in output_files[1:-1]: + if os.path.exists(intermediate): + os.remove(intermediate) + preview = { + "filename": file, + "subfolder": subfolder, + "type": "output" if save_output else "temp", + "format": format, + "frame_rate": frame_rate, + "workflow": first_image_file, + "fullpath": output_files[-1], + } + if num_frames == 1 and 'png' in format and '%03d' in file: + preview['format'] = 'image/png' + preview['filename'] = file.replace('%03d', '001') + return {"ui": {"gifs": [preview]}, "result": ((save_output, output_files),)} + +class LoadAudio: + @classmethod + def INPUT_TYPES(s): + #Hide ffmpeg formats if ffmpeg isn't available + return { + "required": { + "audio_file": ("STRING", {"default": "input/", "vhs_path_extensions": ['wav','mp3','ogg','m4a','flac']}), + }, + "optional" : { + "seek_seconds": ("FLOAT", {"default": 0, "min": 0, "widgetType": "VHSTIMESTAMP"}), + "duration": ("FLOAT" , {"default": 0, "min": 0, "max": 10000000, "step": 0.01, "widgetType": "VHSTIMESTAMP"}), + } + } + + RETURN_TYPES = ("AUDIO", "FLOAT") + RETURN_NAMES = ("audio", "duration") + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢/audio" + FUNCTION = "load_audio" + def load_audio(self, audio_file, seek_seconds=0, duration=0): + audio_file = strip_path(audio_file) + if audio_file is None or validate_path(audio_file) != True: + raise Exception("audio_file is not a valid path: " + audio_file) + if is_url(audio_file): + audio_file = try_download_video(audio_file) or audio_file + #Eagerly fetch the audio since the user must be using it if the + #node executes, unlike Load Video + audio = get_audio(audio_file, start_time=seek_seconds, duration=duration) + loaded_duration = audio['waveform'].size(2)/audio['sample_rate'] + return (audio, loaded_duration) + + @classmethod + def IS_CHANGED(s, audio_file, **kwargs): + return hash_path(audio_file) + + @classmethod + def VALIDATE_INPUTS(s, audio_file, **kwargs): + return validate_path(audio_file, allow_none=True) + +class LoadAudioUpload: + @classmethod + def INPUT_TYPES(s): + input_dir = folder_paths.get_input_directory() + files = [] + for f in os.listdir(input_dir): + if os.path.isfile(os.path.join(input_dir, f)): + file_parts = f.split('.') + if len(file_parts) > 1 and (file_parts[-1] in audio_extensions): + files.append(f) + return {"required": { + "audio": (sorted(files),),}, + "optional": { + "start_time": ("FLOAT" , {"default": 0, "min": 0, "max": 10000000, "step": 0.01, "widgetType": "VHSTIMESTAMP"}), + "duration": ("FLOAT" , {"default": 0, "min": 0, "max": 10000000, "step": 0.01, "widgetType": "VHSTIMESTAMP"}), + }, + } + + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢/audio" + + RETURN_TYPES = ("AUDIO", "FLOAT") + RETURN_NAMES = ("audio", "duration") + FUNCTION = "load_audio" + + def load_audio(self, start_time=0, duration=0, **kwargs): + audio_file = folder_paths.get_annotated_filepath(strip_path(kwargs['audio'])) + if audio_file is None or validate_path(audio_file) != True: + raise Exception("audio_file is not a valid path: " + audio_file) + + audio = get_audio(audio_file, start_time, duration) + loaded_duration = audio['waveform'].size(2)/audio['sample_rate'] + return (audio, loaded_duration) + + @classmethod + def IS_CHANGED(s, audio, **kwargs): + audio_file = folder_paths.get_annotated_filepath(strip_path(audio)) + return hash_path(audio_file) + + @classmethod + def VALIDATE_INPUTS(s, audio, **kwargs): + audio_file = folder_paths.get_annotated_filepath(strip_path(audio)) + return validate_path(audio_file, allow_none=True) +class AudioToVHSAudio: + """Legacy method for external nodes that utilized VHS_AUDIO, + VHS_AUDIO is deprecated as a format and should no longer be used""" + @classmethod + def INPUT_TYPES(s): + return {"required": {"audio": ("AUDIO",)}} + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢/audio" + + RETURN_TYPES = ("VHS_AUDIO", ) + RETURN_NAMES = ("vhs_audio",) + FUNCTION = "convert_audio" + + def convert_audio(self, audio): + ar = str(audio['sample_rate']) + ac = str(audio['waveform'].size(1)) + mux_args = [ffmpeg_path, "-f", "f32le", "-ar", ar, "-ac", ac, + "-i", "-", "-f", "wav", "-"] + + audio_data = audio['waveform'].squeeze(0).transpose(0,1) \ + .numpy().tobytes() + try: + res = subprocess.run(mux_args, input=audio_data, + capture_output=True, check=True) + except subprocess.CalledProcessError as e: + raise Exception("An error occured in the ffmpeg subprocess:\n" \ + + e.stderr.decode(*ENCODE_ARGS)) + if res.stderr: + print(res.stderr.decode(*ENCODE_ARGS), end="", file=sys.stderr) + return (lambda: res.stdout,) + +class VHSAudioToAudio: + """Legacy method for external nodes that utilized VHS_AUDIO, + VHS_AUDIO is deprecated as a format and should no longer be used""" + @classmethod + def INPUT_TYPES(s): + return {"required": {"vhs_audio": ("VHS_AUDIO",)}} + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢/audio" + + RETURN_TYPES = ("AUDIO", ) + RETURN_NAMES = ("audio",) + FUNCTION = "convert_audio" + + def convert_audio(self, vhs_audio): + if not vhs_audio or not vhs_audio(): + raise Exception("audio input is not valid") + args = [ffmpeg_path, "-i", '-'] + try: + res = subprocess.run(args + ["-f", "f32le", "-"], input=vhs_audio(), + capture_output=True, check=True) + audio = torch.frombuffer(bytearray(res.stdout), dtype=torch.float32) + except subprocess.CalledProcessError as e: + raise Exception("An error occured in the ffmpeg subprocess:\n" \ + + e.stderr.decode(*ENCODE_ARGS)) + match = re.search(', (\\d+) Hz, (\\w+), ',res.stderr.decode(*ENCODE_ARGS)) + if match: + ar = int(match.group(1)) + #NOTE: Just throwing an error for other channel types right now + #Will deal with issues if they come + ac = {"mono": 1, "stereo": 2}[match.group(2)] + else: + ar = 44100 + ac = 2 + audio = audio.reshape((-1,ac)).transpose(0,1).unsqueeze(0) + return ({'waveform': audio, 'sample_rate': ar},) + +class PruneOutputs: + @classmethod + def INPUT_TYPES(s): + return { + "required": { + "filenames": ("VHS_FILENAMES",), + "options": (["Intermediate", "Intermediate and Utility"],) + } + } + + RETURN_TYPES = () + OUTPUT_NODE = True + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢" + FUNCTION = "prune_outputs" + + def prune_outputs(self, filenames, options): + if len(filenames[1]) == 0: + return () + assert(len(filenames[1]) <= 3 and len(filenames[1]) >= 2) + delete_list = [] + if options in ["Intermediate", "Intermediate and Utility", "All"]: + delete_list += filenames[1][1:-1] + if options in ["Intermediate and Utility", "All"]: + delete_list.append(filenames[1][0]) + if options in ["All"]: + delete_list.append(filenames[1][-1]) + + output_dirs = [folder_paths.get_output_directory(), + folder_paths.get_temp_directory()] + for file in delete_list: + #Check that path is actually an output directory + if (os.path.commonpath([output_dirs[0], file]) != output_dirs[0]) \ + and (os.path.commonpath([output_dirs[1], file]) != output_dirs[1]): + raise Exception("Tried to prune output from invalid directory: " + file) + if os.path.exists(file): + os.remove(file) + return () + +class BatchManager: + def __init__(self, frames_per_batch=-1): + self.frames_per_batch = frames_per_batch + self.inputs = {} + self.outputs = {} + self.unique_id = None + self.has_closed_inputs = False + self.total_frames = float('inf') + def reset(self): + self.close_inputs() + for key in self.outputs: + if getattr(self.outputs[key][-1], "gi_suspended", False): + try: + self.outputs[key][-1].send(None) + except StopIteration: + pass + self.__init__(self.frames_per_batch) + def has_open_inputs(self): + return len(self.inputs) > 0 + def close_inputs(self): + for key in self.inputs: + if getattr(self.inputs[key][-1], "gi_suspended", False): + try: + self.inputs[key][-1].send(1) + except StopIteration: + pass + self.inputs = {} + + @classmethod + def INPUT_TYPES(s): + return { + "required": { + "frames_per_batch": ("INT", {"default": 16, "min": 1, "max": BIGMAX, "step": 1}) + }, + "hidden": { + "prompt": "PROMPT", + "unique_id": "UNIQUE_ID" + }, + } + + RETURN_TYPES = ("VHS_BatchManager",) + RETURN_NAMES = ("meta_batch",) + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢" + FUNCTION = "update_batch" + + def update_batch(self, frames_per_batch, prompt=None, unique_id=None): + if unique_id is not None and prompt is not None: + requeue = prompt[unique_id]['inputs'].get('requeue', 0) + else: + requeue = 0 + if requeue == 0: + self.reset() + self.frames_per_batch = frames_per_batch + self.unique_id = unique_id + else: + num_batches = (self.total_frames+self.frames_per_batch-1)//frames_per_batch + print(f'Meta-Batch {requeue}/{num_batches}') + #onExecuted seems to not be called unless some message is sent + return (self,) + + +class VideoInfo: + @classmethod + def INPUT_TYPES(s): + return { + "required": { + "video_info": ("VHS_VIDEOINFO",), + } + } + + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢" + + RETURN_TYPES = ("FLOAT","INT", "FLOAT", "INT", "INT", "FLOAT","INT", "FLOAT", "INT", "INT") + RETURN_NAMES = ( + "source_fps🟨", + "source_frame_count🟨", + "source_duration🟨", + "source_width🟨", + "source_height🟨", + "loaded_fps🟦", + "loaded_frame_count🟦", + "loaded_duration🟦", + "loaded_width🟦", + "loaded_height🟦", + ) + FUNCTION = "get_video_info" + + def get_video_info(self, video_info): + keys = ["fps", "frame_count", "duration", "width", "height"] + + source_info = [] + loaded_info = [] + + for key in keys: + source_info.append(video_info[f"source_{key}"]) + loaded_info.append(video_info[f"loaded_{key}"]) + + return (*source_info, *loaded_info) + + +class VideoInfoSource: + @classmethod + def INPUT_TYPES(s): + return { + "required": { + "video_info": ("VHS_VIDEOINFO",), + } + } + + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢" + + RETURN_TYPES = ("FLOAT","INT", "FLOAT", "INT", "INT",) + RETURN_NAMES = ( + "fps🟨", + "frame_count🟨", + "duration🟨", + "width🟨", + "height🟨", + ) + FUNCTION = "get_video_info" + + def get_video_info(self, video_info): + keys = ["fps", "frame_count", "duration", "width", "height"] + + source_info = [] + + for key in keys: + source_info.append(video_info[f"source_{key}"]) + + return (*source_info,) + + +class VideoInfoLoaded: + @classmethod + def INPUT_TYPES(s): + return { + "required": { + "video_info": ("VHS_VIDEOINFO",), + } + } + + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢" + + RETURN_TYPES = ("FLOAT","INT", "FLOAT", "INT", "INT",) + RETURN_NAMES = ( + "fps🟦", + "frame_count🟦", + "duration🟦", + "width🟦", + "height🟦", + ) + FUNCTION = "get_video_info" + + def get_video_info(self, video_info): + keys = ["fps", "frame_count", "duration", "width", "height"] + + loaded_info = [] + + for key in keys: + loaded_info.append(video_info[f"loaded_{key}"]) + + return (*loaded_info,) + +class SelectFilename: + @classmethod + def INPUT_TYPES(s): + return {"required": {"filenames": ("VHS_FILENAMES",), "index": ("INT", {"default": -1, "step": 1, "min": -1})}} + RETURN_TYPES = ("STRING",) + RETURN_NAMES =("Filename",) + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢" + FUNCTION = "select_filename" + + def select_filename(self, filenames, index): + return (filenames[1][index],) +class Unbatch: + class Any(str): + def __ne__(self, other): + return False + @classmethod + def INPUT_TYPES(s): + return {"required": {"batched": ("*",)}} + RETURN_TYPES = (Any('*'),) + INPUT_IS_LIST = True + RETURN_NAMES =("unbatched",) + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢" + FUNCTION = "unbatch" + def unbatch(self, batched): + if isinstance(batched[0], torch.Tensor): + return (torch.cat(batched),) + if isinstance(batched[0], dict): + out = batched[0].copy() + if 'samples' in out: + out['samples'] = torch.cat([x['samples'] for x in batched]) + if 'waveform' in out: + out['waveform'] = torch.cat([x['waveform'] for x in batched]) + out.pop('batch_index', None) + return (out,) + return (functools.reduce(lambda x,y: x+y, batched),) + @classmethod + def VALIDATE_INPUTS(cls, input_types): + return True +class SelectLatest: + @classmethod + def INPUT_TYPES(s): + return {"required": {"filename_prefix": ("STRING", {'default': 'output/AnimateDiff', 'vhs_path_extensions': []}), + "filename_postfix": ("STRING", {"placeholder": ".webm"})}} + RETURN_TYPES = ("STRING",) + RETURN_NAMES =("Filename",) + CATEGORY = "Video Helper Suite 🎥🅥🅗🅢" + FUNCTION = "select_latest" + EXPERIMENTAL = True + + def select_latest(self, filename_prefix, filename_postfix): + assert False, "Not Reachable" + +NODE_CLASS_MAPPINGS = { + "VHS_VideoCombine": VideoCombine, + "VHS_LoadVideo": LoadVideoUpload, + "VHS_LoadVideoPath": LoadVideoPath, + "VHS_LoadVideoFFmpeg": LoadVideoFFmpegUpload, + "VHS_LoadVideoFFmpegPath": LoadVideoFFmpegPath, + "VHS_LoadImagePath": LoadImagePath, + "VHS_LoadImages": LoadImagesFromDirectoryUpload, + "VHS_LoadImagesPath": LoadImagesFromDirectoryPath, + "VHS_LoadAudio": LoadAudio, + "VHS_LoadAudioUpload": LoadAudioUpload, + "VHS_AudioToVHSAudio": AudioToVHSAudio, + "VHS_VHSAudioToAudio": VHSAudioToAudio, + "VHS_PruneOutputs": PruneOutputs, + "VHS_BatchManager": BatchManager, + "VHS_VideoInfo": VideoInfo, + "VHS_VideoInfoSource": VideoInfoSource, + "VHS_VideoInfoLoaded": VideoInfoLoaded, + "VHS_SelectFilename": SelectFilename, + # Batched Nodes + "VHS_VAEEncodeBatched": VAEEncodeBatched, + "VHS_VAEDecodeBatched": VAEDecodeBatched, + # Latent and Image nodes + "VHS_SplitLatents": SplitLatents, + "VHS_SplitImages": SplitImages, + "VHS_SplitMasks": SplitMasks, + "VHS_MergeLatents": MergeLatents, + "VHS_MergeImages": MergeImages, + "VHS_MergeMasks": MergeMasks, + "VHS_GetLatentCount": GetLatentCount, + "VHS_GetImageCount": GetImageCount, + "VHS_GetMaskCount": GetMaskCount, + "VHS_DuplicateLatents": RepeatLatents, + "VHS_DuplicateImages": RepeatImages, + "VHS_DuplicateMasks": RepeatMasks, + "VHS_SelectEveryNthLatent": SelectEveryNthLatent, + "VHS_SelectEveryNthImage": SelectEveryNthImage, + "VHS_SelectEveryNthMask": SelectEveryNthMask, + "VHS_SelectLatents": SelectLatents, + "VHS_SelectImages": SelectImages, + "VHS_SelectMasks": SelectMasks, + "VHS_Unbatch": Unbatch, + "VHS_SelectLatest": SelectLatest, +} +NODE_DISPLAY_NAME_MAPPINGS = { + "VHS_VideoCombine": "Video Combine 🎥🅥🅗🅢", + "VHS_LoadVideo": "Load Video (Upload) 🎥🅥🅗🅢", + "VHS_LoadVideoPath": "Load Video (Path) 🎥🅥🅗🅢", + "VHS_LoadVideoFFmpeg": "Load Video FFmpeg (Upload) 🎥🅥🅗🅢", + "VHS_LoadVideoFFmpegPath": "Load Video FFmpeg (Path) 🎥🅥🅗🅢", + "VHS_LoadImagePath": "Load Image (Path) 🎥🅥🅗🅢", + "VHS_LoadImages": "Load Images (Upload) 🎥🅥🅗🅢", + "VHS_LoadImagesPath": "Load Images (Path) 🎥🅥🅗🅢", + "VHS_LoadAudio": "Load Audio (Path)🎥🅥🅗🅢", + "VHS_LoadAudioUpload": "Load Audio (Upload)🎥🅥🅗🅢", + "VHS_AudioToVHSAudio": "Audio to legacy VHS_AUDIO🎥🅥🅗🅢", + "VHS_VHSAudioToAudio": "Legacy VHS_AUDIO to Audio🎥🅥🅗🅢", + "VHS_PruneOutputs": "Prune Outputs 🎥🅥🅗🅢", + "VHS_BatchManager": "Meta Batch Manager 🎥🅥🅗🅢", + "VHS_VideoInfo": "Video Info 🎥🅥🅗🅢", + "VHS_VideoInfoSource": "Video Info (Source) 🎥🅥🅗🅢", + "VHS_VideoInfoLoaded": "Video Info (Loaded) 🎥🅥🅗🅢", + "VHS_SelectFilename": "Select Filename 🎥🅥🅗🅢", + # Batched Nodes + "VHS_VAEEncodeBatched": "VAE Encode Batched 🎥🅥🅗🅢", + "VHS_VAEDecodeBatched": "VAE Decode Batched 🎥🅥🅗🅢", + # Latent and Image nodes + "VHS_SplitLatents": "Split Latents 🎥🅥🅗🅢", + "VHS_SplitImages": "Split Images 🎥🅥🅗🅢", + "VHS_SplitMasks": "Split Masks 🎥🅥🅗🅢", + "VHS_MergeLatents": "Merge Latents 🎥🅥🅗🅢", + "VHS_MergeImages": "Merge Images 🎥🅥🅗🅢", + "VHS_MergeMasks": "Merge Masks 🎥🅥🅗🅢", + "VHS_GetLatentCount": "Get Latent Count 🎥🅥🅗🅢", + "VHS_GetImageCount": "Get Image Count 🎥🅥🅗🅢", + "VHS_GetMaskCount": "Get Mask Count 🎥🅥🅗🅢", + "VHS_DuplicateLatents": "Repeat Latents 🎥🅥🅗🅢", + "VHS_DuplicateImages": "Repeat Images 🎥🅥🅗🅢", + "VHS_DuplicateMasks": "Repeat Masks 🎥🅥🅗🅢", + "VHS_SelectEveryNthLatent": "Select Every Nth Latent 🎥🅥🅗🅢", + "VHS_SelectEveryNthImage": "Select Every Nth Image 🎥🅥🅗🅢", + "VHS_SelectEveryNthMask": "Select Every Nth Mask 🎥🅥🅗🅢", + "VHS_SelectLatents": "Select Latents 🎥🅥🅗🅢", + "VHS_SelectImages": "Select Images 🎥🅥🅗🅢", + "VHS_SelectMasks": "Select Masks 🎥🅥🅗🅢", + "VHS_Unbatch": "Unbatch 🎥🅥🅗🅢", + "VHS_SelectLatest": "Select Latest 🎥🅥🅗🅢", +} diff --git a/docs/hel-892/scail-load-reference/videohelpersuite__utils.py b/docs/hel-892/scail-load-reference/videohelpersuite__utils.py new file mode 100644 index 00000000..75431d5a --- /dev/null +++ b/docs/hel-892/scail-load-reference/videohelpersuite__utils.py @@ -0,0 +1,426 @@ +import hashlib +import os +from typing import Iterable +import shutil +import subprocess +import re +import time +from collections.abc import Mapping +from typing import Union +import functools +import torch +from torch import Tensor + +import server +from .logger import logger +import folder_paths + +BIGMIN = -(2**53-1) +BIGMAX = (2**53-1) + +DIMMAX = 8192 + +ENCODE_ARGS = ("utf-8", 'backslashreplace') + +def ffmpeg_suitability(path): + try: + version = subprocess.run([path, "-version"], check=True, + capture_output=True).stdout.decode(*ENCODE_ARGS) + except: + return 0 + score = 0 + #rough layout of the importance of various features + simple_criterion = [("libvpx", 20),("264",10), ("265",3), + ("svtav1",5),("libopus", 1)] + for criterion in simple_criterion: + if version.find(criterion[0]) >= 0: + score += criterion[1] + #obtain rough compile year from copyright information + copyright_index = version.find('2000-2') + if copyright_index >= 0: + copyright_year = version[copyright_index+6:copyright_index+9] + if copyright_year.isnumeric(): + score += int(copyright_year) + return score + +class MultiInput(str): + def __new__(cls, string, allowed_types="*"): + res = super().__new__(cls, string) + res.allowed_types=allowed_types + return res + def __ne__(self, other): + if self.allowed_types == "*" or other == "*": + return False + return other not in self.allowed_types +imageOrLatent = MultiInput("IMAGE", ["IMAGE", "LATENT"]) +floatOrInt = MultiInput("FLOAT", ["FLOAT", "INT"]) + +class ContainsAll(dict): + def __contains__(self, other): + return True + def __getitem__(self, key): + return super().get(key, (None, {})) + +if "VHS_FORCE_FFMPEG_PATH" in os.environ: + ffmpeg_path = os.environ.get("VHS_FORCE_FFMPEG_PATH") +else: + ffmpeg_paths = [] + try: + from imageio_ffmpeg import get_ffmpeg_exe + imageio_ffmpeg_path = get_ffmpeg_exe() + ffmpeg_paths.append(imageio_ffmpeg_path) + except: + if "VHS_USE_IMAGEIO_FFMPEG" in os.environ: + raise + logger.warn("Failed to import imageio_ffmpeg") + if "VHS_USE_IMAGEIO_FFMPEG" in os.environ: + ffmpeg_path = imageio_ffmpeg_path + else: + system_ffmpeg = shutil.which("ffmpeg") + if system_ffmpeg is not None: + ffmpeg_paths.append(system_ffmpeg) + if os.path.isfile("ffmpeg"): + ffmpeg_paths.append(os.path.abspath("ffmpeg")) + if os.path.isfile("ffmpeg.exe"): + ffmpeg_paths.append(os.path.abspath("ffmpeg.exe")) + if len(ffmpeg_paths) == 0: + logger.error("No valid ffmpeg found.") + ffmpeg_path = None + elif len(ffmpeg_paths) == 1: + #Evaluation of suitability isn't required, can take sole option + #to reduce startup time + ffmpeg_path = ffmpeg_paths[0] + else: + ffmpeg_path = max(ffmpeg_paths, key=ffmpeg_suitability) +gifski_path = os.environ.get("VHS_GIFSKI", None) +if gifski_path is None: + gifski_path = os.environ.get("JOV_GIFSKI", None) + if gifski_path is None: + gifski_path = shutil.which("gifski") +ytdl_path = os.environ.get("VHS_YTDL", None) or shutil.which('yt-dlp') \ + or shutil.which('youtube-dl') +download_history = {} +def try_download_video(url): + if ytdl_path is None: + return None + if url in download_history: + return download_history[url] + os.makedirs(folder_paths.get_temp_directory(), exist_ok=True) + #Format information could be added to only download audio for Load Audio, + #but this gets hairy if same url is also used for video. + #Best to just always keep defaults + #dl_format = ['-f', 'ba'] if is_audio else [] + try: + res = subprocess.run([ytdl_path, "--print", "after_move:filepath", + "-P", folder_paths.get_temp_directory(), url], + capture_output=True, check=True) + #strip newline + file = res.stdout.decode(*ENCODE_ARGS)[:-1] + except subprocess.CalledProcessError as e: + raise Exception("An error occurred in the yt-dl process:\n" \ + + e.stderr.decode(*ENCODE_ARGS)) + file = None + download_history[url] = file + return file + +def is_safe_path(path, strict=False): + if "VHS_STRICT_PATHS" not in os.environ and not strict: + return True + basedir = os.path.abspath('.') + try: + common_path = os.path.commonpath([basedir, path]) + except: + #Different drive on windows + return False + return common_path == basedir + +def get_sorted_dir_files_from_directory(directory: str, skip_first_images: int=0, select_every_nth: int=1, extensions: Iterable=None): + directory = strip_path(directory) + dir_files = os.listdir(directory) + dir_files = sorted(dir_files) + dir_files = [os.path.join(directory, x) for x in dir_files] + dir_files = list(filter(lambda filepath: os.path.isfile(filepath), dir_files)) + # filter by extension, if needed + if extensions is not None: + extensions = list(extensions) + new_dir_files = [] + for filepath in dir_files: + ext = "." + filepath.split(".")[-1] + if ext.lower() in extensions: + new_dir_files.append(filepath) + dir_files = new_dir_files + # start at skip_first_images + dir_files = dir_files[skip_first_images:] + dir_files = dir_files[0::select_every_nth] + return dir_files + + +# modified from https://stackoverflow.com/questions/22058048/hashing-a-file-in-python +def calculate_file_hash(filename: str, hash_every_n: int = 1): + #Larger video files were taking >.5 seconds to hash even when cached, + #so instead the modified time from the filesystem is used as a hash + h = hashlib.sha256() + h.update(filename.encode()) + h.update(str(os.path.getmtime(filename)).encode()) + return h.hexdigest() + +prompt_queue = server.PromptServer.instance.prompt_queue +def requeue_workflow_unchecked(): + """Requeues the current workflow without checking for multiple requeues""" + currently_running = prompt_queue.currently_running + (_, _, prompt, extra_data, outputs_to_execute) = next(iter(currently_running.values())) + + #Ensure batch_managers are marked stale + prompt = prompt.copy() + for uid in prompt: + if prompt[uid]['class_type'] == 'VHS_BatchManager': + prompt[uid]['inputs']['requeue'] = prompt[uid]['inputs'].get('requeue',0)+1 + + #execution.py has guards for concurrency, but server doesn't. + #TODO: Check that this won't be an issue + number = -server.PromptServer.instance.number + server.PromptServer.instance.number += 1 + prompt_id = str(server.uuid.uuid4()) + prompt_queue.put((number, prompt_id, prompt, extra_data, outputs_to_execute)) + +requeue_guard = [None, 0, 0, {}] +def requeue_workflow(requeue_required=(-1,True)): + assert(len(prompt_queue.currently_running) == 1) + global requeue_guard + (run_number, _, prompt, _, _) = next(iter(prompt_queue.currently_running.values())) + if requeue_guard[0] != run_number: + #Calculate a count of how many outputs are managed by a batch manager + managed_outputs=0 + for bm_uid in prompt: + if prompt[bm_uid]['class_type'] == 'VHS_BatchManager': + for output_uid in prompt: + if prompt[output_uid]['class_type'] in ["VHS_VideoCombine"]: + for inp in prompt[output_uid]['inputs'].values(): + if inp == [bm_uid, 0]: + managed_outputs+=1 + requeue_guard = [run_number, 0, managed_outputs, {}] + requeue_guard[1] = requeue_guard[1]+1 + requeue_guard[3][requeue_required[0]] = requeue_required[1] + if requeue_guard[1] == requeue_guard[2] and max(requeue_guard[3].values()): + requeue_workflow_unchecked() + +def get_audio(file, start_time=0, duration=0): + args = [ffmpeg_path, "-i", file] + if start_time > 0: + args += ["-ss", str(start_time)] + if duration > 0: + args += ["-t", str(duration)] + try: + #TODO: scan for sample rate and maintain + res = subprocess.run(args + ["-f", "f32le", "-"], + capture_output=True, check=True) + audio = torch.frombuffer(bytearray(res.stdout), dtype=torch.float32) + match = re.search(', (\\d+) Hz, (\\w+), ',res.stderr.decode(*ENCODE_ARGS)) + except subprocess.CalledProcessError as e: + raise Exception(f"VHS failed to extract audio from {file}:\n" \ + + e.stderr.decode(*ENCODE_ARGS)) + if match: + ar = int(match.group(1)) + #NOTE: Just throwing an error for other channel types right now + #Will deal with issues if they come + ac = {"mono": 1, "stereo": 2}[match.group(2)] + else: + ar = 44100 + ac = 2 + audio = audio.reshape((-1,ac)).transpose(0,1).unsqueeze(0) + return {'waveform': audio, 'sample_rate': ar} + +class LazyAudioMap(Mapping): + def __init__(self, file, start_time, duration): + self.file = file + self.start_time=start_time + self.duration=duration + self._dict=None + def __getitem__(self, key): + if self._dict is None: + self._dict = get_audio(self.file, self.start_time, self.duration) + return self._dict[key] + def __iter__(self): + if self._dict is None: + self._dict = get_audio(self.file, self.start_time, self.duration) + return iter(self._dict) + def __len__(self): + if self._dict is None: + self._dict = get_audio(self.file, self.start_time, self.duration) + return len(self._dict) +def lazy_get_audio(file, start_time=0, duration=0, **kwargs): + return LazyAudioMap(file, start_time, duration) + +def is_url(url): + return url.split("://")[0] in ["http", "https"] + +def validate_sequence(path): + #Check if path is a valid ffmpeg sequence that points to at least one file + (path, file) = os.path.split(path) + if not os.path.isdir(path): + return False + match = re.search('%0?\\d+d', file) + if not match: + return False + seq = match.group() + if seq == '%d': + seq = '\\\\d+' + else: + seq = '\\\\d{%s}' % seq[1:-1] + file_matcher = re.compile(re.sub('%0?\\d+d', seq, file)) + for file in os.listdir(path): + if file_matcher.fullmatch(file): + return True + return False + +def strip_path(path): + #This leaves whitespace inside quotes and only a single " + #thus ' ""test"' -> '"test' + #consider path.strip(string.whitespace+"\"") + #or weightier re.fullmatch("[\\s\"]*(.+?)[\\s\"]*", path).group(1) + path = path.strip() + if path.startswith("\""): + path = path[1:] + if path.endswith("\""): + path = path[:-1] + return path +def hash_path(path): + if path is None: + return "input" + if is_url(path): + return "url" + if not os.path.isfile(path): + return "DNE" + return calculate_file_hash(strip_path(path)) + + +def validate_path(path, allow_none=False, allow_url=True): + if path is None: + return allow_none + if is_url(path): + #Probably not feasible to check if url resolves here + if not allow_url: + return "URLs are unsupported for this path" + return is_safe_path(path) + if not os.path.isfile(strip_path(path)): + return "Invalid file path: {}".format(path) + return is_safe_path(path) + + +def validate_index(index: int, length: int=0, is_range: bool=False, allow_negative=False, allow_missing=False) -> int: + # if part of range, do nothing + if is_range: + return index + # otherwise, validate index + # validate not out of range - only when latent_count is passed in + if length > 0 and index > length-1 and not allow_missing: + raise IndexError(f"Index '{index}' out of range for {length} item(s).") + # if negative, validate not out of range + if index < 0: + if not allow_negative: + raise IndexError(f"Negative indeces not allowed, but was '{index}'.") + conv_index = length+index + if conv_index < 0 and not allow_missing: + raise IndexError(f"Index '{index}', converted to '{conv_index}' out of range for {length} item(s).") + index = conv_index + return index + + +def convert_to_index_int(raw_index: str, length: int=0, is_range: bool=False, allow_negative=False, allow_missing=False) -> int: + try: + return validate_index(int(raw_index), length=length, is_range=is_range, allow_negative=allow_negative, allow_missing=allow_missing) + except ValueError as e: + raise ValueError(f"Index '{raw_index}' must be an integer.", e) + + +def convert_str_to_indexes(indexes_str: str, length: int=0, allow_missing=False) -> list[int]: + if not indexes_str: + return [] + int_indexes = list(range(0, length)) + allow_negative = length > 0 + chosen_indexes = [] + # parse string - allow positive ints, negative ints, and ranges separated by ':' + groups = indexes_str.split(",") + groups = [g.strip() for g in groups] + for g in groups: + # parse range of indeces (e.g. 2:16) + if ':' in g: + index_range = g.split(":", 2) + index_range = [r.strip() for r in index_range] + + start_index = index_range[0] + if len(start_index) > 0: + start_index = convert_to_index_int(start_index, length=length, is_range=True, allow_negative=allow_negative, allow_missing=allow_missing) + else: + start_index = 0 + end_index = index_range[1] + if len(end_index) > 0: + end_index = convert_to_index_int(end_index, length=length, is_range=True, allow_negative=allow_negative, allow_missing=allow_missing) + else: + end_index = length + # support step as well, to allow things like reversing, every-other, etc. + step = 1 + if len(index_range) > 2: + step = index_range[2] + if len(step) > 0: + step = convert_to_index_int(step, length=length, is_range=True, allow_negative=True, allow_missing=True) + else: + step = 1 + # if latents were passed in, base indeces on known latent count + if len(int_indexes) > 0: + chosen_indexes.extend(int_indexes[start_index:end_index][::step]) + # otherwise, assume indeces are valid + else: + chosen_indexes.extend(list(range(start_index, end_index, step))) + # parse individual indeces + else: + chosen_indexes.append(convert_to_index_int(g, length=length, allow_negative=allow_negative, allow_missing=allow_missing)) + return chosen_indexes + + +def select_indexes(input_obj: Union[Tensor, list], idxs: list): + if type(input_obj) == Tensor: + return input_obj[idxs] + else: + return [input_obj[i] for i in idxs] + +def merge_filter_args(args, ftype="-vf"): + #TODO This doesn't account for filter_complex + #Will likely need to convert all filters to filter complex in the future + #But that requires source/output deduplication + try: + start_index = args.index(ftype)+1 + index = start_index + while True: + index = args.index(ftype, index) + args[start_index] += ',' + args[index+1] + args.pop(index) + args.pop(index) + except ValueError: + pass + +def select_indexes_from_str(input_obj: Union[Tensor, list], indexes: str, err_if_missing=True, err_if_empty=True): + real_idxs = convert_str_to_indexes(indexes, len(input_obj), allow_missing=not err_if_missing) + if err_if_empty and len(real_idxs) == 0: + raise Exception(f"Nothing was selected based on indexes found in '{indexes}'.") + return select_indexes(input_obj, real_idxs) + +def hook(obj, attr): + def dec(f): + f = functools.update_wrapper(f, getattr(obj,attr)) + setattr(obj,attr,f) + return f + return dec + +def cached(duration): + def dec(f): + cached_ret = None + cache_time = 0 + def cached_func(): + nonlocal cache_time, cached_ret + if time.time() > cache_time + duration or cached_ret is None: + cache_time = time.time() + cached_ret = f() + return cached_ret + return cached_func + return dec diff --git a/docs/hel-892/scail-load-reference/web__js__VHS.core.js b/docs/hel-892/scail-load-reference/web__js__VHS.core.js new file mode 100644 index 00000000..e9026e46 --- /dev/null +++ b/docs/hel-892/scail-load-reference/web__js__VHS.core.js @@ -0,0 +1,2463 @@ +import { app } from '../../../scripts/app.js' +import { api } from '../../../scripts/api.js' +import { setWidgetConfig } from '../../../extensions/core/widgetInputs.js' +import { applyTextReplacements } from "../../../scripts/utils.js"; + +function chainCallback(object, property, callback) { + if (object == undefined) { + //This should not happen. + console.error("Tried to add callback to non-existant object") + return; + } + if (property in object && object[property]) { + const callback_orig = object[property] + object[property] = function () { + const r = callback_orig.apply(this, arguments); + return callback.apply(this, arguments) ?? r + }; + } else { + object[property] = callback; + } +} + +function getNodeById(id, graph=app.graph) { + let cg = graph + let node = undefined + for (let sid of (''+id).split(':')) { + node = cg?.getNodeById?.(sid) + cg = node?.subgraph + } + return node +} + +const convDict = { + VHS_LoadImages : ["directory", null, "image_load_cap", "skip_first_images", "select_every_nth"], + VHS_LoadImagesPath : ["directory", "image_load_cap", "skip_first_images", "select_every_nth"], + VHS_VideoCombine : ["frame_rate", "loop_count", "filename_prefix", "format", "pingpong", "save_image"], + VHS_LoadVideo : ["video", "force_rate", "force_size", "frame_load_cap", "skip_first_frames", "select_every_nth"], + VHS_LoadVideoPath : ["video", "force_rate", "force_size", "frame_load_cap", "skip_first_frames", "select_every_nth"], +}; +const renameDict = {VHS_VideoCombine : {save_output : "save_image"}} +function useKVState(nodeType) { + chainCallback(nodeType.prototype, "onNodeCreated", function () { + chainCallback(this, "onConfigure", function(info) { + if (!this.widgets) { + //Node has no widgets, there is nothing to restore + return + } + if (typeof(info.widgets_values) != "object") { + //widgets_values is in some unknown inactionable format + return + } + let widgetDict = info.widgets_values + if (info.widgets_values.length) { + //widgets_values is in the old list format + if (this.type in convDict) { + //widget does not have a conversion format provided + let convList = convDict[this.type]; + if(info.widgets_values.length >= convList.length) { + //has all required fields + widgetDict = {} + for (let i = 0; i < convList.length; i++) { + if(!convList[i]) { + //Element should not be processed (upload button on load image sequence) + continue + } + widgetDict[convList[i]] = info.widgets_values[i]; + } + } else { + //widgets_values is missing elements marked as required + //let it fall through to failure state + } + } + } + if ('force_size' in widgetDict) { + //force size has been phased out, Migrate state + if (widgetDict.force_size.includes?.('x')) { + let sizes = widgetDict.force_size.split('x') + if (sizes[0] != '?') { + widgetDict.custom_width = parseInt(sizes[0]) + } else { + widgetDict.custom_width = 0 + } + if (sizes[1] != '?') { + widgetDict.custom_height = parseInt(sizes[1]) + } else { + widgetDict.custom_height = 0 + } + } else { + if (['Disabled', 'Custom Height'].includes(widgetDict.force_size)) { + widgetDict.custom_width = 0 + } + if (['Disabled', 'Custom Width'].includes(widgetDict.force_size)) { + widgetDict.custom_height = 0 + } + } + } + if (widgetDict.videopreview?.params?.force_size) { + delete widgetDict.videopreview.params.force_size + } + let inputs = {} + for (let i of this.inputs) { + inputs[i.name] = i + } + if (widgetDict.length == undefined) { + for (let w of this.widgets) { + if (w.type =="button") { + continue + } + if (w.name in widgetDict) { + w.value = widgetDict[w.name]; + w.callback?.(w.value) + } else { + //Check for a legacy name that needs migrating + if (this.type in renameDict && w.name in renameDict[this.type]) { + if (renameDict[this.type][w.name] in widgetDict) { + w.value = widgetDict[renameDict[this.type][w.name]] + w.callback?.(w.value) + continue + } + } + //attempt to restore default value + let inputs = LiteGraph.getNodeType(this.type).nodeData.input; + let initialValue = null; + if (inputs?.required?.hasOwnProperty(w.name)) { + if (inputs.required[w.name][1]?.hasOwnProperty("default")) { + initialValue = inputs.required[w.name][1].default; + } else if (inputs.required[w.name][0].length) { + initialValue = inputs.required[w.name][0][0]; + } + } else if (inputs?.optional?.hasOwnProperty(w.name)) { + if (inputs.optional[w.name][1]?.hasOwnProperty("default")) { + initialValue = inputs.optional[w.name][1].default; + } else if (inputs.optional[w.name][0].length) { + initialValue = inputs.optional[w.name][0][0]; + } + } + if (initialValue) { + w.value = initialValue; + w.callback?.(w.value) + } + } + if (w.name in inputs && w.config) { + setWidgetConfig(inputs[w.name], w.config) + } + } + } else { + //Saved data was not a map made by this method + //and a conversion dict for it does not exist + //It's likely an array and that has been blindly applied + if (info?.widgets_values?.length != this.widgets.length) { + //Widget could not have restored properly + //Note if multiple node loads fail, only the latest error dialog displays + app.ui.dialog.show("Failed to restore node: " + this.title + "\nPlease remove and re-add it.") + this.bgcolor = "#C00" + } + } + }); + chainCallback(this, "onSerialize", function(info) { + info.widgets_values = {}; + if (!this.widgets) { + //object has no widgets, there is nothing to store + return; + } + for (let w of this.widgets) { + info.widgets_values[w.name] = w.value; + } + }); + }) +} +var helpDOM; +if (!app.helpDOM) { + helpDOM = document.createElement("div"); + app.VHSHelp = helpDOM +} +function initHelpDOM() { + let parentDOM = document.createElement("div"); + parentDOM.className = "VHS_floatinghelp" + document.body.appendChild(parentDOM) + parentDOM.appendChild(helpDOM) + helpDOM.className = "litegraph"; + let scrollbarStyle = document.createElement('style'); + scrollbarStyle.innerHTML = ` + .VHS_floatinghelp { + scrollbar-width: 6px; + scrollbar-color: #0003 #0000; + &::-webkit-scrollbar { + background: transparent; + width: 6px; + } + &::-webkit-scrollbar-thumb { + background: #0005; + border-radius: 20px + } + &::-webkit-scrollbar-button { + display: none; + } + } + .VHS_loopedvideo::-webkit-media-controls-mute-button { + display:none; + } + .VHS_loopedvideo::-webkit-media-controls-fullscreen-button { + display:none; + } + ` + scrollbarStyle.id = 'scroll-properties' + parentDOM.appendChild(scrollbarStyle) + chainCallback(app.canvas, "onDrawForeground", function (ctx, visible_rect){ + let n = helpDOM.node + if (!n || !n?.graph) { + parentDOM.style['left'] = '-5000px' + return + } + //draw : function(ctx, node, widgetWidth, widgetY, height) { + //update widget position, even if off screen + const transform = ctx.getTransform(); + const scale = app.canvas.ds.scale;//gets the litegraph zoom + //calculate coordinates with account for browser zoom + const bcr = app.canvas.canvas.getBoundingClientRect() + const x = transform.e*scale/transform.a + bcr.x; + const y = transform.f*scale/transform.a + bcr.y; + //TODO: text reflows at low zoom. investigate alternatives + Object.assign(parentDOM.style, { + left: (x+(n.pos[0] + n.size[0]+15)*scale) + "px", + top: (y+(n.pos[1]-LiteGraph.NODE_TITLE_HEIGHT)*scale) + "px", + width: "400px", + minHeight: "100px", + maxHeight: "600px", + overflowY: 'scroll', + transformOrigin: '0 0', + transform: 'scale(' + scale + ',' + scale +')', + fontSize: '18px', + backgroundColor: LiteGraph.NODE_DEFAULT_BGCOLOR, + boxShadow: '0 0 10px black', + borderRadius: '4px', + padding: '3px', + zIndex: 3, + position: "absolute", + display: 'inline', + }); + }); + function setCollapse(el, doCollapse) { + if (doCollapse) { + el.children[0].children[0].innerHTML = '+' + Object.assign(el.children[1].style, { + color: '#CCC', + overflowX: 'hidden', + width: '0px', + minWidth: 'calc(100% - 20px)', + textOverflow: 'ellipsis', + whiteSpace: 'nowrap', + }) + for (let child of el.children[1].children) { + if (child.style.display != 'none'){ + child.origDisplay = child.style.display + } + child.style.display = 'none' + } + } else { + el.children[0].children[0].innerHTML = '-' + Object.assign(el.children[1].style, { + color: '', + overflowX: '', + width: '100%', + minWidth: '', + textOverflow: '', + whiteSpace: '', + }) + for (let child of el.children[1].children) { + child.style.display = child.origDisplay + } + } + } + helpDOM.collapseOnClick = function() { + let doCollapse = this.children[0].innerHTML == '-' + setCollapse(this.parentElement, doCollapse) + } + helpDOM.selectHelp = function(name, value) { + //attempt to navigate to name in help + function collapseUnlessMatch(items,t) { + var match = items.querySelector('[vhs_title="' + t + '"]') + if (!match) { + for (let i of items.children) { + if (i.innerHTML.slice(0,t.length+5).includes(t)) { + match = i + break + } + } + } + if (!match) { + return null + } + //For longer documentation items with fewer collapsable elements, + //scroll to make sure the entirety of the selected item is visible + //This has the unfortunate side effect of trying to scroll the main + //window if the documentation windows is forcibly offscreen, + //but it's easy to simply scroll the main window back and seems to + //have no visual side effects + match.scrollIntoView(false) + window.scrollTo(0,0) + for (let i of items.querySelectorAll('.VHS_collapse')) { + if (i.contains(match)) { + setCollapse(i, false) + } else { + setCollapse(i, true) + } + } + return match + } + let target = collapseUnlessMatch(helpDOM, name) + if (target && value) { + collapseUnlessMatch(target, value) + } + } + let titleContext = document.createElement("canvas").getContext("2d") + titleContext.font = app.canvas.title_text_font; + helpDOM.calculateTitleLength = function(text) { + return titleContext.measureText(text).width + } + helpDOM.addHelp = function(node, nodeType, description) { + if (!description) { + return + } + //Pad computed size for the clickable question mark + let originalComputeSize = node.computeSize + node.computeSize = function() { + let size = originalComputeSize.apply(this, arguments) + if (!this.title) { + return size + } + let title_width = helpDOM.calculateTitleLength(this.title) + size[0] = Math.max(size[0], title_width + LiteGraph.NODE_TITLE_HEIGHT*2) + return size + } + + node.description = description + chainCallback(node, "onDrawForeground", function (ctx) { + if (this?.flags?.collapsed) { + return + } + //draw question mark + ctx.save() + ctx.font = 'bold 20px Arial' + ctx.fillText("?", this.size[0]-17, -8) + ctx.restore() + }) + chainCallback(node, "onMouseDown", function (e, pos, canvas) { + if (this?.flags?.collapsed) { + return + } + //On click would be preferred, but this'll be good enough + if (pos[1] < 0 && pos[0] + LiteGraph.NODE_TITLE_HEIGHT > this.size[0]) { + //corner question mark clicked + if (helpDOM.node == this) { + helpDOM.node = undefined + } else { + helpDOM.node = this; + helpDOM.innerHTML = this.description || "no help provided " + for (let e of helpDOM.querySelectorAll('.VHS_collapse')) { + e.children[0].onclick = helpDOM.collapseOnClick + e.children[0].style.cursor = 'pointer' + } + for (let e of helpDOM.querySelectorAll('.VHS_precollapse')) { + setCollapse(e, true) + } + for (let e of helpDOM.querySelectorAll('.VHS_loopedvideo')) { + e?.play() + } + helpDOM.parentElement.scrollTo(0,0) + } + return true + } + }) + let timeout = null + chainCallback(node, "onMouseMove", function (e, pos, canvas) { + if (timeout) { + clearTimeout(timeout) + timeout = null + } + if (helpDOM.node != this) { + return + } + timeout = setTimeout(() => { + let n = this + if (pos[0] > 0 && pos[0] < n.size[0] + && pos[1] > 0 && pos[1] < n.size[1]) { + //TODO: provide help specific to element clicked + let inputRows = Math.max(n.inputs?.length || 0, n.outputs?.length || 0) + if (pos[1] < LiteGraph.NODE_SLOT_HEIGHT * inputRows) { + let row = Math.floor((pos[1] - 7) / LiteGraph.NODE_SLOT_HEIGHT) + if (pos[0] < n.size[0]/2) { + if (row < n.inputs.length) { + helpDOM.selectHelp(n.inputs[row].name) + } + } else { + if (row < n.outputs.length) { + helpDOM.selectHelp(n.outputs[row].name) + } + } + } else { + //probably widget, but widgets have variable height. + let basey = LiteGraph.NODE_SLOT_HEIGHT * inputRows + 6 + for (let w of n.widgets) { + if (w.y) { + basey = w.y + } + let wheight = LiteGraph.NODE_WIDGET_HEIGHT+4 + if (w.computeSize) { + wheight = w.computeSize(n.size[0])[1] + } + if (pos[1] < basey + wheight) { + helpDOM.selectHelp(w.name, w.value) + break + } + basey += wheight + } + } + } + }, 500) + }) + chainCallback(node, "onMouseLeave", function (e, pos, canvas) { + if (timeout) { + clearTimeout(timeout) + timeout = null + } + }); + } +} + +function fitHeight(node) { + node.setSize([node.size[0], node.computeSize([node.size[0], node.size[1]])[1]]) + node?.graph?.setDirtyCanvas(true); +} +function startDraggingItems(node, pointer) { + app.canvas.emitBeforeChange() + app.canvas.graph?.beforeChange() + // Ensure that dragging is properly cleaned up, on success or failure. + pointer.finally = () => { + app.canvas.isDragging = false + app.canvas.graph?.afterChange() + app.canvas.emitAfterChange() + } + app.canvas.processSelect(node, pointer.eDown, true) + app.canvas.isDragging = true +} +function processDraggedItems(e) { + if (e.shiftKey || LiteGraph.alwaysSnapToGrid) + app.graph?.snapToGrid(app.canvas.selectedItems) + app.canvas.dirty_canvas = true + app.canvas.dirty_bgcanvas = true + app.canvas.onNodeMoved?.(findFirstNode(app.canvas.selectedItems)) +} +function allowDragFromWidget(widget) { + widget.onPointerDown = function(pointer, node) { + pointer.onDragStart = () => startDraggingItems(node, pointer) + pointer.onDragEnd = processDraggedItems + app.canvas.dirty_canvas = true + return true + } +} + +async function uploadFile(file, progressCallback) { + try { + // Wrap file in formdata so it includes filename + const body = new FormData(); + const i = file.webkitRelativePath.lastIndexOf('/'); + const subfolder = file.webkitRelativePath.slice(0,i+1) + const new_file = new File([file], file.name, { + type: file.type, + lastModified: file.lastModified, + }); + body.append("image", new_file); + if (i > 0) { + body.append("subfolder", subfolder); + } + const url = api.apiURL("/upload/image") + const resp = await new Promise((resolve) => { + let req = new XMLHttpRequest() + req.upload.onprogress = (e) => progressCallback?.(e.loaded/e.total) + req.onload = () => resolve(req) + req.open('post', url, true) + req.send(body) + }) + + if (resp.status !== 200) { + alert(resp.status + " - " + resp.statusText); + } + return resp + } catch (error) { + alert(error); + } +} +function applyVHSAudioLinksFix(nodeType, nodeData, audio_slot) { + chainCallback(nodeType.prototype, "onConnectionsChange", function(contype, slot, iscon, linfo) { + if (contype == LiteGraph.OUTPUT && slot == audio_slot) { + if (linfo?.type == "VHS_AUDIO") { + this.outputs[audio_slot].type = "AUDIO" + let tnode = app.graph._nodes_by_id[linfo.target_id] + let inputDef = LiteGraph.registered_node_types[tnode.type]?.nodeData?.input + let has_migrated = true + if (inputDef?.required) { + for (let k in inputDef.required) { + if (inputDef.required[k][0] == "VHS_AUDIO") { + has_migrated = false + break + } + } + } + if (has_migrated &&inputDef?.optional) { + for (let k in inputDef.optional) { + if (inputDef.optional[k][0] == "VHS_AUDIO") { + has_migrated = false + break + } + } + } + if (!has_migrated) { + //need to add node and migrate + app.ui.dialog.show("This workflow contains one or more nodes which use the old VHS_AUDIO format. They have been highlighted in red. An AudioToVHSAudio node must be added to convert to this legacy format") + tnode.bgcolor = "#C00" + } + } + } + }) +} +function addVAEOutputToggle(nodeType, nodeData) { + chainCallback(nodeType.prototype, "onNodeCreated", function() { + this.reject_ue_connection = (input) => input?.name == "vae" + }) + chainCallback(nodeType.prototype, "onConnectionsChange", function(contype, slot, iscon, linfo) { + let slotType = this.inputs[slot]?.type + if (contype == LiteGraph.INPUT && slotType == "VAE") { + if (iscon && linfo) { + if (this.linkTimeout) { + clearTimeout(this.linkTimeout) + this.linkTimeout = false + } else if (this.outputs[0].type == "IMAGE") { + this.linkTimeout = setTimeout(() => { + if (this.outputs[0].type != "IMAGE") { + return + } + this.linkTimeout = false + this.disconnectOutput(0); + }, 50) + } + this.outputs[0].name = 'LATENT'; + this.outputs[0].type = 'LATENT'; + } else{ + if (this.outputs[0].type == "LATENT") { + this.linkTimeout = setTimeout(() => { + this.linkTimeout = false + this.disconnectOutput(0); + }, 50) + } + this.outputs[0].name = "IMAGE"; + this.outputs[0].type = "IMAGE"; + } + } + }); +} +function addVAEInputToggle(nodeType, nodeData) { + chainCallback(nodeType.prototype, "onNodeCreated", function() { + this.reject_ue_connection = (input) => input?.name == "vae" + }) + chainCallback(nodeType.prototype, "onConnectionsChange", function(contype, slot, iscon, linf) { + if (contype == LiteGraph.INPUT && slot == 3 && this.inputs[3].type == "VAE") { + if (iscon && linf) { + if (this.linkTimeout) { + clearTimeout(this.linkTimeout) + this.linkTimeout = false + } else if (this.inputs[0].type == "IMAGE") { + this.linkTimeout = setTimeout(() => { + //workaround for out of order loading + if (this.inputs[0].type != "IMAGE") { + return + } + this.linkTimeout = false + this.disconnectInput(0); + }, 50) + } + this.inputs[0].type = 'LATENT'; + } else { + if (this.inputs[0].type == "LATENT") { + this.linkTimeout = setTimeout(() => { + this.linkTimeout = false + this.disconnectInput(0); + }, 50) + } + this.inputs[0].type = "IMAGE"; + } + } + }); +} +function cloneType(nodeType, nodeData) { + chainCallback(nodeType.prototype, "onNodeCreated", function() { + this.changeOutputType = function (new_type) { + this.linkTimeout = setTimeout(() => { + this.linkTimeout = false + if (this.outputs[0].type != new_type) { + this.outputs[0].type = new_type + //check and potentially remove links + if (!this.outputs[0].links) { + return + } + let removed_links = [] + for (let link_id of this.outputs[0].links) { + let link = app.graph.links[link_id] + if (!link) + debugger + let target_node = app.graph.getNodeById(link.target_id) + let target_input = target_node.inputs[link.target_slot] + let keep = LiteGraph.isValidConnection(new_type, target_input.type) + if (!keep) { + link.disconnect(app.graph, 'input') + removed_links.push(link_id) + } + target_node.onConnectionsChange?.(LiteGraph.INPUT, + link.target_slot, keep, link, target_input) + } + this.outputs[0].links = this.outputs[0].links + .filter((v) => !removed_links.includes(v)) + } + }, 50) + } + this.changeOutputType("VHS_DUMMY_NONE") + }); + chainCallback(nodeType.prototype, "onConnectionsChange", function(contype, slot, iscon, linf) { + if (contype == LiteGraph.INPUT && slot == 0) { + let new_type = "VHS_DUMMY_NONE" + if (iscon && linf) { + new_type = app.graph.getNodeById(linf.origin_id).outputs[linf.origin_slot].type + } + if (this.linkTimeout) { + clearTimeout(this.linkTimeout) + } + this.changeOutputType(new_type) + } + }); +} + +function addDateFormatting(nodeType, field, timestamp_widget = false) { + chainCallback(nodeType.prototype, "onNodeCreated", function() { + const widget = this.widgets.find((w) => w.name === field); + widget.serializeValue = () => { + return applyTextReplacements(app, widget.value); + }; + }); +} +function addTimestampWidget(nodeType, nodeData, targetWidget) { + const newWidgets = {}; + for (let key in nodeData.input.required) { + if (key == targetWidget) { + //TODO: account for duplicate entries? + newWidgets["timestamp_directory"] = ["BOOLEAN", {"default": true}] + } + newWidgets[key] = nodeData.input.required[key]; + } + nodeDta.input.required = newWidgets; + chainCallback(nodeType.prototype, "onNodeCreated", function () { + const directoryWidget = this.widgets.find((w) => w.name === "directory_name"); + const timestampWidget = this.widgets.find((w) => w.name === "timestamp_directory"); + directoryWidget.serializeValue = () => { + if (timestampWidget.value) { + //ignore actual value and return timestamp + return formatDate("yyyy-MM-ddThh:mm:ss", new Date()); + } + return directoryWidget.value + }; + timestampWidget._value = value; + Object.definteProperty(timestampWidget, "value", { + set : function(value) { + this._value = value; + directoryWidget.disabled = value; + }, + get : function() { + return this._value; + } + }); + }); +} +function initializeLoadFormat(nodeType, nodeData) { + if (!nodeData?.input?.optional?.format) { + return + } + chainCallback(nodeType.prototype, "onNodeCreated", function() { + let node = this + let formatWidget = this.widgets.find((w) => w.name === "format") + formatWidget.options.formats = nodeData.input.optional.format[1].formats + let base = {} + for (let widget of this.widgets) { + if (['force_rate', 'custom_width', 'custom_height', + 'frame_load_cap'].includes(widget.name)) { + //TODO: filter these options? + base[widget.name] = widget.options + } + } + chainCallback(formatWidget, "callback", function(value) { + let format = this.options.formats[value] + if (!format) { + return + } + if ('target_rate' in format) { + format.force_rate = {'reset': format.target_rate} + } + if ('dim' in format) { + format.custom_width = {'step': format.dim[0], 'mod': format.dim[1]} + format.custom_height = {'step': format.dim[0], 'mod': format.dim[1]} + if (format.dim[2]) { + format.custom_width.reset = format.dim[2] + } + if (format.dim[3]) { + format.custom_height.reset = format.dim[3] + } + } + if ('frames' in format) { + format.frame_load_cap = {'step': format.frames[0], 'mod': format.frames[1]} + } + for (let widget of node.widgets) { + if (widget.name in base) { + let wasDefault = widget.options?.reset == widget.value + widget.options = Object.assign({}, base[widget.name], format[widget.name]) + if (wasDefault && widget.options.reset != undefined) { + widget.value = widget.options.reset + } + widget.callback(widget.value) + } + } + + }); + let capWidget = this.widgets.find((w) => w.name === "frame_load_cap") + capWidget.annotation = (value, width) => { + let max_frames = this.video_query?.loaded?.frames + if (!max_frames || value && value < max_frames) { + return + } + let format = formatWidget.options.formats[formatWidget.value] + const div = format?.frames?.[0] ?? 1 + const mod = format?.frames?.[1] ?? 0 + let loadable_frames = max_frames + if ((max_frames % div) != mod) { + loadable_frames = ((max_frames - mod)/div|0) * div + mod + } + return loadable_frames + "\u21FD" + } + let rateWidget = this.widgets.find((w) => w.name === "force_rate") + rateWidget.annotation = (value, width) => { + if (value == 0 && this.video_query?.source?.fps != undefined) { + return roundToPrecision(this.video_query.source.fps, 2) + "\u21FD" + } + } + }); +} + +function addUploadWidget(nodeType, nodeData, widgetName, type="video") { + let accept = {'video': ["video/webm","video/mp4","video/x-matroska","image/gif"], + 'audio': ["audio/mpeg","audio/wav","audio/x-wav","audio/ogg"]} + chainCallback(nodeType.prototype, "onNodeCreated", function() { + const node = this + const pathWidget = this.widgets.find((w) => w.name === widgetName); + const fileInput = document.createElement("input"); + chainCallback(this, "onRemoved", () => { + fileInput?.remove(); + }); + if (type == "folder") { + Object.assign(fileInput, { + type: "file", + style: "display: none", + webkitdirectory: true, + onchange: async () => { + const directory = fileInput.files[0].webkitRelativePath; + const i = directory.lastIndexOf('/'); + if (i <= 0) { + throw "No directory found"; + } + const path = directory.slice(0,directory.lastIndexOf('/')) + if (pathWidget.options.values.includes(path)) { + alert("A folder of the same name already exists"); + return; + } + let successes = 0; + const onProg = (p) => this.progress = (successes + p) / fileInput.files.length + for(const file of fileInput.files) { + if ((await uploadFile(file, onProg)).status == 200) { + successes++; + } else { + this.progress = undefined + //Upload failed, but some prior uploads may have succeeded + //Stop future uploads to prevent cascading failures + //and only add to list if an upload has succeeded + if (successes > 0) { + break + } else { + return; + } + } + } + this.progress = undefined + pathWidget.options.values.push(path); + pathWidget.value = path; + if (pathWidget.callback) { + pathWidget.callback(path) + } + }, + }); + } else { + let accept = {'video': ["video/webm","video/mp4","video/x-matroska","image/gif"], + 'audio': ["audio/mpeg","audio/wav","audio/x-wav","audio/ogg"]}[type] + async function doUpload(file) { + let resp = await uploadFile(file, (p) => node.progress = p) + node.progress = undefined + if (resp.status != 200) { + return false + } + const filename = JSON.parse(resp.responseText).name; + pathWidget.options.values.push(filename); + pathWidget.value = filename; + if (pathWidget.callback) { + pathWidget.callback(filename) + } + return true + } + Object.assign(fileInput, { + type: "file", + accept: accept.join(','), + style: "display: none", + onchange: async () => { + if (fileInput.files.length) { + return await doUpload(fileInput.files[0]) + } + }, + }); + this.onDragOver = (e) => !!e?.dataTransfer?.types?.includes?.('Files') + this.onDragDrop = async function(e) { + if (!e?.dataTransfer?.types?.includes?.('Files')) { + return false + } + //TODO: Allow dragging multiple files at once? + const item = e.dataTransfer?.files?.[0] + if (accept.includes(item?.type)) { + return await doUpload(item) + } + return false + } + } + document.body.append(fileInput); + let uploadWidget = this.addWidget("button", "choose " + type + " to upload", "image", () => { + //clear the active click event + app.canvas.node_widget = null + + fileInput.click(); + }); + uploadWidget.options.serialize = false; + + + }); +} + +function addVideoPreview(nodeType, isInput=true) { + chainCallback(nodeType.prototype, "onNodeCreated", function() { + var element = document.createElement("div"); + const previewNode = this; + var previewWidget = this.addDOMWidget("videopreview", "preview", element, { + serialize: false, + hideOnZoom: false, + getValue() { + return element.value; + }, + setValue(v) { + element.value = v; + }, + }); + allowDragFromWidget(previewWidget) + previewWidget.computeSize = function(width) { + if (this.aspectRatio && !this.parentEl.hidden) { + let height = (previewNode.size[0]-20)/ this.aspectRatio + 10; + if (!(height > 0)) { + height = 0; + } + this.computedHeight = height + 10; + return [width, height]; + } + return [width, -4];//no loaded src, widget should not display + } + element.addEventListener('contextmenu', (e) => { + e.preventDefault() + return app.canvas._mousedown_callback(e) + }, true); + element.addEventListener('pointerdown', (e) => { + e.preventDefault() + return app.canvas._mousedown_callback(e) + }, true); + element.addEventListener('mousewheel', (e) => { + e.preventDefault() + return app.canvas._mousewheel_callback(e) + }, true); + element.addEventListener('pointermove', (e) => { + e.preventDefault() + return app.canvas._mousemove_callback(e) + }, true); + element.addEventListener('pointerup', (e) => { + e.preventDefault() + return app.canvas._mouseup_callback(e) + }, true); + element.addEventListener('dragover', (e) => { + //A little hacky, but allows drag events onto the preview itself + e.preventDefault(); + e.dataTransfer.dropEffect = "copy"; + app.dragOverNode = this + }) + previewWidget.value = {hidden: false, paused: false, params: {}, + muted: app.ui.settings.getSettingValue("VHS.DefaultMute")} + previewWidget.parentEl = document.createElement("div"); + previewWidget.parentEl.className = "vhs_preview"; + previewWidget.parentEl.style['width'] = "100%" + element.appendChild(previewWidget.parentEl); + previewWidget.videoEl = document.createElement("video"); + previewWidget.videoEl.controls = false; + previewWidget.videoEl.loop = true; + previewWidget.videoEl.muted = true; + previewWidget.videoEl.style['width'] = "100%" + previewWidget.videoEl.addEventListener("loadedmetadata", () => { + + previewWidget.aspectRatio = previewWidget.videoEl.videoWidth / previewWidget.videoEl.videoHeight; + fitHeight(this); + }); + previewWidget.videoEl.addEventListener("error", () => { + //TODO: consider a way to properly notify the user why a preview isn't shown. + previewWidget.parentEl.hidden = true; + fitHeight(this); + }); + previewWidget.videoEl.onmouseenter = () => { + previewWidget.videoEl.muted = previewWidget.value.muted + }; + previewWidget.videoEl.onmouseleave = () => { + previewWidget.videoEl.muted = true; + }; + + previewWidget.imgEl = document.createElement("img"); + previewWidget.imgEl.style['width'] = "100%" + previewWidget.imgEl.hidden = true; + previewWidget.imgEl.onload = () => { + previewWidget.aspectRatio = previewWidget.imgEl.naturalWidth / previewWidget.imgEl.naturalHeight; + fitHeight(this); + }; + previewWidget.parentEl.appendChild(previewWidget.videoEl) + previewWidget.parentEl.appendChild(previewWidget.imgEl) + var timeout = null; + this.updateParameters = (params, force_update) => { + if (!previewWidget.value.params) { + if(typeof(previewWidget.value) != 'object') { + previewWidget.value = {hidden: false, paused: false} + } + previewWidget.value.params = {} + } + Object.assign(previewWidget.value.params, params) + if (!force_update && + app.ui.settings.getSettingValue("VHS.AdvancedPreviews") == 'Never') { + return; + } + if (timeout) { + clearTimeout(timeout); + } + if (force_update) { + previewWidget.updateSource(); + } else { + timeout = setTimeout(() => previewWidget.updateSource(),100); + } + }; + previewWidget.updateSource = function () { + if (this.value.params == undefined) { + return; + } + let params = {} + let advp = app.ui.settings.getSettingValue("VHS.AdvancedPreviews") + if (advp == 'Never') { + advp = false + } else if (advp == 'Input Only') { + advp = isInput + } else { + advp = true + } + Object.assign(params, this.value.params);//shallow copy + params.timestamp = Date.now() + this.parentEl.hidden = this.value.hidden; + if (params.format?.split('/')[0] == 'video' + || advp && (params.format?.split('/')[1] == 'gif') + || params.format == 'folder') { + + this.videoEl.autoplay = !this.value.paused && !this.value.hidden; + if (!advp) { + this.videoEl.src = api.apiURL('/view?' + new URLSearchParams(params)); + } else { + let target_width = (previewNode.size[0]-20)*2 || 256; + let minWidth = app.ui.settings.getSettingValue("VHS.AdvancedPreviewsMinWidth") + if (target_width < minWidth) { + target_width = minWidth + } + if (!params.custom_width || !params.custom_height) { + params.force_size = target_width+"x?" + } else { + let ar = params.custom_width/params.custom_height + params.force_size = target_width+"x"+(target_width/ar) + } + params.deadline = app.ui.settings.getSettingValue("VHS.AdvancedPreviewsDeadline") + this.videoEl.src = api.apiURL('/vhs/viewvideo?' + new URLSearchParams(params)); + } + this.videoEl.hidden = false; + this.imgEl.hidden = true; + } else if (params.format?.split('/')[0] == 'image'){ + //Is animated image + this.imgEl.src = api.apiURL('/view?' + new URLSearchParams(params)); + this.videoEl.hidden = true; + this.imgEl.hidden = false; + } + delete previewNode.video_query + const doQuery = async () => { + if (!previewWidget?.value?.params?.filename) { + return + } + let qurl = api.apiURL('/vhs/queryvideo?' + new URLSearchParams(previewWidget.value.params)) + let query = undefined + try { + let query_res = await fetch(qurl) + query = await query_res.json() + } catch(e) { + return + } + previewNode.video_query = query + } + doQuery() + } + previewWidget.callback = previewWidget.updateSource + previewWidget.parentEl.appendChild(previewWidget.videoEl) + previewWidget.parentEl.appendChild(previewWidget.imgEl) + }); +} +let copiedPath = undefined +function addPreviewOptions(nodeType) { + chainCallback(nodeType.prototype, "getExtraMenuOptions", function(_, options) { + // The intended way of appending options is returning a list of extra options, + // but this isn't used in widgetInputs.js and would require + // less generalization of chainCallback + let optNew = [] + const previewWidget = this.widgets.find((w) => w.name === "videopreview"); + + let url = null + if (previewWidget.videoEl?.hidden == false && previewWidget.videoEl.src) { + if (['input', 'output', 'temp'].includes(previewWidget.value.params.type)) { + //Use full quality video + url = api.apiURL('/view?' + new URLSearchParams(previewWidget.value.params)); + //Workaround for 16bit png: Just do first frame + url = url.replace('%2503d', '001') + } + } else if (previewWidget.imgEl?.hidden == false && previewWidget.imgEl.src) { + url = previewWidget.imgEl.src; + url = new URL(url); + } + if (this.video_query?.source) { + let info_string = this.video_query.source.size.join('x') + + '@' + this.video_query.source.fps + 'fps ' + + this.video_query.source.frames + 'frames' + optNew.push({content: info_string, disabled: true}) + } + if (url) { + optNew.push( + { + content: "Open preview", + callback: () => { + window.open(url, "_blank") + }, + }, + { + content: "Save preview", + callback: () => { + const a = document.createElement("a"); + a.href = url; + a.setAttribute("download", previewWidget.value.params.filename); + document.body.append(a); + a.click(); + requestAnimationFrame(() => a.remove()); + }, + } + ); + if (previewWidget.value.params.fullpath) { + copiedPath = previewWidget.value.params.fullpath + const blob = new Blob([previewWidget.value.params.fullpath], + { type: 'text/plain'}) + optNew.push({ + content: "Copy output filepath", + callback: async () => { + await navigator.clipboard.write([ + new ClipboardItem({ + 'text/plain': blob + })])} + }); + } + if (previewWidget.value.params.workflow) { + let wParams = {...previewWidget.value.params, + filename: previewWidget.value.params.workflow} + let wUrl = api.apiURL('/view?' + new URLSearchParams(wParams)); + optNew.push({ + content: "Save workflow image", + callback: () => { + const a = document.createElement("a"); + a.href = wUrl; + a.setAttribute("download", previewWidget.value.params.workflow); + document.body.append(a); + a.click(); + requestAnimationFrame(() => a.remove()); + } + }); + } + } + const PauseDesc = (previewWidget.value.paused ? "Resume" : "Pause") + " preview"; + if(previewWidget.videoEl.hidden == false) { + optNew.push({content: PauseDesc, callback: () => { + //animated images can't be paused and are more likely to cause performance issues. + //changing src to a single keyframe is possible, + //For now, the option is disabled if an animated image is being displayed + if(previewWidget.value.paused) { + previewWidget.videoEl?.play(); + } else { + previewWidget.videoEl?.pause(); + } + previewWidget.value.paused = !previewWidget.value.paused; + }}); + } + //TODO: Consider hiding elements if no video preview is available yet. + //It would reduce confusion at the cost of functionality + //(if a video preview lags the computer, the user should be able to hide in advance) + const visDesc = (previewWidget.value.hidden ? "Show" : "Hide") + " preview"; + optNew.push({content: visDesc, callback: () => { + if (!previewWidget.videoEl.hidden && !previewWidget.value.hidden) { + previewWidget.videoEl.pause(); + } else if (previewWidget.value.hidden && !previewWidget.videoEl.hidden && !previewWidget.value.paused) { + previewWidget.videoEl.play(); + } + previewWidget.value.hidden = !previewWidget.value.hidden; + previewWidget.parentEl.hidden = previewWidget.value.hidden; + fitHeight(this); + + }}); + optNew.push({content: "Sync preview", callback: () => { + //TODO: address case where videos have varying length + //Consider a system of sync groups which are opt-in? + for (let p of document.getElementsByClassName("vhs_preview")) { + for (let child of p.children) { + if (child.tagName == "VIDEO") { + child.currentTime=0; + } else if (child.tagName == "IMG") { + child.src = child.src; + } + } + } + }}); + const muteDesc = (previewWidget.value.muted ? "Unmute" : "Mute") + " Preview" + optNew.push({content: muteDesc, callback: () => { + previewWidget.value.muted = !previewWidget.value.muted + }}) + if(options.length > 0 && options[0] != null && optNew.length > 0) { + optNew.push(null); + } + options.unshift(...optNew); + }); +} +function addFormatWidgets(nodeType, nodeData) { + chainCallback(nodeType.prototype, "onNodeCreated", function() { + var formatWidget = null; + var formatWidgetIndex = -1; + for(let i = 0; i < this.widgets.length; i++) { + if (this.widgets[i].name === "format"){ + formatWidget = this.widgets[i]; + formatWidgetIndex = i+1; + break + } + } + let formatWidgetsCount = 0; + chainCallback(formatWidget, "callback", (value) => { + const formats = (LiteGraph.registered_node_types[this.type] + ?.nodeData?.input?.required?.format?.[1]?.formats) + let newWidgets = []; + if (formats?.[value]) { + let formatWidgets = formats[value] + for (let wDef of formatWidgets) { + let type = wDef[2]?.widgetType ?? wDef[1] + if (Array.isArray(type)) { + type = "COMBO" + } + app.widgets[type](this, wDef[0], wDef.slice(1), app) + let w = this.widgets.pop() + w.config = wDef.slice(1) + newWidgets.push(w) + } + } + let removed = this.widgets.splice(formatWidgetIndex, + formatWidgetsCount, ...newWidgets); + let newNames = new Set(newWidgets.map((w) => w.name)) + for (let w of removed) { + w?.onRemove?.() + if (w.name in newNames) { + continue + } + //I do not like the performance of this, but it's safe + let slot = this.inputs.findIndex((i) => i.name == w.name) + if (slot >= 0) { + this.removeInput(slot) + } + } + for (let w of newWidgets) { + let existingInput = this.inputs.find((i) => i.name == w.name) + if (existingInput) { + setWidgetConfig(existingInput, w.config) + //TODO: Consider forcing disconnection if props change? + } else { + //NOTE: config is applied in wrapped addInput call + this.addInput(w.name, w.config[0], {widget: {name: w.name}}) + } + } + fitHeight(this); + formatWidgetsCount = newWidgets.length; + }); + }); +} +function addLoadCommon(nodeType, nodeData) { + addVideoPreview(nodeType); + initializeLoadFormat(nodeType, nodeData) + addPreviewOptions(nodeType); + chainCallback(nodeType.prototype, "onNodeCreated", function() { + //widget.callback adds unused arguements which need culling + const node = this + function update(key) { + return function(value) { + let params = {} + params[key] = this.value + node?.updateParameters(params) + } + } + let prior_ar = -2 + const widthWidget = this.widgets.find((w) => w.name === "custom_width"); + const heightWidget = this.widgets.find((w) => w.name === "custom_height"); + function updateAR(value) { + let new_ar = -1 + if (widthWidget.value & heightWidget.value) { + new_ar = widthWidget.value / heightWidget.value + } + if (new_ar != prior_ar) { + node?.updateParameters({'custom_width': widthWidget.value, + 'custom_height': heightWidget.value}) + prior_ar = new_ar + } + } + const offsetWidget = this.widgets.find((w) => w.name === "start_time"); + if (offsetWidget) { + Object.defineProperty(offsetWidget.options, "step", { + set : (value) => {}, + get : () => { + return 1 / (this.video_query?.loaded?.fps ?? 1) + } + }) + } + let widgetMap = {'frame_load_cap': 'frame_load_cap', + 'skip_first_frames': 'skip_first_frames', 'select_every_nth': 'select_every_nth', + 'start_time': 'start_time', 'force_rate': 'force_rate', + 'custom_width': updateAR, 'custom_height': updateAR, + 'image_load_cap': 'image_load_cap', 'skip_first_images': 'skip_first_images' + } + for (let widget of this.widgets) { + if (widget.name in widgetMap) { + if (typeof(widgetMap[widget.name]) == 'function') { + chainCallback(widget, "callback", widgetMap[widget.name]); + } else { + chainCallback(widget, "callback", update(widgetMap[widget.name])) + } + } + if (widget.type != "button") { + widget.callback?.(widget.value) + } + } + }); +} + +function path_stem(path) { + let i = path.lastIndexOf("/"); + if (i >= 0) { + return [path.slice(0,i+1),path.slice(i+1)]; + } + return ["",path]; +} +function searchBox(event, [x,y], node) { + //Ensure only one dialogue shows at a time + if (this.prompt) + return; + this.prompt = true; + + let pathWidget = this; + let dialog = document.createElement("div"); + dialog.className = "litegraph litesearchbox graphdialog rounded" + dialog.innerHTML = 'Path
' + dialog.close = () => { + dialog.remove(); + } + document.body.append(dialog); + if (app.canvas.ds.scale > 1) { + dialog.style.transform = "scale(" + app.canvas.ds.scale + ")"; + } + var name_element = dialog.querySelector(".name"); + var input = dialog.querySelector(".value"); + var options_element = dialog.querySelector(".helper"); + input.value = pathWidget.value; + + var timeout = null; + let last_path = null; + let extensions = pathWidget.options.vhs_path_extensions + + input.addEventListener("keydown", (e) => { + dialog.is_modified = true; + if (e.keyCode == 27) { + //ESC + dialog.close(); + } else if (e.keyCode == 13 && e.target.localName != "textarea") { + pathWidget.value = input.value; + if (pathWidget.callback) { + pathWidget.callback(pathWidget.value); + } + dialog.close(); + } else { + if (e.keyCode == 9) { + //TAB + input.value = last_path + options_element.firstChild.innerText; + e.preventDefault(); + e.stopPropagation(); + } else if (e.ctrlKey && (e.keyCode == 87 || e.keyCode == 66)) { + //Ctrl+w or Ctrl+b + //most browsers won't support, but it's good QOL for those that do + input.value = path_stem(input.value.slice(0,-1))[0] + e.preventDefault(); + e.stopPropagation(); + } else if (e.ctrlKey && e.keyCode == 71) { + //Ctrl+g + //Temporarily disables extension filtering to show all files + e.preventDefault(); + e.stopPropagation(); + extensions = undefined + last_path = null; + } + if (timeout) { + clearTimeout(timeout); + } + timeout = setTimeout(updateOptions, 10); + return; + } + this.prompt=false; + e.preventDefault(); + e.stopPropagation(); + }); + + var button = dialog.querySelector("button"); + button.addEventListener("click", (e) => { + pathWidget.value = input.value; + if (pathWidget.callback) { + pathWidget.callback(pathWidget.value); + } + //unsure why dirty is set here, but not on enter-key above + node.graph.setDirtyCanvas(true); + dialog.close(); + this.prompt = false; + }); + var rect = app.canvas.canvas.getBoundingClientRect(); + var offsetx = -20; + var offsety = -20; + if (rect) { + offsetx -= rect.left; + offsety -= rect.top; + } + + if (event) { + dialog.style.left = event.clientX + offsetx + "px"; + dialog.style.top = event.clientY + offsety + "px"; + } else { + dialog.style.left = canvas.width * 0.5 + offsetx + "px"; + dialog.style.top = canvas.height * 0.5 + offsety + "px"; + } + //Search code + let options = [] + function addResult(name, isDir) { + let el = document.createElement("div"); + el.innerText = name; + el.className = "litegraph lite-search-item"; + if (isDir) { + el.className += " is-dir"; + el.addEventListener("click", (e) => { + input.value = last_path+name + if (timeout) { + clearTimeout(timeout); + } + timeout = setTimeout(updateOptions, 10); + }); + } else { + el.addEventListener("click", (e) => { + pathWidget.value = last_path+name; + if (pathWidget.callback) { + pathWidget.callback(pathWidget.value); + } + dialog.close(); + pathWidget.prompt = false; + }); + } + options_element.appendChild(el); + } + async function updateOptions() { + timeout = null; + let [path, remainder] = path_stem(input.value); + if (last_path != path) { + //fetch options. Must block execution here, so update should be async? + let params = {path : path} + if (extensions) { + params.extensions = extensions + } + let optionsURL = api.apiURL('/vhs/getpath?' + new URLSearchParams(params)); + try { + let resp = await fetch(optionsURL); + options = await resp.json(); + options = options.map((o) => o.replace('.','\0')) + options = options.sort() + options = options.map((o) => o.replace('\0','.')) + } catch(e) { + options = [] + } + last_path = path; + } + options_element.innerHTML = ''; + //filter options based on remainder + for (let option of options) { + if (option.startsWith(remainder)) { + let isDir = option.endsWith('/') + addResult(option, isDir); + } + } + } + + setTimeout(async function() { + input.focus(); + await updateOptions(); + }, 10); + + return dialog; +} +function button_action(widget) { + if ( + widget.options?.reset == undefined && + widget.options?.disable == undefined + ) { + return 'None' + } + if ( + widget.options.reset != undefined && + widget.value != widget.options.reset + ) { + return 'Reset' + } + if ( + widget.options.disable != undefined && + widget.value != widget.options.disable + ) { + return 'Disable' + } + if (widget.options.reset != undefined) { + return 'No Reset' + } + return 'No Disable' +} +function fitText(ctx, text, maxLength) { + if (maxLength <= 0) { + return ['', 0] + } + let fullLength = ctx.measureText(text).width + if (fullLength < maxLength) { + return [text, fullLength] + } + //determine approx safe cutoff + let cutoff = maxLength / fullLength * text.length | 0 + let shortened = text.slice(0, Math.max(0, cutoff - 2)) + '…' + return [shortened, ctx.measureText(shortened).width] +} +function fitPath(ctx, path, maxLength) { + let fullLength = ctx.measureText(path).width + if (fullLength < maxLength) { + return [path, fullLength] + } + //determine approx safe cutoff + let len = (maxLength / fullLength * path.length | 0) - 1 + + let displayPath = '' + let filename = path_stem(path)[1] + if (filename.length > len-2) { + //may all fit, but can't squeeze more info + displayPath = filename.substr(0,len); + } else { + //TODO: find solution for windows, path[1] == ':'? + let isAbs = path[0] == '/'; + let partial = path.substr(path.length - (isAbs ? len-2:len-1)) + let cutoff = partial.indexOf('/'); + if (cutoff < 0) { + //Can occur, but there isn't a nicer way to format + displayPath = path.substr(path.length-len); + } else { + displayPath = (isAbs ? '/…':'…') + partial.substr(cutoff); + } + } + return [displayPath, ctx.measureText(displayPath).width] +} +function roundToPrecision(num, precision) { + let strnum = Number(num).toFixed(precision) + let deci = strnum.indexOf('.') + if (deci > 0) { + let i = strnum.length - 1 + while (i > deci && strnum[i] == '0') { + i-- + } + if (i == deci) { + i-- + } + return strnum.slice(0, i+1) + } + return strnum +} +function inner_value_change(widget, value, node, pos) { + widget.value = value + if (widget.options?.property && widget.options.property in node.properties) { + node.setProperty(widget.options.property, value) + } + if (widget.callback) { + widget.callback(widget.value, app.canvas, node, event) + } +} +function drawAnnotated(ctx, node, widget_width, y, H) { + const litegraph_base = LiteGraph + const show_text = app.canvas.ds.scale >= (app.canvas.low_quality_zoom_threshold ?? 0.5) + const margin = 15 + ctx.strokeStyle = litegraph_base.WIDGET_OUTLINE_COLOR + ctx.fillStyle = litegraph_base.WIDGET_BGCOLOR + ctx.beginPath() + if (show_text) + ctx.roundRect(margin, y, widget_width - margin * 2, H, [H * 0.5]) + else ctx.rect(margin, y, widget_width - margin * 2, H) + ctx.fill() + if (show_text) { + if (!this.disabled) ctx.stroke() + const button = button_action(this) + if (button != 'None') { + ctx.save() + if (button.startsWith('No ')) { + ctx.fillStyle = litegraph_base.WIDGET_OUTLINE_COLOR + ctx.strokeStyle = litegraph_base.WIDGET_OUTLINE_COLOR + } else { + ctx.fillStyle = litegraph_base.WIDGET_TEXT_COLOR + ctx.strokeStyle = litegraph_base.WIDGET_TEXT_COLOR + } + ctx.beginPath() + if (button.endsWith('Reset')) { + ctx.arc(widget_width - margin - 26, y + H/2, 4, Math.PI*3/2, Math.PI) + ctx.stroke() + ctx.beginPath() + ctx.moveTo(widget_width - margin - 26, y + H/2 - 1.5) + ctx.lineTo(widget_width - margin - 26, y + H/2 - 6.5) + ctx.lineTo(widget_width - margin - 30, y + H/2 - 3.5) + ctx.fill() + } else { + ctx.arc(widget_width - margin - 26, y + H/2, 4, Math.PI*2/3, Math.PI*8/3) + ctx.moveTo(widget_width - margin - 26 - 8 ** .5, y + H/2 + 8 ** .5) + ctx.lineTo(widget_width - margin - 26 + 8 ** .5, y + H/2 - 8 ** .5) + ctx.stroke() + } + ctx.restore() + } + ctx.fillStyle = litegraph_base.WIDGET_TEXT_COLOR + if (!this.disabled) { + ctx.beginPath() + ctx.moveTo(margin + 16, y + 5) + ctx.lineTo(margin + 6, y + H * 0.5) + ctx.lineTo(margin + 16, y + H - 5) + ctx.fill() + ctx.beginPath() + ctx.moveTo(widget_width - margin - 16, y + 5) + ctx.lineTo(widget_width - margin - 6, y + H * 0.5) + ctx.lineTo(widget_width - margin - 16, y + H - 5) + ctx.fill() + } + let freeWidth = widget_width - (40 + margin * 2 + 20) + let [valueText, valueWidth] = fitText(ctx, this.displayValue(), freeWidth) + freeWidth -= valueWidth + + ctx.textAlign = 'left' + ctx.fillStyle = litegraph_base.WIDGET_SECONDARY_TEXT_COLOR + if (freeWidth > 20) { + let [name, nameWidth] = fitText(ctx, this.label || this.name, freeWidth) + freeWidth -= nameWidth + ctx.fillText(name, margin * 2 + 5, y + H * 0.7) + } + + let value_offset = margin * 2 + 20 + ctx.textAlign = 'right' + if (this.options.unit) { + ctx.fillStyle = litegraph_base.WIDGET_OUTLINE_COLOR + let [unitText, unitWidth] = fitText(ctx, this.options.unit, freeWidth) + if (unitText == this.options.unit) { + ctx.fillText(this.options.unit, widget_width - value_offset, y + H * 0.7) + value_offset += unitWidth + freeWidth -= unitWidth + } + } + ctx.fillStyle = litegraph_base.WIDGET_TEXT_COLOR + ctx.fillText(valueText, widget_width - value_offset, y + H * 0.7) + ctx.fillStyle = litegraph_base.WIDGET_SECONDARY_TEXT_COLOR + + + let annotation = '' + if (this.annotation) { + annotation = this.annotation(this.value, freeWidth) + } else if ( + this.options.annotation && + this.value in this.options.annotation + ) { + annotation = this.options.annotation[this.value] + } + if (annotation) { + ctx.fillStyle = litegraph_base.WIDGET_OUTLINE_COLOR + let [annoDisplay, annoWidth] = fitText(ctx, annotation, freeWidth) + ctx.fillText( + annoDisplay, + widget_width - 5 - valueWidth - value_offset, + y + H * 0.7 + ) + } + } +} +function mouseAnnotated(event, [x, y], node) { + //NOTE: Mouse actions contain no history element. + //This can cause overlapping actions since each triggers on different event type (down/move/up) + //TODO: Consider further rework + const widget_width = this.width || node.size[0] + const old_value = this.value + const margin = 15 + let isButton = 0 + if (x > margin + 6 && x < margin + 16) { + isButton = -1 + } else if (x > widget_width - margin - 16 & x < widget_width - margin - 6) { + isButton = 1 + } else if (x > widget_width - margin - 34 && x < widget_width - margin - 18) { + isButton = 2 + } + var allow_scroll = true + if (allow_scroll && event.type == 'pointermove') { + if (event.deltaX) + this.value += event.deltaX * (this.options.step || 1) + if (this.options.min != null && this.value < this.options.min) { + this.value = this.options.min + } + if (this.options.max != null && this.value > this.options.max) { + this.value = this.options.max + } + } else if (event.type == 'pointerdown') { + const buttonType = button_action(this) + if (isButton == 2) { + if (buttonType == 'Reset') { + this.value = this.options.reset + } else if (buttonType == 'Disable') { + this.value = this.options.disable + } + } else { + this.value += isButton * (this.options.step || 1) + if (this.options.min != null && this.value < this.options.min) { + this.value = this.options.min + } + if (this.options.max != null && this.value > this.options.max) { + this.value = this.options.max + } + } + } //end mousedown + else if (event.type == 'pointerup') { + if (event.click_time < 200 && !isButton) { + const d_callback = (v) => { + this.value = this.parseValue?.(v) ?? Number(v) + inner_value_change(this, this.value, node, [x, y]) + } + const dialog = app.canvas.prompt( + 'Value', + this.value,//TODO: Consider making this displayValue? + d_callback, + event + ) + const input = dialog.querySelector(".value") + input.addEventListener("keydown", (e) => { + if (e.keyCode == 9) { + e.preventDefault(); + e.stopPropagation(); + d_callback(input.value) + dialog.close() + node?.graph?.setDirtyCanvas(true); + let i=0 + for (;i w.name == 'vhslatentpreview') + if (i >= 0) { + n.widgets.splice(i,1)[0].onRemove() + } + } + latentPreviewNodes = new Set() + } + }, + }, + { + id: "VHS.LatentPreviewRate", + category: ['🎥🅥🅗🅢', 'Sampling', 'Latent Preview Rate'], + name: "Playback rate override.", + type: 'number', + attrs: { + min: 0, + step: 1, + max: 60 + }, + tooltip: + 'Force a specific frame rate for the playback of latent frames. This should not be confused with the output frame rate and will not match for video models.', + defaultValue: 0, + }, + { + id: 'VHS.MetadataImage', + category: ['🎥🅥🅗🅢', 'Output', 'MetadataImage'], + name: 'Save png of first frame for metadata', + type: 'boolean', + defaultValue: true, + }, + { + id: 'VHS.KeepIntermediate', + category: ['🎥🅥🅗🅢', 'Output', 'Keep Intermediate'], + name: 'Keep required intermediate files after sucessful execution', + type: 'boolean', + defaultValue: true, + }, + ], + + async beforeRegisterNodeDef(nodeType, nodeData, app) { + if(nodeData?.name?.startsWith("VHS_")) { + useKVState(nodeType); + if (nodeData.description) { + let description = nodeData.description + let el = document.createElement("div") + el.innerHTML = description + if (!el.children.length) { + //Is plaintext. Do minor convenience formatting + let chunks = description.split('\n') + nodeData.description = chunks[0] + description = chunks.join('
') + } else { + nodeData.description = el.querySelector('#VHS_shortdesc')?.innerHTML || el.children[1]?.firstChild?.innerHTML + } + chainCallback(nodeType.prototype, "onNodeCreated", function () { + helpDOM.addHelp(this, nodeType, description) + this.setSize(this.computeSize()) + }) + } + //set widgetType to use VHS widgets where possible + for(let inp of Object.values({...nodeData.input?.required, ...nodeData.input?.optional})) { + if (["INT", "FLOAT"].includes(inp[0])) { + if (!inp[1]) { + inp[1] = {} + } + inp[1].widgetType ??= "VHS" + inp[0] + } + } + chainCallback(nodeType.prototype, "onNodeCreated", function () { + let new_widgets = [] + if (this.widgets) { + for (let w of this.widgets) { + let input = this.constructor.nodeData.input + let config = input?.required[w.name] ?? input.optional[w.name] + if (!config) { + continue + } + if (w?.type == "text" && config[1].vhs_path_extensions) { + new_widgets.push(app.widgets.VHSPATH({}, w.name, ["VHSPATH", config[1]])); + } else { + new_widgets.push(w) + } + } + this.widgets = new_widgets; + } + const originalAddInput = this.addInput; + this.addInput = function(name, type, options) { + if (options.widget) { + //Is Converted Widget + const widget = this.widgets.find((w) => w.name == name) + if (widget?.config) { + //Has override for type + type = widget.config[0] + if (type == 'FLOAT') { + type = "FLOAT,INT" + } + setWidgetConfig(options, widget.config) + } + } + return originalAddInput.apply(this, [name, type, options]) + } + }); + } + if (nodeData?.name == "VHS_LoadImages") { + addUploadWidget(nodeType, nodeData, "directory", "folder"); + chainCallback(nodeType.prototype, "onNodeCreated", function() { + const pathWidget = this.widgets.find((w) => w.name === "directory"); + chainCallback(pathWidget, "callback", (value) => { + if (!value) { + return; + } + let params = {filename : value, type : "input", format: "folder"}; + this.updateParameters(params, true); + }); + }); + addLoadCommon(nodeType, nodeData); + } else if (nodeData?.name == "VHS_LoadImagesPath") { + chainCallback(nodeType.prototype, "onNodeCreated", function() { + const pathWidget = this.widgets.find((w) => w.name === "directory"); + chainCallback(pathWidget, "callback", (value) => { + if (!value) { + return; + } + let params = {filename : value, type : "path", format: "folder"}; + this.updateParameters(params, true); + }); + }); + addLoadCommon(nodeType, nodeData); + } else if (nodeData?.name == "VHS_LoadVideo" || nodeData?.name == "VHS_LoadVideoFFmpeg") { + chainCallback(nodeType.prototype, "onNodeCreated", function() { + const pathWidget = this.widgets.find((w) => w.name === "video"); + chainCallback(pathWidget, "callback", (value) => { + if (!value) { + return; + } + let parts = ["input", value]; + let extension_index = parts[1].lastIndexOf("."); + let extension = parts[1].slice(extension_index+1); + let format = "video" + if (["gif", "webp", "avif"].includes(extension)) { + format = "image" + } + format += "/" + extension; + let params = {filename : parts[1], type : parts[0], format: format}; + this.updateParameters(params, true); + }); + }); + addUploadWidget(nodeType, nodeData, "video"); + addLoadCommon(nodeType, nodeData); + addVAEOutputToggle(nodeType, nodeData); + applyVHSAudioLinksFix(nodeType, nodeData, 2) + } else if (nodeData?.name == "VHS_LoadAudioUpload") { + addUploadWidget(nodeType, nodeData, "audio", "audio"); + applyVHSAudioLinksFix(nodeType, nodeData, 0) + } else if (nodeData?.name == "VHS_LoadAudio"){ + applyVHSAudioLinksFix(nodeType, nodeData, 0) + } else if (nodeData?.name == "VHS_LoadVideoPath" || nodeData?.name == "VHS_LoadVideoFFmpegPath") { + chainCallback(nodeType.prototype, "onNodeCreated", function() { + const pathWidget = this.widgets.find((w) => w.name === "video"); + chainCallback(pathWidget, "callback", (value) => { + let extension_index = value.lastIndexOf("."); + let extension = value.slice(extension_index+1); + let format = "video" + if (["gif", "webp", "avif"].includes(extension)) { + format = "image" + } + format += "/" + extension; + let params = {filename : value, type: "path", format: format}; + this.updateParameters(params, true); + }); + }); + addLoadCommon(nodeType, nodeData); + addVAEOutputToggle(nodeType, nodeData); + applyVHSAudioLinksFix(nodeType, nodeData, 2) + } else if (nodeData?.name == "VHS_LoadImagePath") { + addLoadCommon(nodeType, nodeData); + addVAEOutputToggle(nodeType, nodeData); + chainCallback(nodeType.prototype, "onNodeCreated", function() { + const pathWidget = this.widgets.find((w) => w.name === "image"); + chainCallback(pathWidget, "callback", (value) => { + let extension_index = value.lastIndexOf("."); + let extension = value.slice(extension_index+1); + let format = "video" + "/" + extension; + let params = {filename : value, type: "path", format: format}; + this.updateParameters(params, true); + }); + }); + } else if (nodeData?.name == "VHS_VideoCombine") { + addDateFormatting(nodeType, "filename_prefix"); + chainCallback(nodeType.prototype, "onExecuted", function(message) { + if (message?.gifs) { + this.updateParameters(message.gifs[0], true); + } + }); + addVideoPreview(nodeType, false); + addPreviewOptions(nodeType); + addFormatWidgets(nodeType, nodeData); + addVAEInputToggle(nodeType, nodeData) + } else if (nodeData?.name == "VHS_SaveImageSequence") { + //Disabled for safety as VHS_SaveImageSequence is not currently merged + //addDateFormating(nodeType, "directory_name", timestamp_widget=true); + //addTimestampWidget(nodeType, nodeData, "directory_name") + } else if (nodeData?.name == "VHS_BatchManager") { + chainCallback(nodeType.prototype, "onNodeCreated", function() { + this.widgets.push({name: "count", type: "dummy", value: 0, + computeSize: () => {return [0,-4]}, + afterQueued: function() {this.value++;}}); + }); + } else if (nodeData?.name == "VHS_Unbatch") { + cloneType(nodeType, nodeData) + } else if (nodeData?.name == "VHS_SelectLatest") { + chainCallback(nodeType.prototype, "onNodeCreated", function() { + this.isVirtualNode = true + chainCallback(this, "onConnectionsChange", function (contype, slot, iscon, linfo) { + if (iscon) { + this.update_links() + } + }) + + this.update_links = function(extraLinks = []) { + if (!this.outputs[0].links?.length) return + + function get_links(node) { + let links = [] + for (const l of node.outputs[0].links) { + const linkInfo = app.graph.links[l] + const n = node.graph.getNodeById(linkInfo.target_id) + if (n.type == 'Reroute') { + links = links.concat(get_links(n)) + } else { + links.push(l) + } + } + return links + } + + let links = [ + ...get_links(this).map((l) => app.graph.links[l]), + ...extraLinks + ] + let v = this.latest_file + if (!v) { + return + } + + // For each output link copy our value over the original widget value + for (const linkInfo of links) { + const node = this.graph.getNodeById(linkInfo.target_id) + const input = node.inputs[linkInfo.target_slot] + const widgetName = input.widget.name + const widget = node.widgets.find((w) => w.name === widgetName) + if (widget) { + widget.value = v + if (widget.callback) { + widget.callback( widget.value, app.canvas, + node, app.canvas.graph_mouse, {}) + } + } + } + } + let fetch_files = async () => { + let [path, remainder] = path_stem(this.widgets[0].value) + let params = {path : path} + let optionsURL = api.apiURL('/vhs/getpath?' + new URLSearchParams(params)); + let options + try { + let resp = await fetch(optionsURL); + options = await resp.json(); + } catch(e) { + options = [] + } + options = options.filter((file) => file.startsWith(remainder) && file.endsWith(this.widgets[1].value)) + if (options.length && this.latest_file != options[options.length-1]) { + this.latest_file = path + options[options.length-1] + this.update_links() + } + } + this.widgets[0].callback = fetch_files + this.widgets[1].callback = fetch_files + this.onPromptExecuted = fetch_files + this.applyToGraph = this.update_links + }) + } + }, + async getCustomWidgets() { + return { + VHSPATH(node, inputName, inputData) { + let w = { + name : inputName, + type : "VHS.PATH", + value : "", + draw : function(ctx, node, widget_width, y, H) { + //Adapted from litegraph.core.js:drawNodeWidgets + var show_text = app.canvas.ds.scale >= (app.canvas.low_quality_zoom_threshold ?? 0.5) + var margin = 15; + var text_color = LiteGraph.WIDGET_TEXT_COLOR; + var secondary_text_color = LiteGraph.WIDGET_SECONDARY_TEXT_COLOR; + ctx.textAlign = "left"; + ctx.strokeStyle = LiteGraph.WIDGET_OUTLINE_COLOR; + ctx.fillStyle = LiteGraph.WIDGET_BGCOLOR; + ctx.beginPath(); + if (show_text) + ctx.roundRect(margin, y, widget_width - margin * 2, H, [H * 0.5]); + else + ctx.rect( margin, y, widget_width - margin * 2, H ); + ctx.fill(); + if (show_text) { + if(!this.disabled) + ctx.stroke(); + ctx.save(); + ctx.beginPath(); + ctx.rect(margin, y, widget_width - margin * 2, H); + ctx.clip(); + + //ctx.stroke(); + let freeWidth = widget_width - (margin * 2 + 40) + ctx.fillStyle = secondary_text_color; + const label = this.label || this.name; + if (label != null) { + let [labelDisplay, labelWidth] = fitText(ctx, label, freeWidth) + freeWidth -= labelWidth + ctx.fillText(labelDisplay, margin * 2, y + H * 0.7); + } + ctx.fillStyle = this.value ? text_color : '#777'; + ctx.textAlign = "right"; + let disp_text = fitPath(ctx, String(this.value || this.options.placeholder), freeWidth)[0] + ctx.fillText(disp_text, widget_width - margin * 2, y + H * 0.7); + ctx.restore(); + } + }, + mouse : searchBox, + options : {}, + }; + if (inputData.length > 1) { + w.options = inputData[1] + if (inputData[1].default) { + w.value = inputData[1].default; + } + } + + if (!node.widgets) { + node.widgets = []; + } + node.widgets.push(w); + return w; + }, + VHSFLOAT(node, inputName, inputData) { + let w = { + name: inputName, + type: "VHS.ANNOTATED", + value: inputData[1]?.default ?? 0, + draw: drawAnnotated, + mouse: mouseAnnotated, + computeSize(width) { + return [width, 20] + }, + callback(v) { + if (this.options.round) { + //TODO adopt ComfyUI_frontend#4291? + v = Math.round((v + Number.EPSILON) / + this.options.round) * this.options.round + } + if (this.options.max && v > this.options.max) { + v = this.options.max + } + if (this.options.min && v < this.options.max) { + v = this.options.min + } + this.value = v + }, + config: inputData, + displayValue: function() { + return roundToPrecision(this.value, this.options.precision ?? 3) + }, + options: Object.assign({}, inputData[1]) + } + if (!node.widgets) { + node.widgets = [] + } + node.widgets.push(w) + return w + }, + VHSINT(node, inputName, inputData) { + let w = { + name: inputName, + type: "VHS.ANNOTATED", + value: inputData[1]?.default ?? 0, + draw: drawAnnotated, + mouse: mouseAnnotated, + computeSize(width) { + return [width, 20] + }, + callback(v) { + if (this.options.max && v > this.options.max) { + v = this.options.max + } + if (this.options.min && v < this.options.min) { + v = this.options.min + } + if (v == 0) { + return + } + const s = this.options.step + let sh = this.options.mod ?? 0 + this.value = Math.round((v - sh) / s) * s + sh + }, + config: inputData, + displayValue: function() { + return this.value | 0 + }, + options: Object.assign({}, inputData[1]) + } + if (!node.widgets) { + node.widgets = [] + } + node.widgets.push(w) + return w + }, + VHSTIMESTAMP(node, inputName, inputData) { + let w = { + name: inputName, + type: "VHS.TIMESTAMP", + value: inputData[1]?.default ?? 0, + draw: drawAnnotated, + mouse: mouseAnnotated, + computeSize(width) { + return [width, 20] + }, + parseValue(v) { + if (typeof(v) == "string") { + let val = 0 + for (let chunk of v.split(":")) { + val = val * 60 + parseFloat(chunk) + } + return val + } + }, + callback(v) {}, + config: inputData, + options: Object.assign({}, inputData[1]), + displayValue() { + let seconds = this.value + let hours = seconds / 3600 | 0 + seconds -= 3600 * hours + let minutes = seconds / 60 | 0 + seconds -= 60 * minutes + let display = "" + if (hours > 0) { + display += hours + ":" + } + if (hours > 0 || minutes > 0) { + if (hours > 0) { + minutes = (''+minutes).padStart(2,'0') + } + display += minutes + ":" + } + seconds = roundToPrecision(seconds, 4) + if ((seconds[1] == '.' || seconds.length == 1) && (minutes > 0 || hours > 0)) { + seconds = '0'+seconds + } + display += seconds + return display + } + } + if (!node.widgets) { + node.widgets = [] + } + node.widgets.push(w) + return w + }, + } + }, + async loadedGraphNode(node) { + //Check and migrate inputs named batch_manager from old workflows + if (node.type?.startsWith("VHS_") && node.inputs) { + const batchInput = node.inputs.find((i) => i.name == "batch_manager") + if (batchInput) { + batchInput.name = "meta_batch" + } + } + }, + async beforeConfigureGraph(graphData, missingNodeTypes) { + if(helpDOM?.node) { + helpDOM.node = undefined + } + }, + async setup() { + let originalGraphToPrompt = app.graphToPrompt + let graphToPrompt = async function() { + let res = await originalGraphToPrompt.apply(this, arguments); + res.workflow.extra['VHS_latentpreview'] = app.ui.settings.getSettingValue("VHS.LatentPreview") + res.workflow.extra['VHS_latentpreviewrate'] = app.ui.settings.getSettingValue("VHS.LatentPreviewRate") + res.workflow.extra['VHS_MetadataImage'] = app.ui.settings.getSettingValue("VHS.MetadataImage") + res.workflow.extra['VHS_KeepIntermediate'] = app.ui.settings.getSettingValue("VHS.KeepIntermediate") + return res + } + app.graphToPrompt = graphToPrompt + //Add a handler for pasting video data + document.addEventListener('paste', async (e) => { + if (!e.target.classList.contains('litegraph') && + !e.target.classList.contains('graph-canvas-container')) { + return + } + let data = e.clipboardData || window.clipboardData + let filepath = data.getData('text/plain') + let video + for (const item of data.items) { + if (item.type.startsWith('video/')) { + video = item + break + } + } + if (filepath && copiedPath == filepath) { + //Add a Load Video (Path) and populate filepath + const pastedNode = LiteGraph.createNode('VHS_LoadVideoPath') + app.graph.add(pastedNode) + pastedNode.pos[0] = app.canvas.graph_mouse[0] + pastedNode.pos[1] = app.canvas.graph_mouse[1] + pastedNode.widgets[0].value = filepath + pastedNode.widgets[0].callback?.(filepath) + } else if (video && false) { + //Disabled due to lack of testing + //Add a Load Video (Upload), then upload the file, then select the file + const pastedNode = LiteGraph.createNode('VHS_LoadVideo') + app.graph.add(pastedNode) + pastedNode.pos[0] = app.canvas.graph_mouse[0] + pastedNode.pos[1] = app.canvas.graph_mouse[1] + const pathWidget = pastedNode.widgets[0] + //TODO: upload to pasted dir? + const blob = video.getAsFile() + const resp = await uploadFile(blob) + if (resp.status != 200) { + //upload failed and file can not be added to options + return; + } + const filename = (await resp.json()).name; + pathWidget.options.values.push(filename); + pathWidget.value = filename; + pathWidget.callback?.(filename) + } else { + return + } + e.preventDefault() + e.stopImmediatePropagation() + return false + }, true) + }, + async init() { + if (app.ui.settings.getSettingValue("VHS.AdvancedPreviews") == true) { + app.ui.settings.setSettingValue("VHS.AdvancedPreviews", 'Always') + } + if (app.ui.settings.getSettingValue("VHS.AdvancedPreviews") == false) { + app.ui.settings.setSettingValue("VHS.AdvancedPreviews", 'Never') + } + if (app.VHSHelp != helpDOM) { + helpDOM = app.VHSHelp + } else { + initHelpDOM() + } + let e = app.extensions.filter((w) => w.name == 'UVR5.AudioPreviewer') + if (e.length) { + let orig = e[0].beforeRegisterNodeDef + e[0].beforeRegisterNodeDef = function(nodeType, nodeData, app) { + if(!nodeData?.name?.startsWith("VHS_")) { + return orig.apply(this, arguments); + } + } + } + }, +}); +let previewImages = [] +let animateInterval +api.addEventListener('executing', ({ detail }) => { + if (detail === null) { + for (let node of app.graph._nodes) { + if (node.type.startsWith("VHS_")) { + node.onPromptExecuted?.() + } + } + } +}) +function getLatentPreviewCtx(id, width, height) { + const node = getNodeById(id) + if (!node) { + return undefined + } + + let previewWidget = node.widgets.find((w) => w.name == "vhslatentpreview") + if (!previewWidget) { + let canvasEl = document.createElement("canvas") + previewWidget = node.addDOMWidget("vhslatentpreview", "vhscanvas", canvasEl, { + serialize: false, + hideOnZoom: false, + }); + previewWidget.serialize = false + allowDragFromWidget(previewWidget) + canvasEl.addEventListener('contextmenu', (e) => { + e.preventDefault() + return app.canvas._mousedown_callback(e) + }, true); + canvasEl.addEventListener('pointerdown', (e) => { + e.preventDefault() + return app.canvas._mousedown_callback(e) + }, true); + canvasEl.addEventListener('mousewheel', (e) => { + e.preventDefault() + return app.canvas._mousewheel_callback(e) + }, true); + canvasEl.addEventListener('pointermove', (e) => { + e.preventDefault() + return app.canvas._mousemove_callback(e) + }, true); + canvasEl.addEventListener('pointerup', (e) => { + e.preventDefault() + return app.canvas._mouseup_callback(e) + }, true); + + previewWidget.computeSize = function(width) { + if (this.aspectRatio) { + let height = (node.size[0]-20)/ this.aspectRatio + 10; + if (!(height > 0)) { + height = 0; + } + this.computedHeight = height + 10; + return [width, height]; + } + return [width, -4];//no loaded src, widget should not display + } + } + let canvasEl = previewWidget.element + if (!previewWidget.ctx || canvasEl.width != width + || canvasEl.height != height) { + previewWidget.aspectRatio = width / height + canvasEl.width = width + canvasEl.height = height + fitHeight(node) + } + return canvasEl.getContext("2d") +} +//TODO: Figure out means of concurrency here. map of active nodes and finish event? +// Information has been squirreled away to the execution store which isn't exposed. +api.addEventListener('VHS_latentpreview', ({ detail }) => { + let setting = app.ui.settings.getSettingValue("VHS.LatentPreview") + if (!setting) { + return + } + let id = detail.id + if (id == null) { + return + } + latentPreviewNodes.add(id) + + previewImages = [] + previewImages.length = detail.length + let displayIndex = 0 + if (animateInterval) { + clearTimeout(animateInterval) + } + //While progress is safely cleared on execution completion. + //Initial progress must be started here to avoid a race condition + getNodeById(id).progress = 0 + animateInterval = setInterval(() => { + if (getNodeById(id).progress == undefined) { + clearTimeout(animateInterval) + animateInterval = undefined + return + } + if (!previewImages[displayIndex]) { + return + } + getLatentPreviewCtx(id, previewImages[displayIndex].width, + previewImages[displayIndex].height)?.drawImage?.(previewImages[displayIndex],0,0) + displayIndex = (displayIndex + 1) % previewImages.length + }, 1000/detail.rate); +}); +api.addEventListener('b_preview', async (e) => { + if (!animateInterval) { + return + } + e.preventDefault() + e.stopImmediatePropagation() + e.stopPropagation() + const dv = new DataView(await e.detail.slice(0,24).arrayBuffer()) + const index = dv.getUint32(4) + //const idlen = dv.getUint8(5) + //const id = dv.getstring???(6,idlen) + previewImages[index] = await window.createImageBitmap(e.detail.slice(24)) + return false +}, true); diff --git a/docs/hel-892/scail-load-reference/web__js__videoinfo.js b/docs/hel-892/scail-load-reference/web__js__videoinfo.js new file mode 100644 index 00000000..b1a98710 --- /dev/null +++ b/docs/hel-892/scail-load-reference/web__js__videoinfo.js @@ -0,0 +1,101 @@ +import { app } from '../../../scripts/app.js' + + +function getVideoMetadata(file) { + return new Promise((r) => { + const reader = new FileReader(); + reader.onload = (event) => { + const videoData = new Uint8Array(event.target.result); + const dataView = new DataView(videoData.buffer); + + let decoder = new TextDecoder(); + // Check for known valid magic strings + if (dataView.getUint32(0) == 0x1A45DFA3) { + //webm/mkv (both use EBML/Matroska format) + //see http://wiki.webmproject.org/webm-metadata/global-metadata + //and https://www.matroska.org/technical/elements.html + //contrary to specs, tag seems consistently at start + //COMMENT + 0x4487 + packed length? + //length 0x8d8 becomes 0x48d8 + // + //description for variable length ints https://github.com/ietf-wg-cellar/ebml-specification/blob/master/specification.markdown + let offset = 4 + 8; //COMMENT is 7 chars + 1 to realign + while(offset < videoData.length-16) { + //Check for text tags + if (dataView.getUint16(offset) == 0x4487) { + //check that name of tag is COMMENT + const name = String.fromCharCode(...videoData.slice(offset-7,offset)); + if (name === "COMMENT") { + let vint = dataView.getUint32(offset+2); + let n_octets = Math.clz32(vint)+1; + if (n_octets < 4) {//250MB sanity cutoff + let length = (vint >> (8*(4-n_octets))) & ~(1 << (7*n_octets)); + const content = decoder.decode(videoData.slice(offset+2+n_octets, offset+2+n_octets+length)); + let json = JSON.parse(content); + r(json); + return; + } + } + } + offset+=1; + } + } else if (dataView.getUint32(4) == 0x66747970 && dataView.getUint32(8) == 0x69736F6D) { + //mp4 + //see https://developer.apple.com/documentation/quicktime-file-format + //Seems to make no guarantee for alignment + let offset = videoData.length-4; + while (offset > 16) {//rough safe guess + if (dataView.getUint32(offset) == 0x64617461) {//any data tag + if (dataView.getUint32(offset - 8) == 0xa9636d74) {//cmt data tag + let type = dataView.getUint32(offset+4); //seemingly 1 + let locale = dataView.getUint32(offset+8); //seemingly 0 + let size = dataView.getUint32(offset-4) - 4*4; + const content = decoder.decode(videoData.slice(offset+12, offset+12+size)); + const json = JSON.parse(content); + r(json); + return; + } + } + + offset-=1; + } + } else { + console.error("Unknown magic: " + dataView.getUint32(0)) + } + r(); + return; + }; + + reader.readAsArrayBuffer(file); + }); +} +function isVideoFile(file) { + if (file?.name?.endsWith(".webm")) { + return true; + } + if (file?.name?.endsWith(".mp4")) { + return true; + } + if (file?.name?.endsWith(".mkv")) { + return true; + } + + return false; +} + +let originalHandleFile = app.handleFile; +app.handleFile = handleFile; +let fileInput = document.getElementById("comfy-file-input") +//hijack comfy-file-input to allow webm/mp4/mkv +fileInput.accept += ",video/webm,video/mp4,video/x-matroska"; + +async function handleFile(file) { + if (file?.type?.startsWith("video/") || isVideoFile(file)) { + const videoInfo = await getVideoMetadata(file); + if (videoInfo?.workflow) { + await app.loadGraphData(videoInfo.workflow); + return + } + } + return await originalHandleFile.apply(this, arguments); +}