HEL-892: pin Scail loader reference and bound legacy alias provenance
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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", "源图声明的前端版本与固定参考不一致")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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()
|
||||
)
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"])
|
||||
|
||||
|
||||
|
||||
@@ -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()
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
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.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
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:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
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
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
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
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
@@ -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)
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -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."
|
||||
}
|
||||
+674
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
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.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
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:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
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
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
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
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
+1566
File diff suppressed because it is too large
Load Diff
@@ -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) => {"}]}
|
||||
+674
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
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.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
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:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
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
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
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
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
+1566
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -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 = ""
|
||||
@@ -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
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -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)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user