HEL-892: document fixed MoGe3 geometry workflow references
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -15,6 +15,11 @@ DEFINITION_SHA256 = "c4c7f04fde29dc7485a341207397fcf6191e3fcbe89ecc2d238f4a4f5bc
|
||||
|
||||
# Explicit path allowlist; a recomputed caller-supplied digest cannot extend trust.
|
||||
DEFINITIONS = {
|
||||
(
|
||||
"example_ComfyUI_workflows/0-基础处理:图像合并-音频"
|
||||
"分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.j"
|
||||
"son"
|
||||
): "4648bba0e64192278393c36433c58f742b1f4f189083f992baef9e055d7ef280",
|
||||
(
|
||||
"example_ComfyUI_workflows/0-基础处理:图像合并-音频"
|
||||
"分离-视频截取合并-图像视频放大/高清放大/Seedvr2_视频放大FOR循环长"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,278 @@
|
||||
"MoGe3 independent scopes, accurate interface conflicts and fail-closed trust."
|
||||
|
||||
import copy
|
||||
import hashlib
|
||||
import json
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from calliope.comfyui.fixed_document import DEFINITIONS, canonical
|
||||
from calliope.comfyui.library import build_document
|
||||
from calliope.comfyui.source_reviews import review_for
|
||||
|
||||
REPO = Path(__file__).resolve().parents[2]
|
||||
OUT = REPO / "docs/hel-892/moge3-document-evidence"
|
||||
PATH = next(p for p in DEFINITIONS if p.endswith("/moge3_深度图_几何图_线稿图.json"))
|
||||
SOURCE = json.loads((REPO / PATH).read_bytes())
|
||||
REVIEW = review_for(PATH, hashlib.sha1((REPO / PATH).read_bytes()).hexdigest())
|
||||
BLOCK = REVIEW["fixed_version_document"]
|
||||
|
||||
|
||||
def pointer(obj, path):
|
||||
for part in path.strip("/").split("/"):
|
||||
obj = obj[int(part)] if isinstance(obj, list) else obj[part]
|
||||
return obj
|
||||
|
||||
|
||||
def doc(s=SOURCE, r=REVIEW):
|
||||
return build_document(PATH, s, None, None, [], r)
|
||||
|
||||
|
||||
def refuse(s, r):
|
||||
r["fixed_version_document"]["canonical_sha256"] = hashlib.sha256(canonical(s)).hexdigest()
|
||||
assert not doc(s, r)["fixed_version"]["matched"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("f", BLOCK["fields"], ids=lambda f: f["node_id"] + "." + f["field"])
|
||||
def test_all_saved_positions_dual_pointers_types_and_local_evidence(f):
|
||||
assert canonical(pointer(SOURCE, f["pointer"])) == canonical(f["value"])
|
||||
assert type(pointer(SOURCE, f["pointer"])).__name__ == f["json_type"]
|
||||
assert f["scope"] == (
|
||||
"root"
|
||||
if ":" not in f["node_id"]
|
||||
else next(
|
||||
s["id"]
|
||||
for s in SOURCE["definitions"]["subgraphs"]
|
||||
if any(str(n["id"]) == f["definition_node_id"] for n in s["nodes"])
|
||||
)
|
||||
)
|
||||
assert canonical(pointer(SOURCE, f["named_pointer"])) == canonical(f["named_value"])
|
||||
if f["input_pointer"].startswith("/"):
|
||||
inp = pointer(SOURCE, f["input_pointer"])
|
||||
assert inp.get("widget", {}).get("name", inp["name"]) == f["field"]
|
||||
for key in [
|
||||
"effect",
|
||||
"label",
|
||||
"schema_default",
|
||||
"unit",
|
||||
"limits",
|
||||
"execution_note",
|
||||
"role",
|
||||
"type",
|
||||
]:
|
||||
assert f[key]
|
||||
for i in f["evidence"]:
|
||||
e = BLOCK["sources"][i]
|
||||
raw = (OUT / e["local_file"]).read_bytes()
|
||||
assert hashlib.sha256(raw).hexdigest() == e["sha256"]
|
||||
assert 1 <= e["lines"][0] <= e["lines"][1] <= len(raw.decode().splitlines())
|
||||
|
||||
|
||||
@pytest.mark.parametrize("f", BLOCK["fields"], ids=lambda f: f["node_id"] + "." + f["field"])
|
||||
@pytest.mark.parametrize("variant", ["source", "text", "named"])
|
||||
def test_each_saved_value_or_description_forgery_cannot_retrust(f, variant):
|
||||
s, r = copy.deepcopy(SOURCE), copy.deepcopy(REVIEW)
|
||||
if variant == "text":
|
||||
r["fixed_version_document"]["fields"][BLOCK["fields"].index(f)]["effect"] = "forged"
|
||||
else:
|
||||
p = f["pointer"] if variant == "source" else f["named_pointer"]
|
||||
parent, _, key = p.rpartition("/")
|
||||
c = pointer(s, parent)
|
||||
c[int(key) if isinstance(c, list) else key] = "forged"
|
||||
refuse(s, r)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"scope,index",
|
||||
[
|
||||
(base, i)
|
||||
for base, ns in [
|
||||
("/nodes", SOURCE["nodes"]),
|
||||
*[
|
||||
(f"/definitions/subgraphs/{i}/nodes", s["nodes"])
|
||||
for i, s in enumerate(SOURCE["definitions"]["subgraphs"])
|
||||
],
|
||||
]
|
||||
for i in range(len(ns))
|
||||
],
|
||||
)
|
||||
@pytest.mark.parametrize("variant", ["mode", "identity"])
|
||||
def test_every_node_identity_and_mode_bound(scope, index, variant):
|
||||
s, r = copy.deepcopy(SOURCE), copy.deepcopy(REVIEW)
|
||||
n = pointer(s, scope)[index]
|
||||
if variant == "mode":
|
||||
n["mode"] = 1 if n["mode"] != 1 else 0
|
||||
else:
|
||||
n["properties"]["ver"] = "forged"
|
||||
refuse(s, r)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"scope,index",
|
||||
[
|
||||
(base, i)
|
||||
for base, es in [
|
||||
("/links", SOURCE["links"]),
|
||||
*[
|
||||
(f"/definitions/subgraphs/{i}/links", s["links"])
|
||||
for i, s in enumerate(SOURCE["definitions"]["subgraphs"])
|
||||
],
|
||||
]
|
||||
for i in range(len(es))
|
||||
],
|
||||
)
|
||||
def test_every_physical_or_boundary_edge_bound(scope, index):
|
||||
s, r = copy.deepcopy(SOURCE), copy.deepcopy(REVIEW)
|
||||
e = pointer(s, scope)[index]
|
||||
if isinstance(e, list):
|
||||
e[3] = 99999
|
||||
else:
|
||||
e["target_slot"] = 99999
|
||||
refuse(s, r)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"si,key,i",
|
||||
[
|
||||
(si, key, i)
|
||||
for si, s in enumerate(SOURCE["definitions"]["subgraphs"])
|
||||
for key in ["inputs", "outputs"]
|
||||
for i in range(len(s[key]))
|
||||
],
|
||||
)
|
||||
def test_each_definition_boundary_is_bound(si, key, i):
|
||||
s, r = copy.deepcopy(SOURCE), copy.deepcopy(REVIEW)
|
||||
s["definitions"]["subgraphs"][si][key][i]["linkIds"] = []
|
||||
refuse(s, r)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"variant",
|
||||
[
|
||||
"note",
|
||||
"named-note",
|
||||
"meaning",
|
||||
"source_sha",
|
||||
"overview",
|
||||
"citation",
|
||||
"definition-digest",
|
||||
"empty",
|
||||
"missing",
|
||||
],
|
||||
)
|
||||
def test_note_and_definition_trust(variant):
|
||||
s, r = copy.deepcopy(SOURCE), copy.deepcopy(REVIEW)
|
||||
if variant in ["note", "named-note"]:
|
||||
p = (
|
||||
BLOCK["comments"][0]["pointer"]
|
||||
if variant == "note"
|
||||
else BLOCK["comments"][0]["named_pointer"]
|
||||
)
|
||||
parent, _, key = p.rpartition("/")
|
||||
c = pointer(s, parent)
|
||||
c[int(key) if isinstance(c, list) else key] = "forged"
|
||||
elif variant == "meaning":
|
||||
r["fixed_version_document"]["comments"][0]["meaning"] = "forged"
|
||||
elif variant == "source_sha":
|
||||
r["source_sha"] = "forged"
|
||||
elif variant == "overview":
|
||||
r["fixed_version_document"]["user_overview"] = "forged"
|
||||
elif variant == "citation":
|
||||
r["fixed_version_document"]["sources"][0]["sha256"] = "forged"
|
||||
elif variant == "definition-digest":
|
||||
r["fixed_version_document"]["boundaries"][0]["canonical_sha256"] = "forged"
|
||||
elif variant == "empty":
|
||||
r["fixed_version_document"] = {}
|
||||
else:
|
||||
r.pop("fixed_version_document")
|
||||
assert not doc(s, r)["fixed_version"]["matched"]
|
||||
|
||||
|
||||
def test_inventory_all_instances_and_frozen_previous_reviews():
|
||||
inv = json.loads((OUT / "independent-inventory.json").read_bytes())
|
||||
assert [f["pointer"] for f in inv["fields"]] == [f["pointer"] for f in BLOCK["fields"]]
|
||||
assert len(BLOCK["fields"]) == 67 and len(BLOCK["comments"]) == 1
|
||||
assert sum(f["scope"] == "root" for f in BLOCK["fields"]) == 18
|
||||
assert len({f["scope"] for f in BLOCK["fields"]}) == 6
|
||||
assert [e["state"] for e in inv["empty"]] == ["list"] * 5 + ["missing"]
|
||||
assert BLOCK["comments"][0]["text"] == pointer(SOURCE, BLOCK["comments"][0]["pointer"])
|
||||
resource = "calliope-backend/src/calliope/co" + "mfyui/source_reviews.json"
|
||||
old = json.loads(
|
||||
subprocess.check_output(
|
||||
["git", "show", ("a7ea35daecd51369d28e42e925362527" + "76ea5d7b:") + resource], cwd=REPO
|
||||
)
|
||||
)
|
||||
cur = json.loads((REPO / resource).read_bytes())
|
||||
cur[PATH].pop("fixed_version_document")
|
||||
assert cur == old
|
||||
blocks = [r["fixed_version_document"] for r in old.values() if "fixed_version_document" in r]
|
||||
assert (
|
||||
len(blocks) == 37
|
||||
and sum(len(b["fields"]) for b in blocks) == 1281
|
||||
and sum(
|
||||
len(
|
||||
build_document(p, json.loads((REPO / p).read_bytes()), None, None, [], r)[
|
||||
"source_notes"
|
||||
]
|
||||
)
|
||||
for p, r in old.items()
|
||||
if "fixed_version_document" in r
|
||||
)
|
||||
== 40
|
||||
)
|
||||
assert doc()["fixed_version"]["matched"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("generated", [False, True])
|
||||
def test_exact_versions_conflicting_refine_and_preview_protocol(generated):
|
||||
import runpy
|
||||
|
||||
b = runpy.run_path(str(OUT / "build_definition.py"))["build"]() if generated else BLOCK
|
||||
assert {e["commit"] for e in b["sources"] if e["id"] == "frontend"} == {
|
||||
"1a7a6b82514874545dc5e8203d0bd2188c2d9b18"
|
||||
}
|
||||
assert {e["commit"] for e in b["sources"] if e["id"] == "core"} == {
|
||||
"ee71d5c4993f29086b27fde1629a945ae48425bf"
|
||||
}
|
||||
import ast
|
||||
|
||||
text = (OUT.parent / ("moge3-reference/core__comfy_extr" + "as__nodes_moge.py")).read_text()
|
||||
tree = ast.parse(text)
|
||||
cls = next(n for n in tree.body if isinstance(n, ast.ClassDef) and n.name == "MoGeInference")
|
||||
execute = next(n for n in cls.body if isinstance(n, ast.FunctionDef) and n.name == "execute")
|
||||
assert "refine_steps" not in [a.arg for a in execute.args.args]
|
||||
assert "refine_steps" not in ast.get_source_segment(text, cls)
|
||||
extra = [f for f in b["fields"] if f["field"] == "refine_steps"]
|
||||
assert len(extra) == 4
|
||||
assert all("冲突" in f["effect"] and "没有此输入" in f["schema_default"] for f in extra)
|
||||
ns = ast.parse((OUT.parent / "moge3-reference/core__nodes.py").read_text())
|
||||
preview = next(n for n in ns.body if isinstance(n, ast.ClassDef) and n.name == "PreviewImage")
|
||||
assert [x.id for x in preview.bases] == ["SaveImage"]
|
||||
save = next(n for n in ns.body if isinstance(n, ast.ClassDef) and n.name == "SaveImage")
|
||||
assert next(
|
||||
ast.literal_eval(n.value)
|
||||
for n in save.body
|
||||
if isinstance(n, ast.Assign)
|
||||
and any(isinstance(t, ast.Name) and t.id == "RETURN_TYPES" for t in n.targets)
|
||||
) == ("IMAGE",)
|
||||
assert '"result" : (images,)' in (OUT.parent / "moge3-reference/core__nodes.py").read_text()
|
||||
assert (
|
||||
len(
|
||||
[
|
||||
f
|
||||
for f in b["fields"]
|
||||
if f["field"] == "output" and f["scope"] != "root" and f["value"] == "mask"
|
||||
]
|
||||
)
|
||||
== 4
|
||||
)
|
||||
assert "mode4" in "\n".join(b["flow"]) and "2048方图" in b["user_overview"]
|
||||
|
||||
|
||||
def test_grid_template_keeps_only_current_graph_effects():
|
||||
fields = [f for f in BLOCK["fields"] if f["node_id"].startswith("111:")]
|
||||
assert len(fields) == 17
|
||||
assert all("16/17" not in f["effect"] and "21重采样" not in f["effect"] for f in fields)
|
||||
assert all("mode4" in f["effect"] for f in fields if f["node_id"] == "111:110")
|
||||
assert len([f for f in BLOCK["fields"] if "第1支路" in f["effect"]]) == 12
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"total": 155,
|
||||
"audit_scope": "current_delivery",
|
||||
"source_files": 156,
|
||||
"target_files": 155,
|
||||
"user_excluded": 1,
|
||||
"source_structure_purpose_partially_reviewed": 155,
|
||||
"full_documents_completed": 0,
|
||||
"files_with_selected_named_fields_reviewed": 41,
|
||||
"selected_named_fields_reviewed": 1217,
|
||||
"real_executions": 0,
|
||||
"states": {
|
||||
"pending_check": 16,
|
||||
"needs_conversion": 139
|
||||
},
|
||||
"named_values_preserved": 1217,
|
||||
"unnamed_widget_nodes": 3660,
|
||||
"semantic_batch_files": 139,
|
||||
"semantic_batch_without_named_fields": 114,
|
||||
"semantic_batch_named_fields": 490,
|
||||
"named_values_without_manual_field_review": 0,
|
||||
"named_values_without_verified_units_ranges_effects": 1217,
|
||||
"scope_limit": "人工结论与机械原值清单分开;源语义局部审校非完整说明定稿"
|
||||
}
|
||||
@@ -0,0 +1,728 @@
|
||||
{
|
||||
"base": "a7ea35daecd51369d28e42e92536252776ea5d7b",
|
||||
"files": [
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/minimax_h3-Turbo_Text2Video_20260813_API.json",
|
||||
"sha256": "55c6d0e7fb323e05c3d9373606607e0e8fefb3127cac356b03e29f19b7aaa4ed"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/Krea2_t2i_20260818_API.json",
|
||||
"sha256": "dcf5fad9b464e4154d8ec7ba7af1c21987cb0153c7df747266a02de9f24e1313"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/video_minimax_h3_r2v_2ref_API.json",
|
||||
"sha256": "56ab7cbf2402f94000eb1df2b5415f90f36a2821e68f1c35af17a2d9498e7c49"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/MiniMax-H3-Turbo-R2V-Extend-2Refs1Vid_API.json",
|
||||
"sha256": "080a17d7ae079f278518de1af15b880a4404105ec89edbac4fd82cf16097b757"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/video_minimax_h3_r2v_4ref_API.json",
|
||||
"sha256": "0b00bfc29ad48f8af3c7b6ebc1dcaa03b809b33c24bc31dadc628289480b154a"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/video_minimax_h3_r2v_API.json",
|
||||
"sha256": "29f440f7123b9ce64e0fda01ee3cdafb7f87408c47c1fe46c2b73f88682eae0c"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/krea2_T2I_CharSheetV1_API.json",
|
||||
"sha256": "6a991229721d0a501846bf0bc55f793d1ab5225be28b2c9eea485fed56ed5b40"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/video_minimax_h3_r2v_5ref_API.json",
|
||||
"sha256": "0b6c1bee6507c2485aa115d3b6c038c6c3dabf1ce8569205f8ece50e58f4e909"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/video_minimax_h3_r2v_3ref_API.json",
|
||||
"sha256": "2a687133f175180584ebfc3b4318f29cfcac3a24a0f422e1b9c77e6b16c9862a"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/minimax_h3-Turbo_Image2Video_20260813_API.json",
|
||||
"sha256": "3d895b01e72c10008c036a9c65fa281b3dfe0d0808417089960fd8f4b56c48ce"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/1-语音生成/Qwen3-ASR-语音转文字.json",
|
||||
"sha256": "958a3b7cb7070f4207901c79f13863b44ffcd0ed5c2c7fb4cd779e7964da0d65"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/1-语音生成/Qwen3-TTS_语音设计+语音克隆.json",
|
||||
"sha256": "9c75272e418064f46da96f6167448216a9390566e4b5d5e168d8cc5955447ab1"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/1-语音生成/index-TTS2-情绪控制-音频参考-文本控制-克隆-多人对话.json",
|
||||
"sha256": "d2c469a8a17c6d1fcffb9a96700c38290895873d99c40d13d669bd45f6ea79de"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/1-语音生成/Qwen3-TTS_多角色对话.json",
|
||||
"sha256": "549a6502b3e0d4386323e6e67d6a9b4943b7a01eb59bdbe7adc7a920cfe5b690"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/1-语音生成/Qwen3-ASR-Subtitle语音转字幕.json",
|
||||
"sha256": "47f9afa955a6a5dce37000cb6a15bac7516d26ff50b6398bda334c825552cfd8"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/肖像大师_美女提示词生成.json",
|
||||
"sha256": "4ff20f7350813ec74fc054971b4532200d61661951c103c89f7729f89f7be2ff"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/6-动作迁移/Wan_Animate2_动作迁移_for循环长视频.json",
|
||||
"sha256": "22b7853e22629822dd354b0b768e2961a53b4c2f480cfaceeaea9dc51c0f0d0b"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/6-动作迁移/Wan2.1_Scail-2_动作迁移_WanAnimatePlus_v4.2.json",
|
||||
"sha256": "f0da1e6c1eab5706d29d8d12897db0cea0d9d5f7a73b4882cf07ef2a626dda45"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/6-动作迁移/Wan2.2_Animate_SAM3-人物迁移-动作迁移-长视频循环(KJ流).json",
|
||||
"sha256": "3ea95e56f193c046937ad246087292865a809d2cc26571357c22fff415295f41"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/6-动作迁移/Wan2.1_SCAIL2_角色迁移_动作迁移_FOR循环长视频.json",
|
||||
"sha256": "60d7a6c9b1b567d726ffd0981de3d8afb3675f88b320733d8442081d849b0ba8"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/6-动作迁移/Wan2.1_Scail-2_角色迁移_WanAnimatePlus_v4.2.json",
|
||||
"sha256": "395dc48ad21d9da6a3a815654922193a9893696015154f53be0cc6f484882637"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/6-动作迁移/Wan2.2_Animate_人物遮罩替换(官流整理).json",
|
||||
"sha256": "394c3c31ad05255d3eb130f309d8445764f4d3772b40fa07fbf19708bfcc1002"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/5-数字人/Wan2.1_I2V_InfiniteTalk_提示词调度动作控制图生视频数字人(KJ版).json",
|
||||
"sha256": "98b4c399948f99aeac9326b4de9638d9a7bc3d718edd2561ab745f6bec12478c"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/5-数字人/Wan2.1_infinitetalk_音频驱动视频配音-单人for循环长视频(官流).json",
|
||||
"sha256": "ebd0c2823b70e5121f9642f781f2d0fa32cda6abe7d4a68fb0eecacc30e92d06"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/5-数字人/Wan2.1_I2V_InfiniteTalk_rCM_数字人对口型多动态(KJ版).json",
|
||||
"sha256": "90fb512939d5bbaebfd3462d8edd019ad388611951748e6df09993ddd7f3a36f"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/5-数字人/Wan2.1_infinitetalk_音频驱动视频配音-双人for循环长视频(官流).json",
|
||||
"sha256": "87412366e6bedd2a2f4490d1a945d0fc005251bb49a20e4ba1157cd6c4ddfbcd"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/2-音乐生成/minimax_music_文生音乐.json",
|
||||
"sha256": "0a655ead5a0da406159dceb46451439df0c02050becaaa25b3018abb41840284"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/2-音乐生成/ace_step_1.5+Qwen3.5_自动歌词音乐生成.json",
|
||||
"sha256": "518085b1e8d12257e68427dcc0f01e6cda5018ec353fd90fdf366afb4fc89b85"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/2-音乐生成/ace_step1_5_xl_turbo_8Step极速音乐生成.json",
|
||||
"sha256": "668fae23de5f84cc530fa4cab7381299cbc787b30c4597345b47e7f5c17415ef"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/sam3_图像视频-提示词遮罩分割.json",
|
||||
"sha256": "5dbe1a7ab608ba6e9158369ff6498e9bb3f926d151a0ed31cf711c31b167c488"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/双图像或视频合并显示.json",
|
||||
"sha256": "61a0b1a2aa17a7d8c4f09f4f57e276eaf37227f69b5fc5789193005e593548c9"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/图像分割-多宫格分割.json",
|
||||
"sha256": "aeceb3fd00eb0966eebf8d8c89d90e2ad29d0aa8d02589aa05d52a6c145a4bcc"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/Minimax-H3提示词增强.json",
|
||||
"sha256": "ffea53b27d52c63aa9ec9c60144489cc4f9e5a44d9478bcc297be9d9008f1a4c"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/视频转gif动图图片.json",
|
||||
"sha256": "39f7ddf60bf5958882215bd4227a85707f1f9003f2c5aaefc709a28b1ef16827"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/加载本地latent解码.json",
|
||||
"sha256": "1fd83bd3f2d7950440189932b4c17718190af88daa4a93ac86474081dea9005b"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/图像4种添加水印节点.json",
|
||||
"sha256": "2eecd407d667d2ef6249061181edfdcfc417a2151627622f280d74aaac1794d8"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/手动按分镜视频截取.json",
|
||||
"sha256": "381bb5f3a6e2788d0dd3ee9594a97eaedb153611194d4f8fdde420cf47814132"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/图像合并成四宫格.json",
|
||||
"sha256": "fb5e5b346d51a79c19e611b76d39cf4b9491493723684bbb85ab3c49923467bb"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/多视频合成分屏展示.json",
|
||||
"sha256": "3c2f6558c199a7689546dc881df2b26dc31c02715fbc7b32f51caaa4601c13d7"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/ControlNet_aux_常用样例.json",
|
||||
"sha256": "8898689d777330c4749a079cd762f573bb12a278c47a2fefbd066ffbdc122b6b"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/birefnet_图像移除背景.json",
|
||||
"sha256": "a6799c5022c13e46d2b1cf27809cd3c1e1d140a605fa226c19359682751fd036"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/截取视频每一帧.json",
|
||||
"sha256": "43858b9121439a92e7ab35c2fb62b78e56fa93bcd0ad62679f2387f71fdec1fa"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/音频人声分离.json",
|
||||
"sha256": "3c4bc0f7b1891e298a5d4e00072c6243a61b98d5fc0d86d82a476ecead43a1a2"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/图像嵌入文字描述.json",
|
||||
"sha256": "938ad9ad0eed2253e9a5a9a9dc16dc6b0a22bf976a80af90aa1d0b56e42ba7d3"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/视频-音频分离.json",
|
||||
"sha256": "4861e3e33291ed962d2215b1d8cc976a4706d19719e3541e9cbb2c636683afc3"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/视频倒放.json",
|
||||
"sha256": "8c760ea58d7ff664323f92a1174fe88300cd931c00201ccf437df1ad0067cb24"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/音频转MP3格式.json",
|
||||
"sha256": "c46e83b4fe8fc291e9de45b4af6cc50b566ab9377a51b50767315917dd13861b"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/加载图片合成视频.json",
|
||||
"sha256": "f5245d225f77cd64aefe6d0b8bb9342ec48a8a6293a533d65ea7304ce1b03f93"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_孤海智能一体化(多合一简化版).json",
|
||||
"sha256": "827f43d5d9bdb6f2d6f4d8b69e86708e6d08642ed0df04bee15087d10b9a0e35"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_双采样多段循环-PV动画尾帧衔接.json",
|
||||
"sha256": "c8a442bd8cae8dcd75a6a01847ca99b75dcc37ef8ff0a855c82213ed25e943e0"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_短剧创作-多宫格分镜参考.json",
|
||||
"sha256": "d2850f5fb3e5b54e3e4ec9e17f34bdb11bf7009728b5e585c769fb2f11f80275"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_视频人物替换.json",
|
||||
"sha256": "dce57cfc239c9f90cda2107fff5614b2cb0944e0441d9d8137b3f1c325f41a7a"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_音频MV_多参长视频分段_Selflift双采潜放大_Qwen3.8官方Skills自动提示词.json",
|
||||
"sha256": "bdc93d36fb8a4728dfa8031d1f00782d68e8e6aedd718b166f57e54216f2882f"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/Minimax_H3_T8双时钟采样_图生视频-8步高质量极速版.json",
|
||||
"sha256": "97f188c9295af0dbe6358a4b23117ca1612e812d2fa3df67dd7b10ee68e96fb5"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台MiniMaxH3_多合一多分段拼接.json",
|
||||
"sha256": "34fde3a91f9ef932adc2837cc9d4254bf75a3251ad5c6474d90e4085690cbafc"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_FastH3_t2v_文生图8步极速.json",
|
||||
"sha256": "ed4a30da03245f35ff9006ac64cd045c1b9c64eb8b585520dbbb418f6793fc78"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/Minimax_H3_r2v_参考生视频_双采样潜空间放大+Qwen3.8官方Skills自动提示词.json",
|
||||
"sha256": "4c1305fdfe6d5643e64a7b6c99cc92e331ffc9475f30fef5e0119c887367aab0"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_文-图-参考-分段循环-双采放大_多合一.json",
|
||||
"sha256": "698430e2b234a107b15f1bebf7704833afeea819bd21a3af56f7121daa1383e0"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_视频参考+多参图.json",
|
||||
"sha256": "40f92a22aa66c9d87b876784e33b02471339d64504e22e1672155608fbcbf079"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/minimax_h3_i2v_图生视频.json",
|
||||
"sha256": "a071e6070ee933396f225b4447c363bbf6b0df059b3cd43da567e81bc7937e84"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_文_图_首尾_参考多合一(单采样).json",
|
||||
"sha256": "526986a02875bbefebeb8a81cce9b58a8e764ab0c0092b2d8e858ecfac771638"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_短剧创作-音频参考.json",
|
||||
"sha256": "c188a7383a6c7a0dbd5d4d0717527b096ec73c1232373ee50c731bceefcfe7fb"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/minimax_h3_t2v_文生视频.json",
|
||||
"sha256": "039d46a5bbb809b84fab3b42c777118f91d0c06835555d54410631742584f1be"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_FastH3_i2v_图生视频8步极速.json",
|
||||
"sha256": "c5eff277eeeeefacb39c4af2e5ac41251785cc18ca90c1678a653367f4dd5942"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/Minimax_H3_T8双时钟采样_文生音视频-8步高质量极速版.json",
|
||||
"sha256": "5b45b49ebe4402c207e7d894e03a1bb53482b24a0c09ce50d549be4a01f9c6d0"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/Minimax_H3_T8双采样_潜空间放大_参考生视频.json",
|
||||
"sha256": "fab48be409cf423aaed7be268c6655ae39ecd1733218413c51874c5ba2ad0bdf"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_双采样潜空间放大.json",
|
||||
"sha256": "2434bd48e3c29abf9e6ed0931f3c8825481772a134a065f6cfdd3c0b89ba81b7"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台时间线素材_双采样潜空间放大_多分段拼接.json",
|
||||
"sha256": "172eb8af3aca70082941427520fdcca06568957bab3d39101c5e9d6641b45e4a"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/Minimax_H3_视频动作参考_SelfLift双采样潜放大_Qwen3.8官方Skills自动提示词.json",
|
||||
"sha256": "2be3981360fff849a53a928a6a2040c97bcf1944dce2df82d716a805c0ef2594"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_多参考_双采样潜空间放大.json",
|
||||
"sha256": "8b97388e142ddb67c84f2cbe0bb68c10f519e7615d75f1ea0005580fe4537ab2"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/minimax_h3_r2v_多参生视频.json",
|
||||
"sha256": "89166eb9cce4c9177a0f9a0a3a058e140429413e7beb3692e7ee5c30b76bc4fb"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/Minimax_H3_音频数字人_单采样.json",
|
||||
"sha256": "77b665bf6bcd11195f424d42d88f5142b43b0c608af776eef5744aca896f4b56"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_视频参考+多参图-SelfLift双采样潜放大.json",
|
||||
"sha256": "97ec7f73f32126aa24798fc65736734dfa839b74d25c4b2a94021abe063f06d7"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_音频数字人_SelfLift双采样潜放大分块_Qwen3.8官方Skills自动提示词.json",
|
||||
"sha256": "903e32248fc0c53df36c5841f4f4ccdb5fb8190a39c6c9015d3e55a451aaf7eb"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/Minimax_H3_T8双时钟采样_参考生视频-8步高质量极速版.json",
|
||||
"sha256": "fae96106a128342a6903bd32680463d1be98c0d5ad738d2fff40fc0f52a35389"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/uncensored/minimax-h3多参生视频无审核版.json",
|
||||
"sha256": "e501089f36c4c7f76a9e926e09ab9c467316d0778e62dff4c9e9faa6b155cb83"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/uncensored/minimax-h3首尾帧生视频无审核版.json",
|
||||
"sha256": "d47d3e995858a9c581863a593d89d4f6a24ea04014a1df3faeffa7e07cb19537"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/uncensored/minimax-h3文生视频无审核版.json",
|
||||
"sha256": "07baed6dd4a259701f7e5563fa1f19799fbbb558668d09a74876db3729fff3a2"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Anima/Anima_Klein放大_超强动漫模型.json",
|
||||
"sha256": "000843bc0e46844e556b04fc820ae1b2f7fa9bba1dd0ec21805c0c7ab27a647c"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_赛博朋克现实风格.json",
|
||||
"sha256": "a353acdb89b02462abed5f1513acfcb4f538c50ab5bc8ede8e8597f3ce8eea60"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图.json",
|
||||
"sha256": "6b317af2bda225d9441074ef330669b4537e95c705987223efafd2705dbbc344"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_细节增强.json",
|
||||
"sha256": "faa28f85fbd80ec9c3aba76749d6447c1d3b4a8489c88853ebde665a4f78ef10"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_2万提示词随机模板+4千种风格选择.json",
|
||||
"sha256": "599bb58d48d68de929e7ec476f77e9f7c736c00235b68570416d214d3b4e391c"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2-Edit-Anything2Real_动漫转真人v3.json",
|
||||
"sha256": "0d482e6c6fac70af6dd5549e8a464ee080a0ec135350d72d32a4ce4a8fd05bbe"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_图像风格参考.json",
|
||||
"sha256": "8c248ccc44df79b475c81e0bb260596ece066d65f2a21c0b2a72dc6b2441b170"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_Qwen3.5自动提示词生成.json",
|
||||
"sha256": "afafb0e0ebdc445a7534041589b7f6a580e0b15b8293c2fd26907474892f5957"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_动漫风格2.5D半写实.json",
|
||||
"sha256": "3faf9b1f0a20c7d21367af1721583a7402f048e18991025f9afff192ff8fe077"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图 (N版).json",
|
||||
"sha256": "935fc592ead1a89614470d41c512e2d7b4a41a6887f71a0a8d8f4c071a60e3c9"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_动漫风格线条动漫.json",
|
||||
"sha256": "9bab028943604b4b167a56dcc51475f67bac897c9eae3c7bf9d311b2c5cb7d91"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_美学质量增强.json",
|
||||
"sha256": "fbca5f24abf71f10ed5e2b90012aab1c25c6632a18541fbf0412b8845f603b85"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_identity_edit_图像编辑.json",
|
||||
"sha256": "c208883f17eb873063a4febaef636f0fa065131fc82bc4b0b26eff41f442719a"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_极致写实(N版).json",
|
||||
"sha256": "ec98804940c28956af1719096751bba2d274eef8a251b97207ac655a05779384"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_动漫风格Image2风格.json",
|
||||
"sha256": "bf65d0080ab80a5934855a0dbc7a5e167300bb54e24a18e05e4321a70ec838ea"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_奇幻现实风格.json",
|
||||
"sha256": "7a2af26c48114c7f1a7741a5cded07c0cceb68c4e69410de8af6429eb6b5041c"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/Krea2_turbo_文生图_角色三视图双采样2k版.json",
|
||||
"sha256": "64bb5eb4e5399d307c12553717b8a1f0046f48b625b16e62d40e962b6bec1847"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/Krea2_turbo_文生图_4_6_8宫格故事板.json",
|
||||
"sha256": "776b2f92f8906232c2ffe1b25c8b9cfe3398bfe45a9f80715f6ce5acc03e96b4"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/Krea2_turbo_文生图_极致写实双采样2k版(N版).json",
|
||||
"sha256": "50433cee0d5bab60a2cce44d73adbe5fe9b486c039bc89e1caef640fe6e0b28d"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/7_Z-image+Controlnet_图像扩展.json",
|
||||
"sha256": "82cda5dca2e224a5b042daecba4c3c1405a825648a9e9ced29fe21e58f7e55f8"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/9_Z-Image+Flux2-Klein_风格重新编辑.json",
|
||||
"sha256": "3734f261691c3ad13d29b30d88e91f671d9c548f723e77d78651c7155b06c408"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/8_Z-image+Controlnet_姿势控制-洗图.json",
|
||||
"sha256": "babc1dbeb3bb4981e338d8317ff9fb6fd8c28913bf47a2e2e3eb5409439447bf"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/6_Z-image_局部重绘.json",
|
||||
"sha256": "f60e734b6ed9e678571ad7666411d6282065c38abe3e9c29ea4c5cc1c3455505"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/5_Z-Image+Qwen3.5提示词反推_文生图.json",
|
||||
"sha256": "910317a123e658f26e48ad5cd144d28b7f31e0d43cbdb3ed567048c7917b5c73"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/10_Z_Image双采样+Fluax2-klein修复-高清直出.json",
|
||||
"sha256": "043cd2abe731996b80637d87b9a799e412e08b9a15e4b7c2f4440fbcff2487b9"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/Z_Image_turbo_十八种风格_通用b.json",
|
||||
"sha256": "8d9e66744e0266c5f53a6396e030c38bb90053f2525ac9c3c6cc1b321006a976"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/11_Z_Image_Turbo+模型放大_图像4K高清放大.json",
|
||||
"sha256": "baaa0cd969a28abe5e6ab19b3d7f6e161468cd15c970fe4bd9922afbe09ab4da"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/12_Z_Image_Tubro_文生图_SeedVR2高清放大8K.json",
|
||||
"sha256": "8d79bcd44a7843ac5df9fbcd372a6327ba72274260ef463c46ec85709da7846a"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/1_Z-Image-Tubro_文生图.json",
|
||||
"sha256": "36713b1a3f5c4f2992c7edef2e1e8c3246d44d28ecc750b87f4353a08c3b5ab0"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/Z_Image_turbo_十八种风格_照片摄影.json",
|
||||
"sha256": "740d7d41b3248978dca2046d9a2ea99d3a66ef081d45609782d2847f04f7e0c8"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/Z_Image_turbo_十八种风格_通用a_.json",
|
||||
"sha256": "e58341a99587077a69baf3cec62d9ae7bb0ce02a87cb3973ce3134c04a119b23"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/2_Z-Image+Base+Turbo+双重采样工作流.json",
|
||||
"sha256": "27108ae85715b147f63d8640ee032484c70a21633e2c6234eed346079b9aba2c"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/4_Z-Image+Qwen3.5-文生图.json",
|
||||
"sha256": "56bd28b5253fe734e851abd81c7851d00c62e4dbf37a22d97781d93ec367a35d"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/Z_Image_turbo_十八种风格_插图漫画.json",
|
||||
"sha256": "02ea31b959de72f9b5c00a92f21b4e17bbc2bf5a54495093a204957771a88039"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/3_Z-Image_文生图(摇光梦幻).app.json",
|
||||
"sha256": "58e88cacc6e1375cad39023e39eb1728eb36e63acce3c46fca40898d706b1d42"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_图像编辑_提示词增强.json",
|
||||
"sha256": "ebf173eb9d871717534a379d451d4a08ca06c3b677b552de12a5d51dbe8febf2"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_文生图_角色表四视图.json",
|
||||
"sha256": "6fd307b02b7ba29858723e283580c1cf4ab1fce8804a3ced1f4fc37934965392"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_图像编辑_角色BFS头部迁移.json",
|
||||
"sha256": "6a9da127ee2bccafeff7499ab3d62f349aec1eff4265cb211bdec578dba1fe7b"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_文生_多图编辑_8步lora加速.json",
|
||||
"sha256": "172b8fff0b531fbea367e79aa6b5ed1e6b59cab2ce6cb23d324092d5b55a3f97"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_图像编辑_角色表四视图.json",
|
||||
"sha256": "0036c02e1ab22f44c94bd9f311d5254d7b3b0cea25211bc4ff1e92cd90e0acdf"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_图像编辑_深度-姿势-线稿-硬边缘-控图洗图.json",
|
||||
"sha256": "b6e232082089dd9c4046e0dc5bd1d046907525b8cb01758fb804b5f4aa11275e"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_图像编辑_动漫转真人.json",
|
||||
"sha256": "1aa1d3641f82533f99d99567c2708919438b9efbfc6623d684a9a88b876b75cd"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_文生_多图编辑_透明背景.json",
|
||||
"sha256": "5853f21657d56e97a6b625c4487e23473b846fa8c96dc292f3700b3075245a39"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_文生图_提示词增强.json",
|
||||
"sha256": "dfe10917d101bf1a8a8c20750f4360690ecd478e9eb33d16a59ea0c6f12c086c"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_图像编辑_背景移除.json",
|
||||
"sha256": "d225102993ad5aa08e619bd7f1e5abbfd54e2d5ac8d8be1eacf09722107c4c9e"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_Image2.1_图像编辑_VNCCS任意角度-任意姿势.json",
|
||||
"sha256": "a5a675500a473214eaeb1d25dc1eda83b57bba3a17d18f1f0042bee62b474314"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_图像编辑_一键16张姿势图.json",
|
||||
"sha256": "248b6c5ae28d5a44035c5ad91bcdfa458360a67598eaa4d195c3fb6853b18a49"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_文生_多图编辑_提示词增强(N版).json",
|
||||
"sha256": "ae6521e5f42bef0b887f754c2fec5961d612afc464fbd98940a976a9795662c6"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/5_flux2_klein_图生图_扩图.json",
|
||||
"sha256": "ad8c09e81b07aa7809a7d42f633d0b9069f704187e7a983bc2ac12bc3cbb8507"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/10_flux2_klein_文生图-角色三视图.json",
|
||||
"sha256": "e04e5bd04f03ce32b5221d37c5f7cffb0405b1471cb7be90b47b407d900a49b7"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/flux2_klein_图生图_人物迁移.json",
|
||||
"sha256": "81409bdcd546102a7a6d5b7e32578912bf7ad4f89b35718de0401ceed624225e"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/4_flux2_klein_图生图_局部重绘.json",
|
||||
"sha256": "d1d57bd401959975cbe6fd70f97706cec21bbed0a5ec3747447b9f192631f414"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/1_flux2_klein_文生图.json",
|
||||
"sha256": "523905ac41323c626d7a156c88d02156cfa4758a70175cd7a3fba2a8c4fd449b"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/flux2_klein-图生图_人物动作迁移.json",
|
||||
"sha256": "fc6daf483ac05fdc904ca402271223d14cc217ea4c81a17ba2ef4cae993aefe7"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/3_flux2_klein_图生图一致性增强(大雄lora).json",
|
||||
"sha256": "c6af28d5bd72df5577f1e4d336974397494dd500fff23efd4afe81037514be71"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/6_flux2-klein+Qwen3.5_转线稿洗图.json",
|
||||
"sha256": "40a9fee073066914ac610f74dc7f7a49022bda63f5b89560d4bd635094a5c757"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/8_flux2_klein_双图编辑.json",
|
||||
"sha256": "9d00eb7af7e8d49c54396e6dc2afe7770f99cf75ae765dc1b906c8c9e6b69d83"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/flux2_klein_图生图_印花提取.json",
|
||||
"sha256": "8768dec340e35dbd70f928d8bbc34813b2bd45f5c270c405d4495b92da478337"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/2_flux2_klein_图生图.json",
|
||||
"sha256": "c0472959097f4e785205f41109c941dab26d12a874311834a7dc02c4616bbe9b"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/flux2_klein_服装迁移.json",
|
||||
"sha256": "e3f01ba44f3628297e714b4307ed959758f04e0415093dc5ec690857384a8386"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/flux2_klein_图生图_老照片修复.json",
|
||||
"sha256": "922c534d70b85beacc2cd51354552ed1d850dbb611b20f2d6981c4e524ce06c5"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/7_flux2_klein_图生图-动漫转真人.json",
|
||||
"sha256": "8cab62c6b7b2401bb6b51ff4426aaad2a644fc6cfe49d974769fadf19c16a0a1"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/3_flux2_klein_图生图一致性增强(小志lora).json",
|
||||
"sha256": "43995837f89e5112afa74a57180dc356f7b4d4ef9e3a325984a2fc5ca1b7c651"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"sha256": "a50e8b9961fbdd83fa42ca121ff77b3c1b058c7e454ad374b0de7c60e7b8c4a9"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/人物骨骼姿势提取/sdpose_视频人物姿势骨架提取.json",
|
||||
"sha256": "4586c72d8a906d4a956fb7d62307b81e57e4e345324c7e73f63103e56bfffd14"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/人物骨骼姿势提取/NLF_视频人物动作骨架获取.json",
|
||||
"sha256": "1edc7ae5cca8e059577a9572d296c84e1683695e4f13a72388ff70473795ce97"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/人物骨骼姿势提取/openpose-video-姿态检测.json",
|
||||
"sha256": "43f76f599f15058b6e62ae0dfb105518a37532008eed23ef7118e4950b37a608"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/提示词生成与反推/Llama-cpp+Qwen3.5-提示词.json",
|
||||
"sha256": "9071928ce74d5133401942583603a6bc98873263fbe4c32a438fe73cee81ce90"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/提示词生成与反推/gemma4_提示词反推(图像视频音频).json",
|
||||
"sha256": "1a94bdd5987955a29e403d128c2ea5ca0b6bc8a8d5ece145e1baba07146588b0"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/VOSR2_图像超分放大.json",
|
||||
"sha256": "87484f700a9a18d1bffbc61834af2b489a58171dcb4a225e210e695a30c85dd5"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/RTX_video_upscale.json",
|
||||
"sha256": "ce189e5efdb1d608eaf7f7905f0dbf3776be2c199e143193c226ab497f2eb9ec"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/Seedvr2_3b_int8_图像放大.json",
|
||||
"sha256": "2be6b137efaaf25a54aaedc841a14ff3089afdc8a01a04af6353634b8457393f"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/VOSR2_视频放大_分批循环长视频.json",
|
||||
"sha256": "0f55316d2961a293a7d9f77b7993fd6f01bd5a41a4dca58f69f4d0b35c0aa6ea"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/Seedvr2_视频放大FOR循环长视频.json",
|
||||
"sha256": "576a9516292ed3e63b50c2a03fbfc1a99f9d643f526dc7fa3b98f6cb9832c893"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/图像放大比较.json",
|
||||
"sha256": "1ca5938a963921b16c96649a97d3b1a9f75d810d3aabcd7ce472a30e5805f3e4"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/Seedvr2_3b_int8_视频放大.json",
|
||||
"sha256": "06c427c688c13b87ed5724ac6b1ed432c31f8ea6c44212b3e7596b94128619da"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/RTX_image_upscale.json",
|
||||
"sha256": "35bf9b7731e6199b5ccc113e31c248573f9ae74d1bb9302071a3a97524fea8c4"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/视频模型放大插帧(简单快速版).json",
|
||||
"sha256": "bf47ba2462a3f683fe4f1d742b7dcde81a7a3f95e7e63c021e942a6c4f9ef071"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/supplied-api/02.api.json",
|
||||
"sha256": "daa40971b730076691721afe95e165932df94e3423f1fc44dcb7707026e7125b"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/supplied-api/01.api.json",
|
||||
"sha256": "0ed76e088a23af43d6fecbf273fc0a983d7112e2b046d347f715afffac56d57e"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/supplied-api/07.api.json",
|
||||
"sha256": "b1b4f6a6c02d8d21701943c67b62805b1210fed17e7e26b618c58e112ea1d70d"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/supplied-api/06.api.json",
|
||||
"sha256": "3e9176a5346ce8b8122b6da10f377fbeb894dc7c2c82a415f85ffc0dbfefc90b"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/supplied-api/04.api.json",
|
||||
"sha256": "2066b07b2ca5390ba3e795df6b43934dab83865b12870b6ff26d8c0ef24f091e"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/supplied-api/03.api.json",
|
||||
"sha256": "91e6c2cea3747a03bbb71f661dbd016b28040781482b956365ff76a7a8b647ce"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/supplied-api/05.api.json",
|
||||
"sha256": "95a01c1ea27a8279a6dc202820505099a94161d91e0789189b61208b09007af8"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/registry.py",
|
||||
"sha256": "0382eda52a31f23c1c29dd7a62d0ffc93e10fcbb88872a5893b8fc93a2b2734d"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/library_cli.py",
|
||||
"sha256": "04bfa8cfbe3f9378e78594958973118ec95aa1ff0bcdbdf4da0311abbdbcd380"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/client.py",
|
||||
"sha256": "ce30b3b3587d8f0dac86d534b99f31b95f1f4d0acb361babb45fd2be9513fe72"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/output_map.py",
|
||||
"sha256": "36ed4ced825e4f7e1d389602085451b5cb9336b319d220f423f59f83fed6a70e"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/protocol_references.py",
|
||||
"sha256": "ab9d948dd1bbf83dfce27186d6e48d9c3d5dff129305afd760fb3e77570b2916"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/protocol_references.json",
|
||||
"sha256": "a10aaf98db9bb3b5ac6d1fc30b18c40cf315b34eee57ebb19470a6664e9221a4"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/routers/workflows.py",
|
||||
"sha256": "3f1d5fdacc841080973dcafb9cd87a42433ec19080a3ff14a29561f13d512c97"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/queue/worker.py",
|
||||
"sha256": "54f5505ae78802f77fedf23690579444c9ccfbb0949b32f9e96980e8d55c2d3b"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/h3-chain-evidence/library.json",
|
||||
"sha256": "667c09ebd5ba14c281366a1b9f7647d74f74e055a863b121d9324ac75a423cd4"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/media-evidence/protected-six-cases.json",
|
||||
"sha256": "c2b9dffd7f1a9c5f0de51c26c9dd81beedd3ad7f6b67a54aa3eb5cead55c8c5f"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/structure_reference.py",
|
||||
"sha256": "a9f3a8ed314a0c0a424c6781db4e83af3a85cb8b66b16b01380b5fecc3e1f0bb"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/serialization_reference.py",
|
||||
"sha256": "67724fac65acbd397198271e1ed17b91f592f52da7ce8299e575d4c597d57fa1"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/ui2api.py",
|
||||
"sha256": "86a9c98ad72afa15aaf706bab8b39589a1cbca2e93da40d0aed9f963c14c0d1f"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/h3_core_reference.py",
|
||||
"sha256": "2913654b6ec3dabac1d36b1894064b8e077dd1d743d546e81667b317339f8a5f"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/h3_chain_reference.py",
|
||||
"sha256": "a5c0ab92d99757c168648ddbc0418b23d2b871f674b153e9a240b75409cf5741"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/library.py",
|
||||
"sha256": "b9cbfce28267642e6db3ebe9d591cf8dd260c7772a5a21a8d36cb98915eca13c"
|
||||
}
|
||||
],
|
||||
"originals": 163,
|
||||
"old_thirty_seven_blocks_unchanged": true,
|
||||
"drawer_css_unchanged": true,
|
||||
"drawer_whole_file_unchanged": true,
|
||||
"drawer_sha256": "3e3c7602bae3a031e7fb1c38792f8ba5a1f37172e7b8850d304502ea1be010c1",
|
||||
"conversion_rerun": false,
|
||||
"profiles_28_candidates_9_diffs_6": "unchanged"
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
Building source distribution...
|
||||
Building wheel from source distribution...
|
||||
Successfully built calliope-backend/dist/calliope-1.5.8.tar.gz
|
||||
Successfully built calliope-backend/dist/calliope-1.5.8-py3-none-any.whl
|
||||
@@ -0,0 +1,612 @@
|
||||
"""MoGe3 editorial reference, bound to bytes; never a conversion contract."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
REPO = Path(__file__).resolve().parents[3]
|
||||
OUT = Path(__file__).resolve().parent
|
||||
REF = OUT.parent / "moge3-reference"
|
||||
PATHS = [str(next((REPO / "example_ComfyUI_workflows").rglob("moge3_*.json")).relative_to(REPO))]
|
||||
|
||||
|
||||
def canonical(v):
|
||||
return json.dumps(v, ensure_ascii=False, sort_keys=True, separators=(",", ":")).encode()
|
||||
|
||||
|
||||
def build(index=0):
|
||||
raw = (REPO / PATHS[index]).read_bytes()
|
||||
g = json.loads(raw)
|
||||
subs = g["definitions"]["subgraphs"]
|
||||
refs = []
|
||||
|
||||
def ref(directory, file, a, b, claim):
|
||||
root = OUT.parent / directory
|
||||
e = next(
|
||||
e
|
||||
for e in json.loads((root / "sources.json").read_bytes())["sources"]
|
||||
if e["local_file"] == file
|
||||
)
|
||||
data = (root / file).read_bytes()
|
||||
assert hashlib.sha256(data).hexdigest() == e["sha256"]
|
||||
assert 1 <= a <= b <= len(data.decode().splitlines())
|
||||
e = {
|
||||
**e,
|
||||
"local_file": "../" + directory + "/" + file,
|
||||
"lines": [a, b],
|
||||
"claim": claim,
|
||||
}
|
||||
if e not in refs:
|
||||
refs.append(e)
|
||||
return refs.index(e)
|
||||
|
||||
def new(file, a, b, claim):
|
||||
return ref("moge3-reference", file, a, b, claim)
|
||||
|
||||
front = new(
|
||||
("frontend__src__lib__litegraph__s" + "rc__LGraphNode.ts"),
|
||||
972,
|
||||
1043,
|
||||
(
|
||||
"准确1.52.7:具名恢复受namedValuesRestore"
|
||||
+ "条件;否则按可序列化位置恢复,后onConfigure;组合钩子"
|
||||
+ "未知"
|
||||
),
|
||||
)
|
||||
new(
|
||||
("frontend__src__lib__litegraph__s" + "rc__LGraphNode.ts"),
|
||||
1072,
|
||||
1094,
|
||||
"准确1.52.7位置与具名保存;不推测实际UE恢复顺序",
|
||||
)
|
||||
dto = new(
|
||||
("frontend__src__lib__litegraph__s" + "rc__subgraph__ExecutableNodeDTO." + "ts"),
|
||||
161,
|
||||
208,
|
||||
("准确1.52.7边界解析:无外线需widgetId/store," + "有线向外解析;本图空绑定与组合恢复未知"),
|
||||
)
|
||||
moge = new(
|
||||
"core__comfy_extras__nodes_moge.py",
|
||||
210,
|
||||
262,
|
||||
(
|
||||
"准确0.36.0五个控件schema/推理签名:没有refine"
|
||||
+ "_steps,源第六保存位置为额外refine_steps冲突"
|
||||
),
|
||||
)
|
||||
render = new(
|
||||
"core__comfy_extras__nodes_moge.py",
|
||||
265,
|
||||
329,
|
||||
"准确0.36.0五输出枚举、绿通道约定、深度/法线/遮罩分支;源内部mask与宿主缓存分开",
|
||||
)
|
||||
depth = new(
|
||||
"core__comfy_extras__nodes_moge.py",
|
||||
32,
|
||||
61,
|
||||
"准确法线回退与倒深度可视化:有限正深度,0.1/99.9百分位截断到0..1",
|
||||
)
|
||||
load = new(
|
||||
"core__comfy_extras__nodes_moge.py",
|
||||
64,
|
||||
81,
|
||||
("准确模型选择来自geometry_estimation动态文件列" + "表;本地安全读取权重,不提供自动下载"),
|
||||
)
|
||||
impl = new(
|
||||
"core__comfy__ldm__moge__model.py",
|
||||
267,
|
||||
345,
|
||||
(
|
||||
"准确模型实现:token插值/自动FOV/投影/可选metric"
|
||||
+ " scale/无效点处理;模型文件未读取,不能保证米制尺度"
|
||||
),
|
||||
)
|
||||
image = new(
|
||||
"core__nodes.py",
|
||||
1738,
|
||||
1819,
|
||||
"准确0.36.0 LoadImage动态文件列表/IMAGE与MASK/读取验证;未读取素材",
|
||||
)
|
||||
new(
|
||||
"core__nodes.py",
|
||||
1662,
|
||||
1736,
|
||||
(
|
||||
"准确0.36.0 PreviewImage继承SaveImage"
|
||||
+ "的IMAGE返回;写temp并返回ui和result,不是无数据"
|
||||
+ "出口或禁写"
|
||||
),
|
||||
)
|
||||
upload = new(
|
||||
"frontend__src__extensions__core__uploadImage.ts",
|
||||
1,
|
||||
len(
|
||||
(REF / ("frontend__src__extensions__core_" + "_uploadImage.ts"))
|
||||
.read_text()
|
||||
.splitlines()
|
||||
),
|
||||
"准确1.52.7上传增强入口;源upload=image仅辅助状态,实际组件/扩展恢复未知",
|
||||
)
|
||||
note = new(
|
||||
"frontend__src__extensions__core__noteNode.ts",
|
||||
1,
|
||||
len((REF / ("frontend__src__extensions__core_" + "_noteNode.ts")).read_text().splitlines()),
|
||||
"准确1.52.7前端注释;本系统按纯文本保留完整原文,不访问URL",
|
||||
)
|
||||
new("core__comfy_extras__nodes_moge.py", 442, 449, "准确MoGe静态扩展注册")
|
||||
new("core__nodes.py", 2070, 2090, "准确LoadImage/PreviewImage内置注册")
|
||||
new("core__folder_paths.py", 52, 67, "准确geometry_estimation模型目录注册")
|
||||
new(
|
||||
"core__nodes.py",
|
||||
2470,
|
||||
2550,
|
||||
"准确core扩展清单包含nodes_moge.py;不证明目标安装",
|
||||
)
|
||||
for file in [
|
||||
"core__LICENSE",
|
||||
"frontend__LICENSE",
|
||||
"frontend__src__lib__litegraph__LICENSE",
|
||||
]:
|
||||
new(
|
||||
file,
|
||||
1,
|
||||
len((REF / file).read_text().splitlines()),
|
||||
"准确原件许可全文;仅读文本",
|
||||
)
|
||||
old = json.loads((OUT.parent / ("grid-document-evidence/definitio" + "n-0.json")).read_bytes())
|
||||
|
||||
def grid_spec(cls, name):
|
||||
f = next(f for f in old["fields"] if f["class_type"] == cls and f["field"] == name)
|
||||
z = {
|
||||
k: copy.deepcopy(f[k]) for k in ["label", "schema_default", "unit", "limits", "effect"]
|
||||
}
|
||||
ev = []
|
||||
for i in f["evidence"]:
|
||||
e = old["sources"][i]
|
||||
if e["commit"] != ("63d1bbdb407c69370d407ce5ced6ca3f" + "917528a8"):
|
||||
continue
|
||||
ev.append(
|
||||
ref(
|
||||
"grid-reference",
|
||||
Path(e["local_file"]).name,
|
||||
*e["lines"],
|
||||
e["claim"],
|
||||
)
|
||||
)
|
||||
if cls == "ImageStitch" and name == "direction":
|
||||
z["effect"] = "第二图按right/down/left/up拼到第一图;缺第二图" + "时直接返回第一图。"
|
||||
if cls == "ImageStitch" and name == "spacing_width":
|
||||
z["effect"] = (
|
||||
"保存0不插间隔;正值在两图之间添加色条。"
|
||||
+ "原110为mode4,不能由缓存推定最终像素间距。"
|
||||
)
|
||||
z["evidence"] = ev + [front]
|
||||
return z
|
||||
|
||||
def spec(label, default, unit, limits, effect, ev):
|
||||
return {
|
||||
"label": label,
|
||||
"schema_default": default,
|
||||
"unit": unit,
|
||||
"limits": limits,
|
||||
"effect": effect,
|
||||
"evidence": ev + [front],
|
||||
}
|
||||
|
||||
specs = {
|
||||
"resolution_level": spec(
|
||||
"几何估计细节档位",
|
||||
"9",
|
||||
"离散档位",
|
||||
"准确schema 0~9;0最快/9最多细节;不是像素尺寸、精度或耗时保证。",
|
||||
"控制估计细节;准确实现据档位插值token数量,四支路独立保存9。",
|
||||
[moge, impl],
|
||||
),
|
||||
"batch_size": spec(
|
||||
"一次推理的图像数",
|
||||
"4",
|
||||
"张/次调用",
|
||||
"准确schema 1~64;降低可减少批量内存压力,未测显存上限。",
|
||||
"限制每次推理分块的图像数,不是四支路数,不保证共享模型或免重复推理。",
|
||||
[moge],
|
||||
),
|
||||
"fov_x_degrees": spec(
|
||||
"源相机水平视场角",
|
||||
"0.0",
|
||||
"度",
|
||||
("准确schema 0.0~170.0、步长0.1;0自动恢复;原" + "JSON保存int 0不改float。"),
|
||||
"水平视角用于反投影焦距;0传None自动恢复。原图片/相机未知,不能当准确标定。",
|
||||
[moge, impl],
|
||||
),
|
||||
"force_projection": spec(
|
||||
"按深度重新投影点",
|
||||
"True",
|
||||
"布尔",
|
||||
"准确schema True;开启时由depth和intrinsics重建points。",
|
||||
"保存true;准确实现使用深度和内参重新投影点,不等于实际几何已验证。",
|
||||
[moge, impl],
|
||||
),
|
||||
"apply_mask": spec(
|
||||
"把无效几何区域屏蔽",
|
||||
"True",
|
||||
"布尔",
|
||||
("准确schema True;无效points/depth设inf" + ",有法线时设零,mask仍独立返回。"),
|
||||
"保存true;作用于模型预测的无效区域,不接根3.MASK,也不是宿主最终输出选择。",
|
||||
[moge, impl],
|
||||
),
|
||||
"refine_steps": spec(
|
||||
"额外细化步数保存值(接口冲突)",
|
||||
"准确0.36.0没有此输入/默认",
|
||||
"源名暗示步数,准确实现未证",
|
||||
("源具名refine_steps=3及输入口存在;准确schema" + "和execute均缺该参数,不借新版补。"),
|
||||
"这是源额外保存位置和声明输入;保留冲突,不能解释为实际细化3次或合法执行参数。",
|
||||
[moge],
|
||||
),
|
||||
"model_name": spec(
|
||||
"几何估计模型文件引用",
|
||||
"动态文件列表;schema未指定固定模型",
|
||||
"文件名",
|
||||
("准确目录geometry_estimation;选项依赖目标文件" + "系统;属性URL不作下载授权。"),
|
||||
(
|
||||
"保存moge_3_vitg_fp16.safetensors;实"
|
||||
+ "际权重/架构/尺度/显存未验证,不能由文件名保证版本或效果。"
|
||||
),
|
||||
[load, impl],
|
||||
),
|
||||
"output": spec(
|
||||
"几何结果可视化类型",
|
||||
"depth",
|
||||
"枚举",
|
||||
(
|
||||
"depth/depth_colored/normal_openg"
|
||||
+ "l/normal_directx/mask;准确实现缺对应张量时"
|
||||
+ "抛错。"
|
||||
),
|
||||
(
|
||||
"depth为倒深度灰度,正有限深度按0.1/99.9百分位裁剪归"
|
||||
+ "一化,较近值趋亮(非恒定/退化情况除外);depth_color"
|
||||
+ "ed用Turbo色图。normal先取预测法线否则由points"
|
||||
+ "导出,准确实现乘[1,-1,-1](OpenGL)或[1,1,-"
|
||||
+ "1](DirectX)再映射0..1;mask扩为三通道。不承诺"
|
||||
+ "物理距离、几何重建或线稿生成。"
|
||||
),
|
||||
[render, depth, impl],
|
||||
),
|
||||
}
|
||||
fields = []
|
||||
comments = []
|
||||
zero = []
|
||||
hosts = {s["id"]: next(n["id"] for n in g["nodes"] if n["type"] == s["id"]) for s in subs}
|
||||
scopes = [("root", "", g)] + [
|
||||
(s["id"], f"/definitions/subgraphs/{i}", s) for i, s in enumerate(subs)
|
||||
]
|
||||
for scope, prefix, graph in scopes:
|
||||
for ni, n in enumerate(graph["nodes"]):
|
||||
base = f"{prefix}/nodes/{ni}"
|
||||
nid = str(n["id"]) if scope == "root" else f"{hosts[scope]}:{n['id']}"
|
||||
cls = n["type"]
|
||||
w = n.get("widgets_values")
|
||||
named = n.get("widgets_values_named", {})
|
||||
if cls == "MarkdownNote":
|
||||
comments.append(
|
||||
{
|
||||
"node_id": nid,
|
||||
"pointer": base + "/widgets_values/0",
|
||||
"named_pointer": base + "/widgets_values_named/text",
|
||||
"text": w[0],
|
||||
"meaning": (
|
||||
"作者给出子图指南、cosmic_suitcase.png示例、v"
|
||||
+ "itg/vitl模型选项及geometry_estimation"
|
||||
+ "存放树,并建议更新与分渠道报错。实际输入保存1.png而非该示例"
|
||||
+ ";链接/更新建议只是历史文本,不是下载授权、安装证明或实跑记录。"
|
||||
),
|
||||
"evidence": [note],
|
||||
}
|
||||
)
|
||||
continue
|
||||
if not w:
|
||||
zero.append(
|
||||
{
|
||||
"node_id": nid,
|
||||
"class_type": cls,
|
||||
"effect": (
|
||||
(
|
||||
"缺widgets_values键,不补[]/null;111为四"
|
||||
+ "输入拼图宿主,无保存控件。"
|
||||
)
|
||||
if w is None
|
||||
else (
|
||||
"源[]为空列表零保存位置;准确0.36.0 PreviewIma"
|
||||
+ "ge继承IMAGE返回并可写temp;不是成功记录。"
|
||||
)
|
||||
),
|
||||
}
|
||||
)
|
||||
continue
|
||||
assert isinstance(w, list) and len(w) == len(named), (nid, w, named)
|
||||
# Names come from explicit named metadata, and each value/type is independently checked.
|
||||
for k, (name, named_value) in enumerate(named.items()):
|
||||
value = w[k]
|
||||
assert canonical(value) == canonical(named_value), (nid, name)
|
||||
if cls in ["ImageStitch", "ResizeImageMaskNode"]:
|
||||
f = grid_spec(cls, name)
|
||||
elif cls == "LoadImage":
|
||||
f = spec(
|
||||
"输入图片文件引用" if name == "image" else "图像上传辅助保存状态",
|
||||
"动态input目录文件列表,无固定默认"
|
||||
if name == "image"
|
||||
else "前端辅助状态,后端无upload输入",
|
||||
"文件名" if name == "image" else "文本",
|
||||
"仅保存引用1.png,图片内容、尺寸和存在性未知。"
|
||||
if name == "image"
|
||||
else "源保存image;不把它当第二张图片、MASK或执行参数。",
|
||||
(
|
||||
"3.IMAGE分别到7/92/96/103;3.MASK未连接。"
|
||||
+ "sdppp附加属性只保存事实,额外恢复作用未知。"
|
||||
),
|
||||
[image, upload],
|
||||
)
|
||||
else:
|
||||
f = copy.deepcopy(specs[name])
|
||||
if cls in hosts:
|
||||
f["effect"] = "子图宿主缓存;不当内部运行值。" + f["effect"]
|
||||
if name == "output":
|
||||
f["effect"] += (
|
||||
" 本宿主保存"
|
||||
+ str(value)
|
||||
+ (
|
||||
";内部Render另保存mask,边界覆盖/空绑定恢复未证,不据"
|
||||
+ "数组构造promoted图。"
|
||||
)
|
||||
)
|
||||
f["evidence"] += [dto]
|
||||
elif cls == "MoGeRender":
|
||||
f["effect"] = (
|
||||
"内部Render保存mask;output口有边界线,与宿主四种"
|
||||
+ "输出缓存分列,不能称最终都输出mask。"
|
||||
) + f["effect"]
|
||||
elif cls == "MoGeInference":
|
||||
f["effect"] = "本定义内部保存值。" + f["effect"]
|
||||
elif cls == "ImageStitch":
|
||||
f["effect"] = (
|
||||
"111内部"
|
||||
+ str(n["id"])
|
||||
+ ":"
|
||||
+ f["effect"]
|
||||
+ (" 107/108向right、109向down;原线107/10" + "8→109,不模拟实际拼接结果。")
|
||||
)
|
||||
elif cls == "ResizeImageMaskNode":
|
||||
f["effect"] = (
|
||||
"111内部110为mode4旁路保存态。"
|
||||
+ f["effect"]
|
||||
+ (" 2048/2048/center/lanczos不能保证最终2" + "048方图;不模拟旁路追线。")
|
||||
)
|
||||
inp = next(
|
||||
(
|
||||
i
|
||||
for i, p in enumerate(n.get("inputs", []))
|
||||
if p.get("widget", {}).get("name", p["name"]) == name
|
||||
),
|
||||
None,
|
||||
)
|
||||
f.update(
|
||||
node_id=nid,
|
||||
definition_node_id=str(n["id"]),
|
||||
scope=scope,
|
||||
class_type=cls,
|
||||
field=name,
|
||||
pointer=f"{base}/widgets_values/{k}",
|
||||
value=value,
|
||||
json_type=type(value).__name__,
|
||||
named_pointer=f"{base}/widgets_values_named/{name}",
|
||||
named_value=named_value,
|
||||
input_pointer=f"{base}/inputs/{inp}"
|
||||
if inp is not None
|
||||
else "无对应输入口,不制造",
|
||||
type=n["inputs"][inp]["type"] if inp is not None else "前端保存状态",
|
||||
role="host_cache"
|
||||
if cls in hosts
|
||||
else "frontend_control"
|
||||
if name == "upload"
|
||||
else "scalar",
|
||||
execution_note=f"原mode{n['mode']};"
|
||||
+ (
|
||||
"输入口有物理/边界线,缓存与覆盖分列;"
|
||||
if inp is not None and n["inputs"][inp].get("link") is not None
|
||||
else ""
|
||||
)
|
||||
+ (
|
||||
"准确schema/源保存/动态环境分层,UE组合与实际取值未知;"
|
||||
+ "转换关闭、未实跑。"
|
||||
),
|
||||
)
|
||||
ordinal = (
|
||||
[1, 2, 3, 4][[s["id"] for s in subs[:4]].index(scope)]
|
||||
if scope in [s["id"] for s in subs[:4]]
|
||||
else [7, 92, 96, 103].index(n["id"]) + 1
|
||||
if scope == "root" and n["id"] in [7, 92, 96, 103]
|
||||
else None
|
||||
)
|
||||
if ordinal is not None:
|
||||
f["effect"] = f"第{ordinal}支路(独立作用域):" + f["effect"]
|
||||
fields.append(f)
|
||||
assert len(fields) == 67 and len(comments) == 1
|
||||
overview = (
|
||||
"这张图想把同一张图片分别显示为灰度深度、彩色深度和两种法线,再拼"
|
||||
+ "成四宫格。实际保存了四个独立估计子图;宿主输出选项和内部mask"
|
||||
+ "缓存不同,额外细化参数与准确版本接口冲突。最后缩放节点处于旁路,"
|
||||
+ "不能保证2048方图。当前仅读参考、保持停用,未实跑。"
|
||||
)
|
||||
flow = [
|
||||
(
|
||||
"独立盘点根12节点13物理边,四MoGe定义各3节点8含边界记录"
|
||||
+ ",拼图定义4节点8记录;根18/内部49合计67保存位置、1完整"
|
||||
+ "MarkdownNote。根全mode0;内部110 mode4"
|
||||
+ ",其余15节点mode0。"
|
||||
),
|
||||
(
|
||||
"3.LoadImage保存1.png,IMAGE→7/92/96"
|
||||
+ "/103四个独立MoGe宿主;MASK未接。各宿主四缓存为res"
|
||||
+ "olution_level9/batch_size4/各自out"
|
||||
+ "put/模型名,各定义8内部位置分开;不能因UUID或复用输入i"
|
||||
+ "d合并实例,也不承诺共享模型、免重复推理。"
|
||||
),
|
||||
(
|
||||
"四定义均LoadMoGeModel→MoGeInference→"
|
||||
+ "MoGeRender;五边界image/resolution_l"
|
||||
+ "evel/batch_size/output/model_nam"
|
||||
+ "e原样保留。内部Inference保存[9,0,4,true,t"
|
||||
+ "rue,3],最后具名refine_steps;准确0.36.0"
|
||||
+ "没有refine_steps输入和执行参数,这是接口冲突,不补定"
|
||||
+ "义或删原值。内部Render保存mask且output接边界线,"
|
||||
+ "不把其缓存当四支路最终输出。"
|
||||
),
|
||||
(
|
||||
"四宿主output依次depth/depth_colored/n"
|
||||
+ "ormal_directx/normal_opengl→6/97"
|
||||
+ "/98/99.PreviewImage;预览IMAGE源出口分别"
|
||||
+ "→111四输入,再→106预览。准确0.36.0 Preview"
|
||||
+ "Image继承SaveImage.RETURN_TYPES=(I"
|
||||
+ "MAGE,)与save_images返回result(image"
|
||||
+ "s,);本图出口有准确协议依据,不能套旧版零出口结论。它仍写te"
|
||||
+ "mp/随机后缀,不等于禁写文件或实跑成功。"
|
||||
),
|
||||
(
|
||||
"111四输入边界→107/108两次right拼接;107/10"
|
||||
+ "8→109的down拼接,109→110.Resize→定义输出"
|
||||
+ "。三个ImageStitch为准确0.17.0:按方向匹配尺寸,"
|
||||
+ "spacing_width0/white不制造间距,不能把尺寸匹"
|
||||
+ "配当最终裁剪。110保存scale dimensions/204"
|
||||
+ "8/2048/center/lanczos但mode4,不模拟旁"
|
||||
+ "路、不能保证最终方图。"
|
||||
),
|
||||
(
|
||||
"准确0.36.0 Render:depth是按有效正深度倒数、0"
|
||||
+ ".1/99.9百分位裁剪的0..1可视化;depth_color"
|
||||
+ "ed再映射Turbo。不是米制深度数据。normal优先预测法线"
|
||||
+ ",否则从points导出;代码OpenGL乘[1,-1,-1]、"
|
||||
+ "DirectX乘[1,1,-1]并映射0..1;mask为三通道"
|
||||
+ "遮罩。文件名里的几何/线稿不能证明有线稿节点或网格输出,本图没有"
|
||||
+ "Mesh保存。"
|
||||
),
|
||||
(
|
||||
"准确模型实现可按权重有无metric_scale分支缩放;未读取"
|
||||
+ "模型,不能证明物理尺度/单位、法线朝向质量或效果。模型加载器只查"
|
||||
+ "geometry_estimation本地文件并safe_loa"
|
||||
+ "d;属性URL和Note两种模型名不证明已装或可下载。实际输入1"
|
||||
+ ".png与Note的cosmic_suitcase.png不同。"
|
||||
),
|
||||
(
|
||||
"frontend仅准确1.52.7:具名恢复受namedValu"
|
||||
+ "esRestore条件;否则按可序列化控件位置。子图边界无外线需"
|
||||
+ "widgetId/store,有线向外解析;未执行此解析。本图空"
|
||||
+ "绑定、UE7.8/内部7.7、sdppp额外属性与preview"
|
||||
+ "Exposures的组合恢复顺序未知,不借1.51.9或1.53"
|
||||
+ ".10补充、不重复UE历史调查。"
|
||||
),
|
||||
(
|
||||
"常见问题:缺模型/文件——先由总管核对geometry_esti"
|
||||
+ "mation与1.png;参数报错——源refine_steps"
|
||||
+ "与准确core0.36.0冲突,保持关闭;输出不是四种图/四宫格"
|
||||
+ "或尺寸不符——核对宿主与内部缓存、空绑定、模式和准确接口,不修线"
|
||||
+ "或模拟执行;画面黑/无效区域——准确渲染只处理可用张量,真实模型"
|
||||
+ "输出未知。"
|
||||
),
|
||||
(
|
||||
"旧37块1281位置+40注释逐对象不变;现38图1348位置+"
|
||||
+ "41注释仅参考。155完整定稿0/实跑0/新增转换0,全部停用未"
|
||||
+ "检查/时间戳空;16/139、1217/3660/294保持。"
|
||||
),
|
||||
]
|
||||
for scope, _, gr in scopes:
|
||||
flow += ["原边 " + scope + " " + json.dumps(e, ensure_ascii=False) for e in gr["links"]]
|
||||
if scope != "root":
|
||||
flow += [
|
||||
"原边界 " + scope + " " + k + " " + json.dumps(e, ensure_ascii=False)
|
||||
for k in ["inputs", "outputs"]
|
||||
for e in gr[k]
|
||||
]
|
||||
flow += [z["node_id"] + ":" + z["effect"] for z in zero] + [comments[0]["meaning"]]
|
||||
linked = 0
|
||||
for f in fields:
|
||||
if f["input_pointer"].startswith("/"):
|
||||
obj = g
|
||||
for part in f["input_pointer"].strip("/").split("/"):
|
||||
obj = obj[int(part)] if isinstance(obj, list) else obj[part]
|
||||
linked += obj.get("link") is not None
|
||||
return {
|
||||
"source_path": PATHS[index],
|
||||
"source_sha1": hashlib.sha1(raw).hexdigest(),
|
||||
"source_sha256": hashlib.sha256(raw).hexdigest(),
|
||||
"canonical_sha256": hashlib.sha256(canonical(g)).hexdigest(),
|
||||
"notice": (
|
||||
"仅固定来源参考;refine_steps准确接口冲突、组合恢复与"
|
||||
+ "实际环境未验证,转换关闭、未实跑。"
|
||||
),
|
||||
"user_overview": overview,
|
||||
"versions": [
|
||||
(
|
||||
"core0.36.0→ee71d5c4993f29086b27f"
|
||||
+ "de1629a945ae48425bf;MoGe/LoadIma"
|
||||
+ "ge/PreviewImage准确实现"
|
||||
),
|
||||
(
|
||||
"frontend1.52.7→1a7a6b82514874545"
|
||||
+ "dc5e8203d0bd2188c2d9b18;只用本版恢复/序"
|
||||
+ "列化依据"
|
||||
),
|
||||
(
|
||||
"拼图内部core0.17.0→63d1bbdb407c69370"
|
||||
+ "d407ce5ced6ca3f917528a8;仅复用准确后端原"
|
||||
+ "件,不借旧四宫格前端1.41.20"
|
||||
),
|
||||
"UE7.8/7.7、sdppp/空绑定/组合恢复未知;未执行上游、模型、媒体或旁路",
|
||||
],
|
||||
"counts": {
|
||||
"saved_fields": 67,
|
||||
"root_saved_fields": 18,
|
||||
"internal_saved_fields": 49,
|
||||
"linked_saved_fields": linked,
|
||||
"frontend_only": sum(not f["input_pointer"].startswith("/") for f in fields),
|
||||
"source_nodes": 28,
|
||||
"root_nodes": 12,
|
||||
"internal_nodes": 16,
|
||||
"physical_edges": 13,
|
||||
"internal_edge_records": 40,
|
||||
"source_notes": 1,
|
||||
"history_objects": 0,
|
||||
"final_scalars": 0,
|
||||
"final_prompt_constructed": False,
|
||||
},
|
||||
"fields": fields,
|
||||
"sources": refs,
|
||||
"comments": comments,
|
||||
"flow": flow,
|
||||
"flow_evidence": list(range(len(refs))),
|
||||
"zero_saved_nodes": zero,
|
||||
"boundaries": [
|
||||
{
|
||||
"host": hosts[s["id"]],
|
||||
"definition": s["id"],
|
||||
"canonical_sha256": hashlib.sha256(canonical(s)).hexdigest(),
|
||||
"inputs": s["inputs"],
|
||||
"outputs": s["outputs"],
|
||||
}
|
||||
for s in subs
|
||||
],
|
||||
"steps": [
|
||||
overview,
|
||||
(
|
||||
"操作1:只读核对1.png、四支路宿主缓存/内部值、完整注释和五"
|
||||
+ "定义边界,保留原值与mode。"
|
||||
),
|
||||
(
|
||||
"操作2:由总管核准refine_steps接口冲突、准确组合恢复"
|
||||
+ "、模型素材和环境;未知前保持停用。"
|
||||
),
|
||||
"操作3:全量完成审核前仅读,不构造prompt,不执行模型、媒体、GPU或旁路。",
|
||||
],
|
||||
}
|
||||
@@ -0,0 +1,469 @@
|
||||
{
|
||||
"base": "a7ea35daecd51369d28e42e92536252776ea5d7b",
|
||||
"files": [
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/fixed_document.py",
|
||||
"bytes": 10971,
|
||||
"sha256": "dee51e5672429470215afef9bdf788143037e6339f12841b524fe38133ef58e2",
|
||||
"purpose": "仅增加本图代码持有定义摘要,保持失败关闭"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/source_reviews.json",
|
||||
"bytes": 4814073,
|
||||
"sha256": "71b3b5bb9526d183e1d76f05ca59369e77ab8ffb36447a98be5a3e4ce82a4f73",
|
||||
"purpose": "本图67位置/1注释的实际参考说明,旧37块不变"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/tests/test_moge3_fixed_document.py",
|
||||
"bytes": 10239,
|
||||
"sha256": "e7ed845f3b5f9e31b977143524b3e2b03eb13bd75da82b6af6525dbac19cae82",
|
||||
"purpose": "419专项:作用域/位置/值/模式/连线/注释/信任与准确接口冲突/模板污染"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/MoGe3深度几何固定参考中文说明.md",
|
||||
"bytes": 178643,
|
||||
"sha256": "5a8d7f452e6c34f95c98e90467dc70afe14a213dca1f7e4c79bccd6a61c255e2",
|
||||
"purpose": "本轮实际中文说明/交付口径/开发记录,具体内容见文件"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/actual-moge3_深度图_几何图_线稿图.json",
|
||||
"bytes": 192635,
|
||||
"sha256": "c51b1c2f6b6c9b3a311096ee45cf28e51047d15b721c2685ff10cc58d3de8f78",
|
||||
"purpose": "本轮actual-moge3_深度图_几何图_线稿图离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/audit-summary.json",
|
||||
"bytes": 797,
|
||||
"sha256": "b79c3f138241cc4c82f8530637349ec411fc8bd92de0668a07e2a88c4a2cbb7a",
|
||||
"purpose": "本轮audit-summary离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/boundaries.json",
|
||||
"bytes": 38634,
|
||||
"sha256": "3e4f922343621d80e223e466bc980051d183e22dcdc28f732075019efc6bf081",
|
||||
"purpose": "本轮boundaries离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/browser-results.json",
|
||||
"bytes": 124079,
|
||||
"sha256": "e7b8031ad79aef6c56f2597914a5be6a395193b1d1f7625d46a27cd63ed4ce34",
|
||||
"purpose": "本轮browser-results离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/browser-run.txt",
|
||||
"bytes": 105175,
|
||||
"sha256": "e5941a8bca73f096b431b89752554e1698736e3e8743759649fd856d95a70fd0",
|
||||
"purpose": "本轮browser-run命令、输出或可复现入口;初始失败与最终结果分列"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/build.txt",
|
||||
"bytes": 211,
|
||||
"sha256": "c00444fef525c4c1ed8a45e13530a1c95be11554e0ee19ff95f40e5dab717cee",
|
||||
"purpose": "本轮build命令、输出或可复现入口;初始失败与最终结果分列"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/build_definition.py",
|
||||
"bytes": 26669,
|
||||
"sha256": "3f63f9e78f3d3937a0da246aa9bd63fd4dbeb35736375e0ffb5c29ebf019e4fd",
|
||||
"purpose": "从原字节与具名元数据生成67位置,严格本图版本与静态schema"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/check_code.py",
|
||||
"bytes": 1230,
|
||||
"sha256": "9dcf31dc66a6ab0764a3ce3d80585bd4a9d5ed3f558bae47e21547437ceec912",
|
||||
"purpose": "只检查本次自写Python与JS,不格式化上游字节"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/cleanup.json",
|
||||
"bytes": 74,
|
||||
"sha256": "ee8ebdd2c3d7d90cf985d143cb817df7b59cf5530cef34c09a6237f863290ca4",
|
||||
"purpose": "本轮cleanup离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/definition-0.json",
|
||||
"bytes": 137657,
|
||||
"sha256": "4c9a4d9e65adff445b526db99f205aa0a387aa7319c7d58c8e31a8e6fbe10f49",
|
||||
"purpose": "本轮definition-0离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/delivery-summary.md",
|
||||
"bytes": 4669,
|
||||
"sha256": "af9560a0587f7ef2cf2c6d9e7e7161ff60c1a51e98e0bfda27ca3d3c96b4591a",
|
||||
"purpose": "本轮实际中文说明/交付口径/开发记录,具体内容见文件"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/development-notes.md",
|
||||
"bytes": 493,
|
||||
"sha256": "751067b55706b0718775ee94395c79b629e05b779429d75dd9d0035cf2d9cd98",
|
||||
"purpose": "本轮实际中文说明/交付口径/开发记录,具体内容见文件"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/fetch_sources.py",
|
||||
"bytes": 4223,
|
||||
"sha256": "1fb33e8045692525b82dd38556ed6b75ab438f6f1f0c9eb6693046ccff1352a3",
|
||||
"purpose": "只取准确tag有界原件,不checkout/执行上游"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/fixed-source-index.json",
|
||||
"bytes": 25566,
|
||||
"sha256": "e2b6a900795bdc7545e13f01789207e5a19386fe88b14a86eb029ed128550ef4",
|
||||
"purpose": "本轮fixed-source-index离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/frozen-resource-check.json",
|
||||
"bytes": 40348,
|
||||
"sha256": "cd5613838feb04bab8be067c2ace54ad19cfe7ede28b4ffdc0496ac1c4846711",
|
||||
"purpose": "本轮frozen-resource-check离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/import-protection.json",
|
||||
"bytes": 1270,
|
||||
"sha256": "defa83a99a6c1829af5d7330a32edec555ee3b55fbbeeb455b45fa780e21de44",
|
||||
"purpose": "本轮import-protection离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/independent-inventory.json",
|
||||
"bytes": 18212,
|
||||
"sha256": "77711984c5a3b47728a78cf3410906fe1ca8dc0a5ff3b4c08719ed07b4972d28",
|
||||
"purpose": "本轮independent-inventory离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/independent-port-check.json",
|
||||
"bytes": 53,
|
||||
"sha256": "06b8dcb6039a69df62929c58c9c485db26ca22a07d9c22bbbebe412e6208fdfe",
|
||||
"purpose": "本轮independent-port-check离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/inventory.py",
|
||||
"bytes": 2397,
|
||||
"sha256": "70229cdc41f7c4f14ec812afcd159f400981e9505e49fa530193124dcb4361d1",
|
||||
"purpose": "独立逐作用域盘点源字节/位置/模式/空与缺键"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/lint-final.txt",
|
||||
"bytes": 100,
|
||||
"sha256": "23982f15dec763f3a81ad0bf744a497f87aa72b94fef171c5ced4cb46562a1f8",
|
||||
"purpose": "本轮lint-final命令、输出或可复现入口;初始失败与最终结果分列"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/lint.txt",
|
||||
"bytes": 2149,
|
||||
"sha256": "9b477e71c02570a869fb3a110b72adf34a686e7e7c598789ecc5503e7069ea29",
|
||||
"purpose": "本轮lint命令、输出或可复现入口;初始失败与最终结果分列"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/package-check.json",
|
||||
"bytes": 550,
|
||||
"sha256": "7cb454e93881f535aa77a053f6da2663d97f95006934cc30db08cc23ebb665b7",
|
||||
"purpose": "本轮package-check离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/pins.json",
|
||||
"bytes": 234,
|
||||
"sha256": "d62196d350cd4b48bf399f886a2f68bf21366615d082f7347c29b26329c71ca0",
|
||||
"purpose": "本轮pins离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/pr-start.json",
|
||||
"bytes": 270,
|
||||
"sha256": "b0517947b30b57e454fcc016b39871b65425857045ff8e26874f56425ae99994",
|
||||
"purpose": "本轮pr-start离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/pytest-final.txt",
|
||||
"bytes": 1120,
|
||||
"sha256": "213c305e088841989a427dbea09368989b6de97e3192c4100850b6139e86e556",
|
||||
"purpose": "本轮pytest-final命令、输出或可复现入口;初始失败与最终结果分列"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/pytest-template.txt",
|
||||
"bytes": 718,
|
||||
"sha256": "ce5c9afa080b09add27e1b526cf88aa9436e5bdfbbd38af086bf6f673d48d3b8",
|
||||
"purpose": "本轮pytest-template命令、输出或可复现入口;初始失败与最终结果分列"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/pytest.txt",
|
||||
"bytes": 3218,
|
||||
"sha256": "cb0e27e1b6283551a7c9c2c251efbd661cdbb19921103912c668ddfa05aa8186",
|
||||
"purpose": "本轮pytest命令、输出或可复现入口;初始失败与最终结果分列"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/python-check-files.json",
|
||||
"bytes": 723,
|
||||
"sha256": "ee59ac2a39b71e61d05aa2732cd0c26a3266a2d3813221a7d32bcac73cee7311",
|
||||
"purpose": "本轮python-check-files离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/rebuild.py",
|
||||
"bytes": 2469,
|
||||
"sha256": "7dfcfcaac4c15091b2b545005a1a456203a0fce4e1775822cffe990d8b5a0d23",
|
||||
"purpose": "在真实a7ea35d源审校基础只添加本图,并维护受信摘要"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/recompute.py",
|
||||
"bytes": 12880,
|
||||
"sha256": "1b1b8dee772b573e7e80d95852eec803030c481ca37e0ea17e724bf25b891fca",
|
||||
"purpose": "真实旧代码隔离库升级/回退/幂等/29列用户保护和离线包资源字节"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/recompute.txt",
|
||||
"bytes": 252,
|
||||
"sha256": "7485b26dd8b54cb5da77da6c552619ac4573f75c6ead0353d7913498d1743e6c",
|
||||
"purpose": "本轮recompute命令、输出或可复现入口;初始失败与最终结果分列"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/render_report.py",
|
||||
"bytes": 4708,
|
||||
"sha256": "ae5e01141369230550067d6ebed7ff28fa16166cfd39d18b6f3867202de34932",
|
||||
"purpose": "生成完整中文与逐行来源索引"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/repeat.py",
|
||||
"bytes": 1273,
|
||||
"sha256": "58b77dcf0530ea4668cb3fe624cca38d475d111b1f232f1f038891aa8ae48643",
|
||||
"purpose": "双次定义与完整中文渲染确定性"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/repeatability.json",
|
||||
"bytes": 418,
|
||||
"sha256": "ac89b933b938680a5323ffa9f3c445149030134d30d3bef36eeae8ee67ce66c8",
|
||||
"purpose": "本轮repeatability离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/request_counts.py",
|
||||
"bytes": 1389,
|
||||
"sha256": "4ec087f8907912353191132b1e70c74fb1a27a2653294f0a3cf53129f1549262",
|
||||
"purpose": "按服务日志核算实际GET,就绪/轮询/拦截分列"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/review-delta.json",
|
||||
"bytes": 457,
|
||||
"sha256": "10edf27e954352daba46b3e910371f050595ed9648fa3c8245c2b79b8d040ea2",
|
||||
"purpose": "本轮review-delta离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/screenshot-review.json",
|
||||
"bytes": 815,
|
||||
"sha256": "c10bbb8fc44a6c282007dbfe7db7a1ef4e58b7c5d519f086b1653050d18fe7fc",
|
||||
"purpose": "本轮screenshot-review离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/server-request-accounting.json",
|
||||
"bytes": 1502,
|
||||
"sha256": "728ad4667be5216fa10e84b026b3e41518266195af9f1ac64029d074fc3365b0",
|
||||
"purpose": "本轮server-request-accounting离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/service-0.txt",
|
||||
"bytes": 9534,
|
||||
"sha256": "2b237b2aafe0cadaca94455e59bb07b8116b767be1276b4fcab9cbeebb71db45",
|
||||
"purpose": "本轮service-0命令、输出或可复现入口;初始失败与最终结果分列"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/service-1.txt",
|
||||
"bytes": 72,
|
||||
"sha256": "50399f55f69838e3bd7bb46627d1403591a27466375e21e4863b1aedd9b7689b",
|
||||
"purpose": "本轮service-1命令、输出或可复现入口;初始失败与最终结果分列"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/service-stop.json",
|
||||
"bytes": 65,
|
||||
"sha256": "26a1c53a887aaa01778530a87c33062e6121fde93e9eacea671c3561b8fe5594",
|
||||
"purpose": "本轮service-stop离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/source-check.json",
|
||||
"bytes": 637,
|
||||
"sha256": "5d87c0fe099ca5d3e6f651fbeeb7addd7311f17fe8950cd1ed259d70fbf1b28e",
|
||||
"purpose": "本轮source-check离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/tested-files.json",
|
||||
"bytes": 2980,
|
||||
"sha256": "4e4a9ce59f93cb4adc7653661125da4452962b4116e70ad921de713dc9bb093b",
|
||||
"purpose": "本轮tested-files离线机器可读证据/快照/摘要,供复核"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/validation-commands.txt",
|
||||
"bytes": 2335,
|
||||
"sha256": "ca5a8942faf9bd879734c5a1f27389371b5226997bdadc22d9e360cb9b399a59",
|
||||
"purpose": "本轮validation-commands命令、输出或可复现入口;初始失败与最终结果分列"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/verify_sources.py",
|
||||
"bytes": 3505,
|
||||
"sha256": "49d97f7ca158f4aafa563e0d644e7e1a1b1d10ca5913591e59099a95e7769b33",
|
||||
"purpose": "离线SHA/blob/tree/tag/commit与全部边端点及保存位置核验"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/core-commit.txt",
|
||||
"bytes": 256,
|
||||
"sha256": "e42d54e4fe274cfe4868a803ada41ad289add6209b00b1a12776758f07a78aac",
|
||||
"purpose": "准确来源core-commit.txt:tag/commit/tree或索引元数据,只读追溯"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/core-tag.txt",
|
||||
"bytes": 59,
|
||||
"sha256": "5b427a406344221cc2b9225548906f0825c76a4c76a1e3a091fd5564cb93c407",
|
||||
"purpose": "准确来源core-tag.txt:tag/commit/tree或索引元数据,只读追溯"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/core-tree.json",
|
||||
"bytes": 204470,
|
||||
"sha256": "1a873f67f379fc540f853a528ada0e55cc3500a9580fbcc114146c886fb7c16c",
|
||||
"purpose": "准确来源core-tree.json:tag/commit/tree或索引元数据,只读追溯"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/core__LICENSE",
|
||||
"bytes": 35149,
|
||||
"sha256": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986",
|
||||
"purpose": "准确v0.36.0原字节:LICENSE;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/core__comfy__ldm__moge__model.py",
|
||||
"bytes": 16818,
|
||||
"sha256": "e35f08e8b42b8b8d2d4860b4f1d1f7ca9da5a67b211005bead9f62d2cff9b492",
|
||||
"purpose": "准确v0.36.0原字节:comfy/ldm/moge/model.py;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/core__comfy_api__latest___io.py",
|
||||
"bytes": 97948,
|
||||
"sha256": "e697ed00732deffb46d7a017d82dae48ee2504a8d356f911a1447ec6146294f7",
|
||||
"purpose": "准确v0.36.0原字节:comfy_api/latest/_io.py;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/core__comfy_extras__nodes_images.py",
|
||||
"bytes": 79479,
|
||||
"sha256": "5bc0a44ee22469506d5c86fccde5f4973d156b2356e0ced6a779d1299b0f1acf",
|
||||
"purpose": "准确v0.36.0原字节:comfy_extras/nodes_images.py;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/core__comfy_extras__nodes_moge.py",
|
||||
"bytes": 21933,
|
||||
"sha256": "08a4a51f5e6b0dd307ec575bb12f4d29c82c10f338199230bfad8d4eb601e1f3",
|
||||
"purpose": "准确v0.36.0原字节:comfy_extras/nodes_moge.py;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/core__comfy_extras__nodes_post_processing.py",
|
||||
"bytes": 40873,
|
||||
"sha256": "4ee06e8e5911c844ba49d97e54c90081c539d57e6dc53f1185900e3a79ce4c98",
|
||||
"purpose": "准确v0.36.0原字节:comfy_extras/nodes_post_processing.py;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/core__folder_paths.py",
|
||||
"bytes": 23156,
|
||||
"sha256": "b748be5d1e068ad673f6c4de069fb6b7b723405c40ae3c3c44465d416f7df2db",
|
||||
"purpose": "准确v0.36.0原字节:folder_paths.py;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/core__nodes.py",
|
||||
"bytes": 108668,
|
||||
"sha256": "34a483b59eed6bc407e74cd860cba7cae542f494fdff29bb15138369f78387a7",
|
||||
"purpose": "准确v0.36.0原字节:nodes.py;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/frontend-commit.txt",
|
||||
"bytes": 1275,
|
||||
"sha256": "eefeca3244740cccbed6843af3cfddd331863060ec2a198eb95c9bff0211a0f1",
|
||||
"purpose": "准确来源frontend-commit.txt:tag/commit/tree或索引元数据,只读追溯"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/frontend-tag.txt",
|
||||
"bytes": 59,
|
||||
"sha256": "3807dc43efd6fe14b68c7ddfcef5df00063dbbb1051c0acff171e3437aca9415",
|
||||
"purpose": "准确来源frontend-tag.txt:tag/commit/tree或索引元数据,只读追溯"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/frontend-tree.json",
|
||||
"bytes": 1070798,
|
||||
"sha256": "9bc76a548db8cd8078a984816bf089ef48412c52e5bb5cb29433a3eef7063149",
|
||||
"purpose": "准确来源frontend-tree.json:tag/commit/tree或索引元数据,只读追溯"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/frontend__LICENSE",
|
||||
"bytes": 35149,
|
||||
"sha256": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986",
|
||||
"purpose": "准确v1.52.7原字节:LICENSE;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/frontend__src__core__graph__widgets__dynamicWidgets.ts",
|
||||
"bytes": 20421,
|
||||
"sha256": "9c4e7d9abfe9de813d11c2ac58a79d4068f91fbe07a634d674aa3c227a19633f",
|
||||
"purpose": "准确v1.52.7原字节:src/core/graph/widgets/dynamicWidgets.ts;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/frontend__src__extensions__core__noteNode.ts",
|
||||
"bytes": 2168,
|
||||
"sha256": "c70540cab6b4fa8ba8864946ede1ee576c1f6d39ed74be1810690a989d4c9481",
|
||||
"purpose": "准确v1.52.7原字节:src/extensions/core/noteNode.ts;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/frontend__src__extensions__core__uploadImage.ts",
|
||||
"bytes": 966,
|
||||
"sha256": "48d062c2ee95bd77c537c539e6c8f8bc03bd71dcec94c5b82487c014ea3e9c06",
|
||||
"purpose": "准确v1.52.7原字节:src/extensions/core/uploadImage.ts;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/frontend__src__lib__litegraph__LICENSE",
|
||||
"bytes": 1077,
|
||||
"sha256": "1b38cc30fe774bcc77538ab99eb460f4e1c8a47c4fddc6e991ee3b5cc2a96bb9",
|
||||
"purpose": "准确v1.52.7原字节:src/lib/litegraph/LICENSE;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/frontend__src__lib__litegraph__src__LGraphNode.ts",
|
||||
"bytes": 132247,
|
||||
"sha256": "d6263d56f28a5e6c5a95a3a263fe0d6ffe4083a981c01a14ec4ebfca43487e50",
|
||||
"purpose": "准确v1.52.7原字节:src/lib/litegraph/src/LGraphNode.ts;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/frontend__src__lib__litegraph__src__subgraph__ExecutableNodeDTO.ts",
|
||||
"bytes": 14852,
|
||||
"sha256": "64baa71b46bd67440b032e18e4d9aebb67a6cc135fe7c4509ae1b5bc25acc2a3",
|
||||
"purpose": "准确v1.52.7原字节:src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/frontend__src__lib__litegraph__src__subgraph__SubgraphNode.ts",
|
||||
"bytes": 30644,
|
||||
"sha256": "e204cd7be49ad0d48b16395dc26f6a086ca5be25a3bc0817831139255578219a",
|
||||
"purpose": "准确v1.52.7原字节:src/lib/litegraph/src/subgraph/SubgraphNode.ts;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/frontend__src__scripts__widgets.ts",
|
||||
"bytes": 9779,
|
||||
"sha256": "07e91bf2d16056938f7ce50a1ac90c8f5be9faa27d6bec3d2060e529da139257",
|
||||
"purpose": "准确v1.52.7原字节:src/scripts/widgets.ts;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/frontend__src__utils__executionUtil.ts",
|
||||
"bytes": 4835,
|
||||
"sha256": "9ba4e7ceadda90f54389cc6c81331cbc590c79a24073356ef8f87643a13a134a",
|
||||
"purpose": "准确v1.52.7原字节:src/utils/executionUtil.ts;不执行"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/identities.json",
|
||||
"bytes": 406,
|
||||
"sha256": "6d2861144d8cfb7ed9850768b2ffa423c31f4e8f372c9f05aad8a08c18f01867",
|
||||
"purpose": "准确来源identities.json:tag/commit/tree或索引元数据,只读追溯"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-reference/sources.json",
|
||||
"bytes": 12775,
|
||||
"sha256": "5b0dcd0686be04b49cc0c3cf326666eff4bd35cc1ac75d4330294f89fbe88abb",
|
||||
"purpose": "准确来源sources.json:tag/commit/tree或索引元数据,只读追溯"
|
||||
},
|
||||
{
|
||||
"path": "e2e/moge3-document.mjs",
|
||||
"bytes": 14852,
|
||||
"sha256": "264877f268bcec05c62f3c29ac0fecf68f8dddeb8478ce3053af9edfc86e4dbf",
|
||||
"purpose": "两屏逐位置/Note/来源及旧37摘要、回退/迟到/焦点/本地GET浏览验收"
|
||||
},
|
||||
{
|
||||
"path": "e2e/run-moge3-document.py",
|
||||
"bytes": 3173,
|
||||
"sha256": "60df119b5f82ada07b88f33652150cc7cdd03c0cf7416efc2369e48a40489536",
|
||||
"purpose": "前台隔离服务生命周期,finally停止并核端口"
|
||||
}
|
||||
],
|
||||
"manifest_self": "本清单不对自身生成循环hash;随提交/完整补丁交付",
|
||||
"count_including_manifest": 78
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
"Check changed authored Python only; upstream originals remain byte-for-byte."
|
||||
|
||||
import json
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[3]
|
||||
OUT = Path(__file__).resolve().parent
|
||||
FILES = [
|
||||
("calliope-backend/src/calliope/co" + "mfyui/fixed_document.py"),
|
||||
("calliope-backend/tests/test_moge" + "3_fixed_document.py"),
|
||||
"e2e/run-moge3-document.py",
|
||||
] + [str(p.relative_to(ROOT)) for p in sorted(OUT.glob("*.py"))]
|
||||
|
||||
|
||||
def main():
|
||||
for command in [["check"], ["format", "--check"]]:
|
||||
subprocess.run(
|
||||
[
|
||||
"uv",
|
||||
"run",
|
||||
"--project",
|
||||
"calliope-backend",
|
||||
"--offline",
|
||||
"ruff",
|
||||
*command,
|
||||
"--config",
|
||||
"calliope-backend/pyproject.toml",
|
||||
*FILES,
|
||||
],
|
||||
cwd=ROOT,
|
||||
check=True,
|
||||
)
|
||||
subprocess.run(["node", "--check", "e2e/moge3-document.mjs"], cwd=ROOT, check=True)
|
||||
(OUT / "python-check-files.json").write_text(json.dumps(FILES, indent=2) + "\n")
|
||||
print("PASS", len(FILES), ("authored Python files and one JS" + " syntax check"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1 @@
|
||||
{"new_pyc": [], "screenshot_files_in_repo": [], "services_stopped": true}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,17 @@
|
||||
第57批仅MoGe3深度/几何单图参考说明。基线a7ea35daecd51369d28e42e92536252776ea5d7b,原PR25/main、原分支agent/agent/a64a969a6a44。新增67保存位置(根18/内部49)+1完整MarkdownNote;旧37块1281位置+40注释逐对象不变,现38图1348+41仅参考。155完整定稿0/必要实跑0/新增转换0,全量未完成。
|
||||
|
||||
实现:source_reviews.json只给本图增加fixed_version_document;fixed_document.py只新增代码持有定义摘要。既有build_document、真实GET和整文件未改的Drawer直接展示,源字节/规范全图/五定义摘要与说明受信摘要失败关闭。每个保存位置保留原JSON值/类型、scope、具名/物理双指针、可得输入口、中文用途/默认/单位/范围/条件;四宿主与四内部模型/推理/渲染实例分列,中文支路序号清楚。
|
||||
|
||||
独立核准根12节点13物理边,四MoGe定义各3节点8含边界记录,拼图4节点8记录。根全mode0、内部110 mode4,其余内部15节点mode0;111缺widgets_values,不补[]/null,五Preview保存[]零位置。四宿主各四缓存与内部八位置分开,output四种缓存与Render内部mask分开,空绑定/组合恢复未知,未构造promoted图。
|
||||
|
||||
准确core0.36.0 ee71d5c4993f29086b27fde1629a945ae48425bf确有三MoGe类并注册:Inference准确schema及execute没有refine_steps,而四定义源有refine_steps=3/输入口。保留四处冲突,不借近版补参数、不执行。准确PreviewImage继承SaveImage的IMAGE返回及result(images,),本图预览后拼图出口有协议依据;仍可写temp/随机后缀。3.MASK未接,源图片1.png与Note的cosmic_suitcase.png不同。107/108向右、109向下,110旁路下不保证2048方图,不模拟旁路。准确实现支持倒深度百分位可视化、法线坐标变换、遮罩及可选metric_scale分支;未读取权重,不承诺米制尺度/线稿/共享推理/真实效果。
|
||||
|
||||
24准确行号引用、14被引文本:frontend仅1.52.7 1a7a6b82514874545dc5e8203d0bd2188c2d9b18;外层/四MoGe为core0.36.0,拼图内部准确core0.17.0复用缓存后端原件,不带入旧四宫格前端。tag/完整commit/tree/blob/文本SHA及许可经离线核验。所有local_file在实际doc以docs/hel-892/moge3-document-evidence为基准;reference/sources.json另以moge3-reference为基准。准确命名恢复受namedValuesRestore条件,子图无外线需widgetId/store;UE7.8/7.7、sdppp/空绑定/组合恢复未知,不重复历史调查、不执行上游代码。
|
||||
|
||||
本次432后台通过:完整专项418+13库=431(pytest-final.txt),另新增模板污染回归1通过(pytest-template.txt),计419专项+13库,无重复计数。1952浏览通过:1048本图+888旧37概要+2汇总+14共享。1440/390逐67位置、完整Note、嵌套来源、默认折叠、旧/空/错绑定回退、迟到响应/失败重试、焦点和无横溢通过,4张代表图目验,8张截图仅在附件。初次测试430通过/1失败及首轮浏览不计入本次最终总数,详见development-notes.md。13自写Python Ruff/format及JS语法通过;离线wheel/sdist三资源字节、双次重建和渲染确定性通过。未重复未改全后台/前端/转换大套件,5个无关基线失败沿用记录,不称全仓绿。
|
||||
|
||||
真实a7ea35d旧代码隔离库只1更新/154跳过,其余154整行不变;再导155跳过、精确回退1、再升级1;升级前后用户编辑各1冲突、29列整行保护。新库155导入/1排除,16/139、1217/3660/294、全部停用未检查/空时间戳保持。163原件(156原工作流+7配套API)/191资源/28profiles/9候选/六差分/执行链及Drawer整文件冻结。
|
||||
|
||||
请求全本地GET:浏览固定127/轮询12,实际后端固定122(含就绪1)/轮询12,6详情夹具+1字体CSS拦截分列;禁止请求0。finally停止两服务,独立确认8247/5173连接拒绝。截图未入仓,新增pyc为0。完整中文与actual-*.json、review-delta.json、import-protection.json、source-check.json及validation-commands.txt提供复查入口。
|
||||
|
||||
仍待核准refine_steps接口冲突、准确扩展组合恢复、目标节点/模型素材/真实环境、耗时和产物。155完整定稿与实跑仍均为0;固定参考覆盖38图,另外117图尚无本类说明块,不把本批当全量完成。不索取机器窗口/材料,不连目标、不停TTS、不启ComfyUI、不执行模型/媒体/GPU/表达式/旁路/种子/清显存,不下载模型素材字体运行库、不增依赖或付费、不写在线库、不合并部署。交总管HEL-893功能+界面一次审核,全量完成审核后才发布。
|
||||
@@ -0,0 +1 @@
|
||||
开发记录:初次专项430通过/1失败:旧块并非全部含comments键;改为从实际build_document.source_notes核对旧40注释,最终计数另列,不累加。初次浏览在加入分支中文序号及清除旧四宫格节点号前已通过;最终数据重新跑两屏,旧结果不累计。格式/导入顺序已按项目Ruff配置修正。未改动全后台、前端组件与转换执行链,不机械复跑其大套件;既有5失败沿用记录,未称全仓绿。
|
||||
@@ -0,0 +1,120 @@
|
||||
"""Fetch exact tags and bounded text blobs; never checkout or execute upstream."""
|
||||
|
||||
import datetime
|
||||
import hashlib
|
||||
import json
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
REPO = Path(__file__).resolve().parents[3]
|
||||
REF = Path(__file__).resolve().parents[1] / "moge3-reference"
|
||||
SPECS = {
|
||||
"core": (
|
||||
"Comfy-Org/ComfyUI",
|
||||
"v0.36.0",
|
||||
"core036",
|
||||
[
|
||||
"LICENSE",
|
||||
"nodes.py",
|
||||
"comfy_extras/nodes_moge.py",
|
||||
"comfy_extras/nodes_images.py",
|
||||
"comfy_extras/nodes_post_processing.py",
|
||||
"comfy_api/latest/_io.py",
|
||||
"comfy/ldm/moge/model.py",
|
||||
"folder_paths.py",
|
||||
],
|
||||
),
|
||||
"frontend": (
|
||||
"Comfy-Org/ComfyUI_frontend",
|
||||
"v1.52.7",
|
||||
"front1527",
|
||||
[
|
||||
"LICENSE",
|
||||
"src/lib/litegraph/LICENSE",
|
||||
"src/lib/litegraph/src/LGraphNode.ts",
|
||||
("src/lib/litegraph/src/subgraph/S" + "ubgraphNode.ts"),
|
||||
("src/lib/litegraph/src/subgraph/E" + "xecutableNodeDTO.ts"),
|
||||
"src/scripts/widgets.ts",
|
||||
"src/extensions/core/uploadImage.ts",
|
||||
"src/extensions/core/noteNode.ts",
|
||||
"src/core/graph/widgets/dynamicWidgets.ts",
|
||||
"src/utils/executionUtil.ts",
|
||||
],
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def main():
|
||||
REF.mkdir(parents=True, exist_ok=True)
|
||||
rows = []
|
||||
identities = []
|
||||
for key, (repo, tag, cache, files) in SPECS.items():
|
||||
gitdir = REPO / ".local-evidence" / cache
|
||||
if not gitdir.exists():
|
||||
subprocess.run(
|
||||
[
|
||||
"git",
|
||||
"clone",
|
||||
"--depth",
|
||||
"1",
|
||||
"--filter=blob:none",
|
||||
"--no-checkout",
|
||||
"--branch",
|
||||
tag,
|
||||
f"https://github.com/{repo}.git",
|
||||
str(gitdir),
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
|
||||
def git(*args, gitdir=gitdir):
|
||||
return subprocess.check_output(["git", "-C", str(gitdir), *args])
|
||||
|
||||
rev = git("rev-parse", tag + "^{commit}").decode().strip()
|
||||
tree = []
|
||||
for line in git("ls-tree", "-r", rev).decode().splitlines():
|
||||
head, path = line.split("\t", 1)
|
||||
mode, kind, sha = head.split()
|
||||
tree.append({"path": path, "mode": mode, "type": kind, "sha": sha})
|
||||
(REF / (key + "-tree.json")).write_text(
|
||||
json.dumps({"sha": rev, "truncated": False, "tree": tree}, indent=2) + "\n"
|
||||
)
|
||||
(REF / (key + "-tag.txt")).write_bytes(git("show-ref", "--tags", tag))
|
||||
(REF / (key + "-commit.txt")).write_bytes(git("cat-file", "commit", rev))
|
||||
identities.append(
|
||||
{
|
||||
"id": key,
|
||||
"repo": repo,
|
||||
"tag": tag,
|
||||
"commit": rev,
|
||||
"tree": git("rev-parse", rev + "^{tree}").decode().strip(),
|
||||
}
|
||||
)
|
||||
for file in files:
|
||||
raw = git("show", rev + ":" + file)
|
||||
name = key + "__" + file.replace("/", "__")
|
||||
blob = next(e["sha"] for e in tree if e["path"] == file)
|
||||
assert hashlib.sha1(b"blob " + str(len(raw)).encode() + b"\0" + raw).hexdigest() == blob
|
||||
(REF / name).write_bytes(raw)
|
||||
rows.append(
|
||||
{
|
||||
"id": key,
|
||||
"file": file,
|
||||
"local_file": name,
|
||||
"commit": rev,
|
||||
"tag": tag,
|
||||
"repo": repo,
|
||||
"url": f"https://raw.githubusercontent.com/{repo}/{rev}/{file}",
|
||||
"sha256": hashlib.sha256(raw).hexdigest(),
|
||||
"git_blob_sha1": blob,
|
||||
"fetched_at": datetime.datetime.now(datetime.timezone.utc).isoformat(),
|
||||
"license_file": key + "__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
}
|
||||
)
|
||||
(REF / "sources.json").write_text(json.dumps({"sources": rows}, indent=2) + "\n")
|
||||
(REF / "identities.json").write_text(json.dumps(identities, indent=2) + "\n")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,563 @@
|
||||
[
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "frontend",
|
||||
"file": "src/lib/litegraph/src/LGraphNode.ts",
|
||||
"local_file": "../moge3-reference/frontend__src__lib__litegraph__src__LGraphNode.ts",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/src/lib/litegraph/src/LGraphNode.ts",
|
||||
"sha256": "d6263d56f28a5e6c5a95a3a263fe0d6ffe4083a981c01a14ec4ebfca43487e50",
|
||||
"git_blob_sha1": "38723cce556962cb80456239df383d49469134d9",
|
||||
"fetched_at": "2026-10-30T19:05:04.497705+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
972,
|
||||
1043
|
||||
],
|
||||
"claim": "准确1.52.7:具名恢复受namedValuesRestore条件;否则按可序列化位置恢复,后onConfigure;组合钩子未知"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "frontend",
|
||||
"file": "src/lib/litegraph/src/LGraphNode.ts",
|
||||
"local_file": "../moge3-reference/frontend__src__lib__litegraph__src__LGraphNode.ts",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/src/lib/litegraph/src/LGraphNode.ts",
|
||||
"sha256": "d6263d56f28a5e6c5a95a3a263fe0d6ffe4083a981c01a14ec4ebfca43487e50",
|
||||
"git_blob_sha1": "38723cce556962cb80456239df383d49469134d9",
|
||||
"fetched_at": "2026-10-30T19:05:04.497705+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
1072,
|
||||
1094
|
||||
],
|
||||
"claim": "准确1.52.7位置与具名保存;不推测实际UE恢复顺序"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "frontend",
|
||||
"file": "src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts",
|
||||
"local_file": "../moge3-reference/frontend__src__lib__litegraph__src__subgraph__ExecutableNodeDTO.ts",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts",
|
||||
"sha256": "64baa71b46bd67440b032e18e4d9aebb67a6cc135fe7c4509ae1b5bc25acc2a3",
|
||||
"git_blob_sha1": "35220e8b093297bd6d3185b343d67d512309ccc5",
|
||||
"fetched_at": "2026-10-30T19:05:04.503759+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
161,
|
||||
208
|
||||
],
|
||||
"claim": "准确1.52.7边界解析:无外线需widgetId/store,有线向外解析;本图空绑定与组合恢复未知"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "core",
|
||||
"file": "comfy_extras/nodes_moge.py",
|
||||
"local_file": "../moge3-reference/core__comfy_extras__nodes_moge.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/comfy_extras/nodes_moge.py",
|
||||
"sha256": "08a4a51f5e6b0dd307ec575bb12f4d29c82c10f338199230bfad8d4eb601e1f3",
|
||||
"git_blob_sha1": "819421534dbb73e632028ce50579f9d7c8409d14",
|
||||
"fetched_at": "2026-10-30T19:05:03.013942+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
210,
|
||||
262
|
||||
],
|
||||
"claim": "准确0.36.0五个控件schema/推理签名:没有refine_steps,源第六保存位置为额外refine_steps冲突"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "core",
|
||||
"file": "comfy_extras/nodes_moge.py",
|
||||
"local_file": "../moge3-reference/core__comfy_extras__nodes_moge.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/comfy_extras/nodes_moge.py",
|
||||
"sha256": "08a4a51f5e6b0dd307ec575bb12f4d29c82c10f338199230bfad8d4eb601e1f3",
|
||||
"git_blob_sha1": "819421534dbb73e632028ce50579f9d7c8409d14",
|
||||
"fetched_at": "2026-10-30T19:05:03.013942+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
265,
|
||||
329
|
||||
],
|
||||
"claim": "准确0.36.0五输出枚举、绿通道约定、深度/法线/遮罩分支;源内部mask与宿主缓存分开"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "core",
|
||||
"file": "comfy_extras/nodes_moge.py",
|
||||
"local_file": "../moge3-reference/core__comfy_extras__nodes_moge.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/comfy_extras/nodes_moge.py",
|
||||
"sha256": "08a4a51f5e6b0dd307ec575bb12f4d29c82c10f338199230bfad8d4eb601e1f3",
|
||||
"git_blob_sha1": "819421534dbb73e632028ce50579f9d7c8409d14",
|
||||
"fetched_at": "2026-10-30T19:05:03.013942+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
32,
|
||||
61
|
||||
],
|
||||
"claim": "准确法线回退与倒深度可视化:有限正深度,0.1/99.9百分位截断到0..1"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "core",
|
||||
"file": "comfy_extras/nodes_moge.py",
|
||||
"local_file": "../moge3-reference/core__comfy_extras__nodes_moge.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/comfy_extras/nodes_moge.py",
|
||||
"sha256": "08a4a51f5e6b0dd307ec575bb12f4d29c82c10f338199230bfad8d4eb601e1f3",
|
||||
"git_blob_sha1": "819421534dbb73e632028ce50579f9d7c8409d14",
|
||||
"fetched_at": "2026-10-30T19:05:03.013942+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
64,
|
||||
81
|
||||
],
|
||||
"claim": "准确模型选择来自geometry_estimation动态文件列表;本地安全读取权重,不提供自动下载"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "core",
|
||||
"file": "comfy/ldm/moge/model.py",
|
||||
"local_file": "../moge3-reference/core__comfy__ldm__moge__model.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/comfy/ldm/moge/model.py",
|
||||
"sha256": "e35f08e8b42b8b8d2d4860b4f1d1f7ca9da5a67b211005bead9f62d2cff9b492",
|
||||
"git_blob_sha1": "8dd280c630afa821ce01452e476fb2d0539611e8",
|
||||
"fetched_at": "2026-10-30T19:05:03.729897+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
267,
|
||||
345
|
||||
],
|
||||
"claim": "准确模型实现:token插值/自动FOV/投影/可选metric scale/无效点处理;模型文件未读取,不能保证米制尺度"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "core",
|
||||
"file": "nodes.py",
|
||||
"local_file": "../moge3-reference/core__nodes.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/nodes.py",
|
||||
"sha256": "34a483b59eed6bc407e74cd860cba7cae542f494fdff29bb15138369f78387a7",
|
||||
"git_blob_sha1": "1728899fef8c04ea580b2d3189e2225b3c28d85e",
|
||||
"fetched_at": "2026-10-30T19:05:03.012203+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
1738,
|
||||
1819
|
||||
],
|
||||
"claim": "准确0.36.0 LoadImage动态文件列表/IMAGE与MASK/读取验证;未读取素材"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "core",
|
||||
"file": "nodes.py",
|
||||
"local_file": "../moge3-reference/core__nodes.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/nodes.py",
|
||||
"sha256": "34a483b59eed6bc407e74cd860cba7cae542f494fdff29bb15138369f78387a7",
|
||||
"git_blob_sha1": "1728899fef8c04ea580b2d3189e2225b3c28d85e",
|
||||
"fetched_at": "2026-10-30T19:05:03.012203+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
1662,
|
||||
1736
|
||||
],
|
||||
"claim": "准确0.36.0 PreviewImage继承SaveImage的IMAGE返回;写temp并返回ui和result,不是无数据出口或禁写"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "frontend",
|
||||
"file": "src/extensions/core/uploadImage.ts",
|
||||
"local_file": "../moge3-reference/frontend__src__extensions__core__uploadImage.ts",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/src/extensions/core/uploadImage.ts",
|
||||
"sha256": "48d062c2ee95bd77c537c539e6c8f8bc03bd71dcec94c5b82487c014ea3e9c06",
|
||||
"git_blob_sha1": "58e43bb218171534c4713bdced29171ecb96d903",
|
||||
"fetched_at": "2026-10-30T19:05:04.508444+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
1,
|
||||
40
|
||||
],
|
||||
"claim": "准确1.52.7上传增强入口;源upload=image仅辅助状态,实际组件/扩展恢复未知"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "frontend",
|
||||
"file": "src/extensions/core/noteNode.ts",
|
||||
"local_file": "../moge3-reference/frontend__src__extensions__core__noteNode.ts",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/src/extensions/core/noteNode.ts",
|
||||
"sha256": "c70540cab6b4fa8ba8864946ede1ee576c1f6d39ed74be1810690a989d4c9481",
|
||||
"git_blob_sha1": "d26e1e317c200bc93086778ef694af87fdf79529",
|
||||
"fetched_at": "2026-10-30T19:05:04.511005+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
1,
|
||||
84
|
||||
],
|
||||
"claim": "准确1.52.7前端注释;本系统按纯文本保留完整原文,不访问URL"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "core",
|
||||
"file": "comfy_extras/nodes_moge.py",
|
||||
"local_file": "../moge3-reference/core__comfy_extras__nodes_moge.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/comfy_extras/nodes_moge.py",
|
||||
"sha256": "08a4a51f5e6b0dd307ec575bb12f4d29c82c10f338199230bfad8d4eb601e1f3",
|
||||
"git_blob_sha1": "819421534dbb73e632028ce50579f9d7c8409d14",
|
||||
"fetched_at": "2026-10-30T19:05:03.013942+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
442,
|
||||
449
|
||||
],
|
||||
"claim": "准确MoGe静态扩展注册"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "core",
|
||||
"file": "nodes.py",
|
||||
"local_file": "../moge3-reference/core__nodes.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/nodes.py",
|
||||
"sha256": "34a483b59eed6bc407e74cd860cba7cae542f494fdff29bb15138369f78387a7",
|
||||
"git_blob_sha1": "1728899fef8c04ea580b2d3189e2225b3c28d85e",
|
||||
"fetched_at": "2026-10-30T19:05:03.012203+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
2070,
|
||||
2090
|
||||
],
|
||||
"claim": "准确LoadImage/PreviewImage内置注册"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "core",
|
||||
"file": "folder_paths.py",
|
||||
"local_file": "../moge3-reference/core__folder_paths.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/folder_paths.py",
|
||||
"sha256": "b748be5d1e068ad673f6c4de069fb6b7b723405c40ae3c3c44465d416f7df2db",
|
||||
"git_blob_sha1": "6723e52c867c57003e9ba4ed53ae58f8d79a7752",
|
||||
"fetched_at": "2026-10-30T19:05:04.459292+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
52,
|
||||
67
|
||||
],
|
||||
"claim": "准确geometry_estimation模型目录注册"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "core",
|
||||
"file": "nodes.py",
|
||||
"local_file": "../moge3-reference/core__nodes.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/nodes.py",
|
||||
"sha256": "34a483b59eed6bc407e74cd860cba7cae542f494fdff29bb15138369f78387a7",
|
||||
"git_blob_sha1": "1728899fef8c04ea580b2d3189e2225b3c28d85e",
|
||||
"fetched_at": "2026-10-30T19:05:03.012203+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
2470,
|
||||
2550
|
||||
],
|
||||
"claim": "准确core扩展清单包含nodes_moge.py;不证明目标安装"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "core",
|
||||
"file": "LICENSE",
|
||||
"local_file": "../moge3-reference/core__LICENSE",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/LICENSE",
|
||||
"sha256": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986",
|
||||
"git_blob_sha1": "f288702d2fa16d3cdf0035b15a9fcbc552cd88e7",
|
||||
"fetched_at": "2026-10-30T19:05:03.007854+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
1,
|
||||
674
|
||||
],
|
||||
"claim": "准确原件许可全文;仅读文本"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "frontend",
|
||||
"file": "LICENSE",
|
||||
"local_file": "../moge3-reference/frontend__LICENSE",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/LICENSE",
|
||||
"sha256": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986",
|
||||
"git_blob_sha1": "f288702d2fa16d3cdf0035b15a9fcbc552cd88e7",
|
||||
"fetched_at": "2026-10-30T19:05:04.490203+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
1,
|
||||
674
|
||||
],
|
||||
"claim": "准确原件许可全文;仅读文本"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "frontend",
|
||||
"file": "src/lib/litegraph/LICENSE",
|
||||
"local_file": "../moge3-reference/frontend__src__lib__litegraph__LICENSE",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/src/lib/litegraph/LICENSE",
|
||||
"sha256": "1b38cc30fe774bcc77538ab99eb460f4e1c8a47c4fddc6e991ee3b5cc2a96bb9",
|
||||
"git_blob_sha1": "1b52aa11c186c25f8d66f1de74c0d378851bfcff",
|
||||
"fetched_at": "2026-10-30T19:05:04.491668+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout",
|
||||
"lines": [
|
||||
1,
|
||||
19
|
||||
],
|
||||
"claim": "准确原件许可全文;仅读文本"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "ComfyUI:comfy_extras/nodes_images.py",
|
||||
"repository": "https://github.com/Comfy-Org/ComfyUI",
|
||||
"commit": "63d1bbdb407c69370d407ce5ced6ca3f917528a8",
|
||||
"tag": "v0.17.0",
|
||||
"file": "comfy_extras/nodes_images.py",
|
||||
"lines": [
|
||||
253,
|
||||
430
|
||||
],
|
||||
"raw_url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/63d1bbdb407c69370d407ce5ced6ca3f917528a8/comfy_extras/nodes_images.py",
|
||||
"url": "https://github.com/Comfy-Org/ComfyUI/blob/63d1bbdb407c69370d407ce5ced6ca3f917528a8/comfy_extras/nodes_images.py",
|
||||
"sha256": "40f22183dcbc9f871030145ca33d52f3dd9d8f64b21ceb071c2fdf6cd49ff501",
|
||||
"retrieved_at": "2026-10-29T22:07:13.278745+00:00",
|
||||
"local_file": "../grid-reference/ComfyUI__comfy_extras__nodes_images.py",
|
||||
"target_version_match": "unknown",
|
||||
"rule_locations": {
|
||||
"stitch_schema": [
|
||||
253,
|
||||
275
|
||||
],
|
||||
"stitch_registration": [
|
||||
832,
|
||||
849
|
||||
]
|
||||
},
|
||||
"claim": "拼接schema、匹配尺寸、填充/间距/批量和方向"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "ComfyUI:comfy_extras/nodes_post_processing.py",
|
||||
"repository": "https://github.com/Comfy-Org/ComfyUI",
|
||||
"commit": "63d1bbdb407c69370d407ce5ced6ca3f917528a8",
|
||||
"tag": "v0.17.0",
|
||||
"file": "comfy_extras/nodes_post_processing.py",
|
||||
"lines": [
|
||||
406,
|
||||
505
|
||||
],
|
||||
"raw_url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/63d1bbdb407c69370d407ce5ced6ca3f917528a8/comfy_extras/nodes_post_processing.py",
|
||||
"url": "https://github.com/Comfy-Org/ComfyUI/blob/63d1bbdb407c69370d407ce5ced6ca3f917528a8/comfy_extras/nodes_post_processing.py",
|
||||
"sha256": "e262de1a82890723ade27ebb8b7616e26320140480f8c874f64eb38355a11249",
|
||||
"retrieved_at": "2026-10-29T22:07:29.385812+00:00",
|
||||
"local_file": "../grid-reference/ComfyUI__comfy_extras__nodes_post_processing.py",
|
||||
"target_version_match": "unknown",
|
||||
"rule_locations": {
|
||||
"resize_enum": [
|
||||
250,
|
||||
260
|
||||
],
|
||||
"resize_schema_and_branches": [
|
||||
406,
|
||||
484
|
||||
],
|
||||
"resize_execution_dict": [
|
||||
486,
|
||||
505
|
||||
],
|
||||
"resize_registration": [
|
||||
662,
|
||||
679
|
||||
]
|
||||
},
|
||||
"claim": "尺寸动态schema、默认/范围和分支执行"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "ComfyUI:comfy_extras/nodes_post_processing.py",
|
||||
"repository": "https://github.com/Comfy-Org/ComfyUI",
|
||||
"commit": "63d1bbdb407c69370d407ce5ced6ca3f917528a8",
|
||||
"tag": "v0.17.0",
|
||||
"file": "comfy_extras/nodes_post_processing.py",
|
||||
"lines": [
|
||||
250,
|
||||
303
|
||||
],
|
||||
"raw_url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/63d1bbdb407c69370d407ce5ced6ca3f917528a8/comfy_extras/nodes_post_processing.py",
|
||||
"url": "https://github.com/Comfy-Org/ComfyUI/blob/63d1bbdb407c69370d407ce5ced6ca3f917528a8/comfy_extras/nodes_post_processing.py",
|
||||
"sha256": "e262de1a82890723ade27ebb8b7616e26320140480f8c874f64eb38355a11249",
|
||||
"retrieved_at": "2026-10-29T22:07:29.385812+00:00",
|
||||
"local_file": "../grid-reference/ComfyUI__comfy_extras__nodes_post_processing.py",
|
||||
"target_version_match": "unknown",
|
||||
"rule_locations": {
|
||||
"resize_enum": [
|
||||
250,
|
||||
260
|
||||
],
|
||||
"resize_schema_and_branches": [
|
||||
406,
|
||||
484
|
||||
],
|
||||
"resize_execution_dict": [
|
||||
486,
|
||||
505
|
||||
],
|
||||
"resize_registration": [
|
||||
662,
|
||||
679
|
||||
]
|
||||
},
|
||||
"claim": "scale dimensions枚举和0尺寸分支及重采样"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "ComfyUI:comfy_extras/nodes_post_processing.py",
|
||||
"repository": "https://github.com/Comfy-Org/ComfyUI",
|
||||
"commit": "63d1bbdb407c69370d407ce5ced6ca3f917528a8",
|
||||
"tag": "v0.17.0",
|
||||
"file": "comfy_extras/nodes_post_processing.py",
|
||||
"lines": [
|
||||
1,
|
||||
15
|
||||
],
|
||||
"raw_url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/63d1bbdb407c69370d407ce5ced6ca3f917528a8/comfy_extras/nodes_post_processing.py",
|
||||
"url": "https://github.com/Comfy-Org/ComfyUI/blob/63d1bbdb407c69370d407ce5ced6ca3f917528a8/comfy_extras/nodes_post_processing.py",
|
||||
"sha256": "e262de1a82890723ade27ebb8b7616e26320140480f8c874f64eb38355a11249",
|
||||
"retrieved_at": "2026-10-29T22:07:29.385812+00:00",
|
||||
"local_file": "../grid-reference/ComfyUI__comfy_extras__nodes_post_processing.py",
|
||||
"target_version_match": "unknown",
|
||||
"rule_locations": {
|
||||
"resize_enum": [
|
||||
250,
|
||||
260
|
||||
],
|
||||
"resize_schema_and_branches": [
|
||||
406,
|
||||
484
|
||||
],
|
||||
"resize_execution_dict": [
|
||||
486,
|
||||
505
|
||||
],
|
||||
"resize_registration": [
|
||||
662,
|
||||
679
|
||||
]
|
||||
},
|
||||
"claim": "MAX_RESOLUTION从nodes导入"
|
||||
},
|
||||
{
|
||||
"document": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"id": "ComfyUI:nodes.py",
|
||||
"repository": "https://github.com/Comfy-Org/ComfyUI",
|
||||
"commit": "63d1bbdb407c69370d407ce5ced6ca3f917528a8",
|
||||
"tag": "v0.17.0",
|
||||
"file": "nodes.py",
|
||||
"lines": [
|
||||
50,
|
||||
58
|
||||
],
|
||||
"raw_url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/63d1bbdb407c69370d407ce5ced6ca3f917528a8/nodes.py",
|
||||
"url": "https://github.com/Comfy-Org/ComfyUI/blob/63d1bbdb407c69370d407ce5ced6ca3f917528a8/nodes.py",
|
||||
"sha256": "dae541f8bec1483d923d75d7c74bdd166a03d361e913adb5b766f3da42965166",
|
||||
"retrieved_at": "2026-10-29T22:07:12.841541+00:00",
|
||||
"local_file": "../grid-reference/ComfyUI__nodes.py",
|
||||
"target_version_match": "unknown",
|
||||
"rule_locations": {
|
||||
"resolution_limit": [
|
||||
57,
|
||||
57
|
||||
],
|
||||
"save_image_schema": [
|
||||
1629,
|
||||
1653
|
||||
],
|
||||
"load_image_schema": [
|
||||
1702,
|
||||
1717
|
||||
],
|
||||
"core_registration": [
|
||||
2051,
|
||||
2053
|
||||
],
|
||||
"postprocessing_registration": [
|
||||
2361,
|
||||
2361
|
||||
]
|
||||
},
|
||||
"claim": "MAX_RESOLUTION=16384"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,771 @@
|
||||
{
|
||||
"base": "a7ea35daecd51369d28e42e92536252776ea5d7b",
|
||||
"files": [
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/__init__.py",
|
||||
"sha256": "1d3488bcc2eadcd8a8f2e84ab4f6e9bdf52096b8af637c4da399db041d5a0543"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/client.py",
|
||||
"sha256": "ce30b3b3587d8f0dac86d534b99f31b95f1f4d0acb361babb45fd2be9513fe72"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/companions.py",
|
||||
"sha256": "7dde205059bf489e3d39539a8b42333b3947c3989d890441f70a45cf67d9ab04"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/delivery_scope.json",
|
||||
"sha256": "3a85718f877a63be54c843e2610b24dcc3013a6011f705d6348c91e2c7f78fd6"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/delivery_scope.py",
|
||||
"sha256": "0b849256dbb06f709c1ba856c34b3df04d2fccf09984a6e1fe1284b792eaf867"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/dry_run.py",
|
||||
"sha256": "f8bf4d1b91d959044de1dbc4aeb11bf0bb521f51f1928d36a46c670381a08ed7"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/endpoints.py",
|
||||
"sha256": "fc99a623850b581ae38843bbc3baf1b71ca9fd633e6103a34cb809a345e5a647"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/h3_chain_reference.py",
|
||||
"sha256": "a5c0ab92d99757c168648ddbc0418b23d2b871f674b153e9a240b75409cf5741"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/h3_core_reference.py",
|
||||
"sha256": "2913654b6ec3dabac1d36b1894064b8e077dd1d743d546e81667b317339f8a5f"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/library.py",
|
||||
"sha256": "b9cbfce28267642e6db3ebe9d591cf8dd260c7772a5a21a8d36cb98915eca13c"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/library_cli.py",
|
||||
"sha256": "04bfa8cfbe3f9378e78594958973118ec95aa1ff0bcdbdf4da0311abbdbcd380"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/lint.py",
|
||||
"sha256": "9b79bf162e13fb68321727fb17f96d6fc0c217d60db85de38235c4270bf9b4e3"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/output_map.py",
|
||||
"sha256": "36ed4ced825e4f7e1d389602085451b5cb9336b319d220f423f59f83fed6a70e"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/parser.py",
|
||||
"sha256": "a02d583c6a1cf7f85e77341a20308823771c233fb95241118a264e202a5230a0"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/patcher.py",
|
||||
"sha256": "8ac1417f0f78d952cdb219b10811a6ed7d4ce3bb0d561708858c4a8f5d15b45d"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/preflight.py",
|
||||
"sha256": "6629961d33204cbe5b3fc3d8a5a0a4de0c86d235e73f542d191429cf7f4bd2ec"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/profiles.py",
|
||||
"sha256": "4ca33343fc3f20e0fb82558cb428548f6415af04fb90213a694fb759515732f2"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/protocol_references.json",
|
||||
"sha256": "a10aaf98db9bb3b5ac6d1fc30b18c40cf315b34eee57ebb19470a6664e9221a4"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/protocol_references.py",
|
||||
"sha256": "ab9d948dd1bbf83dfce27186d6e48d9c3d5dff129305afd760fb3e77570b2916"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/registry.py",
|
||||
"sha256": "0382eda52a31f23c1c29dd7a62d0ffc93e10fcbb88872a5893b8fc93a2b2734d"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/roles.py",
|
||||
"sha256": "cc0b45eac2d881a6f7cc5ea88ceadb03f71715240a45257fef3a76bfc53d56c4"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/serialization_reference.py",
|
||||
"sha256": "67724fac65acbd397198271e1ed17b91f592f52da7ce8299e575d4c597d57fa1"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/smart_fill.py",
|
||||
"sha256": "adc34e80cca7a2b38cc834a713c9e64001caac84413af288389e5554e304bab6"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/source_reviews.py",
|
||||
"sha256": "b85e26f1e4fce77f75429b7bc0653401065b2cd28151bdf5d9edc87c096e9419"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/structure_reference.py",
|
||||
"sha256": "a9f3a8ed314a0c0a424c6781db4e83af3a85cb8b66b16b01380b5fecc3e1f0bb"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/ui2api.py",
|
||||
"sha256": "86a9c98ad72afa15aaf706bab8b39589a1cbca2e93da40d0aed9f963c14c0d1f"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/validate.py",
|
||||
"sha256": "c27fca69a604705b06809fdd692975ca0e7a08d05d558172962f8910a6a0491d"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/supplied-api/01.api.json",
|
||||
"sha256": "0ed76e088a23af43d6fecbf273fc0a983d7112e2b046d347f715afffac56d57e"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/supplied-api/02.api.json",
|
||||
"sha256": "daa40971b730076691721afe95e165932df94e3423f1fc44dcb7707026e7125b"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/supplied-api/03.api.json",
|
||||
"sha256": "91e6c2cea3747a03bbb71f661dbd016b28040781482b956365ff76a7a8b647ce"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/supplied-api/04.api.json",
|
||||
"sha256": "2066b07b2ca5390ba3e795df6b43934dab83865b12870b6ff26d8c0ef24f091e"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/supplied-api/05.api.json",
|
||||
"sha256": "95a01c1ea27a8279a6dc202820505099a94161d91e0789189b61208b09007af8"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/supplied-api/06.api.json",
|
||||
"sha256": "3e9176a5346ce8b8122b6da10f377fbeb894dc7c2c82a415f85ffc0dbfefc90b"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/supplied-api/07.api.json",
|
||||
"sha256": "b1b4f6a6c02d8d21701943c67b62805b1210fed17e7e26b618c58e112ea1d70d"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/supplied-api/manifest.json",
|
||||
"sha256": "f1367b4fa7a8377fb57512d17c80bc697d4d3abd0adb77adc3c06c6dedab69ea"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/ControlNet_aux_常用样例.json",
|
||||
"sha256": "8898689d777330c4749a079cd762f573bb12a278c47a2fefbd066ffbdc122b6b"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/Minimax-H3提示词增强.json",
|
||||
"sha256": "ffea53b27d52c63aa9ec9c60144489cc4f9e5a44d9478bcc297be9d9008f1a4c"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/birefnet_图像移除背景.json",
|
||||
"sha256": "a6799c5022c13e46d2b1cf27809cd3c1e1d140a605fa226c19359682751fd036"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/sam3_图像视频-提示词遮罩分割.json",
|
||||
"sha256": "5dbe1a7ab608ba6e9158369ff6498e9bb3f926d151a0ed31cf711c31b167c488"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/人物骨骼姿势提取/NLF_视频人物动作骨架获取.json",
|
||||
"sha256": "1edc7ae5cca8e059577a9572d296c84e1683695e4f13a72388ff70473795ce97"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/人物骨骼姿势提取/openpose-video-姿态检测.json",
|
||||
"sha256": "43f76f599f15058b6e62ae0dfb105518a37532008eed23ef7118e4950b37a608"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/人物骨骼姿势提取/sdpose_视频人物姿势骨架提取.json",
|
||||
"sha256": "4586c72d8a906d4a956fb7d62307b81e57e4e345324c7e73f63103e56bfffd14"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/加载图片合成视频.json",
|
||||
"sha256": "f5245d225f77cd64aefe6d0b8bb9342ec48a8a6293a533d65ea7304ce1b03f93"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/加载本地latent解码.json",
|
||||
"sha256": "1fd83bd3f2d7950440189932b4c17718190af88daa4a93ac86474081dea9005b"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/双图像或视频合并显示.json",
|
||||
"sha256": "61a0b1a2aa17a7d8c4f09f4f57e276eaf37227f69b5fc5789193005e593548c9"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/图像4种添加水印节点.json",
|
||||
"sha256": "2eecd407d667d2ef6249061181edfdcfc417a2151627622f280d74aaac1794d8"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/图像分割-多宫格分割.json",
|
||||
"sha256": "aeceb3fd00eb0966eebf8d8c89d90e2ad29d0aa8d02589aa05d52a6c145a4bcc"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/图像合并成四宫格.json",
|
||||
"sha256": "fb5e5b346d51a79c19e611b76d39cf4b9491493723684bbb85ab3c49923467bb"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/图像嵌入文字描述.json",
|
||||
"sha256": "938ad9ad0eed2253e9a5a9a9dc16dc6b0a22bf976a80af90aa1d0b56e42ba7d3"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/多视频合成分屏展示.json",
|
||||
"sha256": "3c2f6558c199a7689546dc881df2b26dc31c02715fbc7b32f51caaa4601c13d7"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/截取视频每一帧.json",
|
||||
"sha256": "43858b9121439a92e7ab35c2fb62b78e56fa93bcd0ad62679f2387f71fdec1fa"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/手动按分镜视频截取.json",
|
||||
"sha256": "381bb5f3a6e2788d0dd3ee9594a97eaedb153611194d4f8fdde420cf47814132"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/提示词生成与反推/Llama-cpp+Qwen3.5-提示词.json",
|
||||
"sha256": "9071928ce74d5133401942583603a6bc98873263fbe4c32a438fe73cee81ce90"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/提示词生成与反推/gemma4_提示词反推(图像视频音频).json",
|
||||
"sha256": "1a94bdd5987955a29e403d128c2ea5ca0b6bc8a8d5ece145e1baba07146588b0"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"sha256": "a50e8b9961fbdd83fa42ca121ff77b3c1b058c7e454ad374b0de7c60e7b8c4a9"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/视频-音频分离.json",
|
||||
"sha256": "4861e3e33291ed962d2215b1d8cc976a4706d19719e3541e9cbb2c636683afc3"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/视频倒放.json",
|
||||
"sha256": "8c760ea58d7ff664323f92a1174fe88300cd931c00201ccf437df1ad0067cb24"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/视频转gif动图图片.json",
|
||||
"sha256": "39f7ddf60bf5958882215bd4227a85707f1f9003f2c5aaefc709a28b1ef16827"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/音频人声分离.json",
|
||||
"sha256": "3c4bc0f7b1891e298a5d4e00072c6243a61b98d5fc0d86d82a476ecead43a1a2"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/音频转MP3格式.json",
|
||||
"sha256": "c46e83b4fe8fc291e9de45b4af6cc50b566ab9377a51b50767315917dd13861b"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/RTX_image_upscale.json",
|
||||
"sha256": "35bf9b7731e6199b5ccc113e31c248573f9ae74d1bb9302071a3a97524fea8c4"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/RTX_video_upscale.json",
|
||||
"sha256": "ce189e5efdb1d608eaf7f7905f0dbf3776be2c199e143193c226ab497f2eb9ec"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/Seedvr2_3b_int8_图像放大.json",
|
||||
"sha256": "2be6b137efaaf25a54aaedc841a14ff3089afdc8a01a04af6353634b8457393f"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/Seedvr2_3b_int8_视频放大.json",
|
||||
"sha256": "06c427c688c13b87ed5724ac6b1ed432c31f8ea6c44212b3e7596b94128619da"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/Seedvr2_视频放大FOR循环长视频.json",
|
||||
"sha256": "576a9516292ed3e63b50c2a03fbfc1a99f9d643f526dc7fa3b98f6cb9832c893"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/VOSR2_图像超分放大.json",
|
||||
"sha256": "87484f700a9a18d1bffbc61834af2b489a58171dcb4a225e210e695a30c85dd5"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/VOSR2_视频放大_分批循环长视频.json",
|
||||
"sha256": "0f55316d2961a293a7d9f77b7993fd6f01bd5a41a4dca58f69f4d0b35c0aa6ea"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/图像放大比较.json",
|
||||
"sha256": "1ca5938a963921b16c96649a97d3b1a9f75d810d3aabcd7ce472a30e5805f3e4"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放大/视频模型放大插帧(简单快速版).json",
|
||||
"sha256": "bf47ba2462a3f683fe4f1d742b7dcde81a7a3f95e7e63c021e942a6c4f9ef071"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/1-语音生成/Qwen3-ASR-Subtitle语音转字幕.json",
|
||||
"sha256": "47f9afa955a6a5dce37000cb6a15bac7516d26ff50b6398bda334c825552cfd8"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/1-语音生成/Qwen3-ASR-语音转文字.json",
|
||||
"sha256": "958a3b7cb7070f4207901c79f13863b44ffcd0ed5c2c7fb4cd779e7964da0d65"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/1-语音生成/Qwen3-TTS_多角色对话.json",
|
||||
"sha256": "549a6502b3e0d4386323e6e67d6a9b4943b7a01eb59bdbe7adc7a920cfe5b690"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/1-语音生成/Qwen3-TTS_语音设计+语音克隆.json",
|
||||
"sha256": "9c75272e418064f46da96f6167448216a9390566e4b5d5e168d8cc5955447ab1"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/1-语音生成/index-TTS2-情绪控制-音频参考-文本控制-克隆-多人对话.json",
|
||||
"sha256": "d2c469a8a17c6d1fcffb9a96700c38290895873d99c40d13d669bd45f6ea79de"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/2-音乐生成/ace_step1_5_xl_turbo_8Step极速音乐生成.json",
|
||||
"sha256": "668fae23de5f84cc530fa4cab7381299cbc787b30c4597345b47e7f5c17415ef"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/2-音乐生成/ace_step_1.5+Qwen3.5_自动歌词音乐生成.json",
|
||||
"sha256": "518085b1e8d12257e68427dcc0f01e6cda5018ec353fd90fdf366afb4fc89b85"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/2-音乐生成/minimax_music_文生音乐.json",
|
||||
"sha256": "0a655ead5a0da406159dceb46451439df0c02050becaaa25b3018abb41840284"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Anima/Anima_Klein放大_超强动漫模型.json",
|
||||
"sha256": "000843bc0e46844e556b04fc820ae1b2f7fa9bba1dd0ec21805c0c7ab27a647c"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/10_flux2_klein_文生图-角色三视图.json",
|
||||
"sha256": "e04e5bd04f03ce32b5221d37c5f7cffb0405b1471cb7be90b47b407d900a49b7"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/1_flux2_klein_文生图.json",
|
||||
"sha256": "523905ac41323c626d7a156c88d02156cfa4758a70175cd7a3fba2a8c4fd449b"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/2_flux2_klein_图生图.json",
|
||||
"sha256": "c0472959097f4e785205f41109c941dab26d12a874311834a7dc02c4616bbe9b"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/3_flux2_klein_图生图一致性增强(大雄lora).json",
|
||||
"sha256": "c6af28d5bd72df5577f1e4d336974397494dd500fff23efd4afe81037514be71"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/3_flux2_klein_图生图一致性增强(小志lora).json",
|
||||
"sha256": "43995837f89e5112afa74a57180dc356f7b4d4ef9e3a325984a2fc5ca1b7c651"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/4_flux2_klein_图生图_局部重绘.json",
|
||||
"sha256": "d1d57bd401959975cbe6fd70f97706cec21bbed0a5ec3747447b9f192631f414"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/5_flux2_klein_图生图_扩图.json",
|
||||
"sha256": "ad8c09e81b07aa7809a7d42f633d0b9069f704187e7a983bc2ac12bc3cbb8507"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/6_flux2-klein+Qwen3.5_转线稿洗图.json",
|
||||
"sha256": "40a9fee073066914ac610f74dc7f7a49022bda63f5b89560d4bd635094a5c757"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/7_flux2_klein_图生图-动漫转真人.json",
|
||||
"sha256": "8cab62c6b7b2401bb6b51ff4426aaad2a644fc6cfe49d974769fadf19c16a0a1"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/8_flux2_klein_双图编辑.json",
|
||||
"sha256": "9d00eb7af7e8d49c54396e6dc2afe7770f99cf75ae765dc1b906c8c9e6b69d83"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/flux2_klein-图生图_人物动作迁移.json",
|
||||
"sha256": "fc6daf483ac05fdc904ca402271223d14cc217ea4c81a17ba2ef4cae993aefe7"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/flux2_klein_图生图_人物迁移.json",
|
||||
"sha256": "81409bdcd546102a7a6d5b7e32578912bf7ad4f89b35718de0401ceed624225e"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/flux2_klein_图生图_印花提取.json",
|
||||
"sha256": "8768dec340e35dbd70f928d8bbc34813b2bd45f5c270c405d4495b92da478337"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/flux2_klein_图生图_老照片修复.json",
|
||||
"sha256": "922c534d70b85beacc2cd51354552ed1d850dbb611b20f2d6981c4e524ce06c5"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Flux/flux2_klein_服装迁移.json",
|
||||
"sha256": "e3f01ba44f3628297e714b4307ed959758f04e0415093dc5ec690857384a8386"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_Image2.1_图像编辑_VNCCS任意角度-任意姿势.json",
|
||||
"sha256": "a5a675500a473214eaeb1d25dc1eda83b57bba3a17d18f1f0042bee62b474314"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_图像编辑_一键16张姿势图.json",
|
||||
"sha256": "248b6c5ae28d5a44035c5ad91bcdfa458360a67598eaa4d195c3fb6853b18a49"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_图像编辑_动漫转真人.json",
|
||||
"sha256": "1aa1d3641f82533f99d99567c2708919438b9efbfc6623d684a9a88b876b75cd"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_图像编辑_提示词增强.json",
|
||||
"sha256": "ebf173eb9d871717534a379d451d4a08ca06c3b677b552de12a5d51dbe8febf2"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_图像编辑_深度-姿势-线稿-硬边缘-控图洗图.json",
|
||||
"sha256": "b6e232082089dd9c4046e0dc5bd1d046907525b8cb01758fb804b5f4aa11275e"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_图像编辑_背景移除.json",
|
||||
"sha256": "d225102993ad5aa08e619bd7f1e5abbfd54e2d5ac8d8be1eacf09722107c4c9e"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_图像编辑_角色BFS头部迁移.json",
|
||||
"sha256": "6a9da127ee2bccafeff7499ab3d62f349aec1eff4265cb211bdec578dba1fe7b"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_图像编辑_角色表四视图.json",
|
||||
"sha256": "0036c02e1ab22f44c94bd9f311d5254d7b3b0cea25211bc4ff1e92cd90e0acdf"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_文生_多图编辑_8步lora加速.json",
|
||||
"sha256": "172b8fff0b531fbea367e79aa6b5ed1e6b59cab2ce6cb23d324092d5b55a3f97"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_文生_多图编辑_提示词增强(N版).json",
|
||||
"sha256": "ae6521e5f42bef0b887f754c2fec5961d612afc464fbd98940a976a9795662c6"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_文生_多图编辑_透明背景.json",
|
||||
"sha256": "5853f21657d56e97a6b625c4487e23473b846fa8c96dc292f3700b3075245a39"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_文生图_提示词增强.json",
|
||||
"sha256": "dfe10917d101bf1a8a8c20750f4360690ecd478e9eb33d16a59ea0c6f12c086c"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_文生图_角色表四视图.json",
|
||||
"sha256": "6fd307b02b7ba29858723e283580c1cf4ab1fce8804a3ced1f4fc37934965392"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/10_Z_Image双采样+Fluax2-klein修复-高清直出.json",
|
||||
"sha256": "043cd2abe731996b80637d87b9a799e412e08b9a15e4b7c2f4440fbcff2487b9"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/11_Z_Image_Turbo+模型放大_图像4K高清放大.json",
|
||||
"sha256": "baaa0cd969a28abe5e6ab19b3d7f6e161468cd15c970fe4bd9922afbe09ab4da"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/12_Z_Image_Tubro_文生图_SeedVR2高清放大8K.json",
|
||||
"sha256": "8d79bcd44a7843ac5df9fbcd372a6327ba72274260ef463c46ec85709da7846a"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/1_Z-Image-Tubro_文生图.json",
|
||||
"sha256": "36713b1a3f5c4f2992c7edef2e1e8c3246d44d28ecc750b87f4353a08c3b5ab0"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/2_Z-Image+Base+Turbo+双重采样工作流.json",
|
||||
"sha256": "27108ae85715b147f63d8640ee032484c70a21633e2c6234eed346079b9aba2c"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/3_Z-Image_文生图(摇光梦幻).app.json",
|
||||
"sha256": "58e88cacc6e1375cad39023e39eb1728eb36e63acce3c46fca40898d706b1d42"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/4_Z-Image+Qwen3.5-文生图.json",
|
||||
"sha256": "56bd28b5253fe734e851abd81c7851d00c62e4dbf37a22d97781d93ec367a35d"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/5_Z-Image+Qwen3.5提示词反推_文生图.json",
|
||||
"sha256": "910317a123e658f26e48ad5cd144d28b7f31e0d43cbdb3ed567048c7917b5c73"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/6_Z-image_局部重绘.json",
|
||||
"sha256": "f60e734b6ed9e678571ad7666411d6282065c38abe3e9c29ea4c5cc1c3455505"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/7_Z-image+Controlnet_图像扩展.json",
|
||||
"sha256": "82cda5dca2e224a5b042daecba4c3c1405a825648a9e9ced29fe21e58f7e55f8"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/8_Z-image+Controlnet_姿势控制-洗图.json",
|
||||
"sha256": "babc1dbeb3bb4981e338d8317ff9fb6fd8c28913bf47a2e2e3eb5409439447bf"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/9_Z-Image+Flux2-Klein_风格重新编辑.json",
|
||||
"sha256": "3734f261691c3ad13d29b30d88e91f671d9c548f723e77d78651c7155b06c408"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/Z_Image_turbo_十八种风格_插图漫画.json",
|
||||
"sha256": "02ea31b959de72f9b5c00a92f21b4e17bbc2bf5a54495093a204957771a88039"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/Z_Image_turbo_十八种风格_照片摄影.json",
|
||||
"sha256": "740d7d41b3248978dca2046d9a2ea99d3a66ef081d45609782d2847f04f7e0c8"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/Z_Image_turbo_十八种风格_通用a_.json",
|
||||
"sha256": "e58341a99587077a69baf3cec62d9ae7bb0ce02a87cb3973ce3134c04a119b23"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/Z-Image/Z_Image_turbo_十八种风格_通用b.json",
|
||||
"sha256": "8d9e66744e0266c5f53a6396e030c38bb90053f2525ac9c3c6cc1b321006a976"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/Krea2_turbo_文生图_4_6_8宫格故事板.json",
|
||||
"sha256": "776b2f92f8906232c2ffe1b25c8b9cfe3398bfe45a9f80715f6ce5acc03e96b4"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/Krea2_turbo_文生图_极致写实双采样2k版(N版).json",
|
||||
"sha256": "50433cee0d5bab60a2cce44d73adbe5fe9b486c039bc89e1caef640fe6e0b28d"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/Krea2_turbo_文生图_角色三视图双采样2k版.json",
|
||||
"sha256": "64bb5eb4e5399d307c12553717b8a1f0046f48b625b16e62d40e962b6bec1847"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2-Edit-Anything2Real_动漫转真人v3.json",
|
||||
"sha256": "0d482e6c6fac70af6dd5549e8a464ee080a0ec135350d72d32a4ce4a8fd05bbe"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_identity_edit_图像编辑.json",
|
||||
"sha256": "c208883f17eb873063a4febaef636f0fa065131fc82bc4b0b26eff41f442719a"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图 (N版).json",
|
||||
"sha256": "935fc592ead1a89614470d41c512e2d7b4a41a6887f71a0a8d8f4c071a60e3c9"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图.json",
|
||||
"sha256": "6b317af2bda225d9441074ef330669b4537e95c705987223efafd2705dbbc344"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_2万提示词随机模板+4千种风格选择.json",
|
||||
"sha256": "599bb58d48d68de929e7ec476f77e9f7c736c00235b68570416d214d3b4e391c"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_Qwen3.5自动提示词生成.json",
|
||||
"sha256": "afafb0e0ebdc445a7534041589b7f6a580e0b15b8293c2fd26907474892f5957"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_动漫风格2.5D半写实.json",
|
||||
"sha256": "3faf9b1f0a20c7d21367af1721583a7402f048e18991025f9afff192ff8fe077"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_动漫风格Image2风格.json",
|
||||
"sha256": "bf65d0080ab80a5934855a0dbc7a5e167300bb54e24a18e05e4321a70ec838ea"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_动漫风格线条动漫.json",
|
||||
"sha256": "9bab028943604b4b167a56dcc51475f67bac897c9eae3c7bf9d311b2c5cb7d91"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_图像风格参考.json",
|
||||
"sha256": "8c248ccc44df79b475c81e0bb260596ece066d65f2a21c0b2a72dc6b2441b170"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_奇幻现实风格.json",
|
||||
"sha256": "7a2af26c48114c7f1a7741a5cded07c0cceb68c4e69410de8af6429eb6b5041c"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_极致写实(N版).json",
|
||||
"sha256": "ec98804940c28956af1719096751bba2d274eef8a251b97207ac655a05779384"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_细节增强.json",
|
||||
"sha256": "faa28f85fbd80ec9c3aba76749d6447c1d3b4a8489c88853ebde665a4f78ef10"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_美学质量增强.json",
|
||||
"sha256": "fbca5f24abf71f10ed5e2b90012aab1c25c6632a18541fbf0412b8845f603b85"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/krea2/krea2_turbo_文生图_赛博朋克现实风格.json",
|
||||
"sha256": "a353acdb89b02462abed5f1513acfcb4f538c50ab5bc8ede8e8597f3ce8eea60"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/3-图像生成/肖像大师_美女提示词生成.json",
|
||||
"sha256": "4ff20f7350813ec74fc054971b4532200d61661951c103c89f7729f89f7be2ff"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_FastH3_i2v_图生视频8步极速.json",
|
||||
"sha256": "c5eff277eeeeefacb39c4af2e5ac41251785cc18ca90c1678a653367f4dd5942"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_FastH3_t2v_文生图8步极速.json",
|
||||
"sha256": "ed4a30da03245f35ff9006ac64cd045c1b9c64eb8b585520dbbb418f6793fc78"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_多参考_双采样潜空间放大.json",
|
||||
"sha256": "8b97388e142ddb67c84f2cbe0bb68c10f519e7615d75f1ea0005580fe4537ab2"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_孤海智能一体化(多合一简化版).json",
|
||||
"sha256": "827f43d5d9bdb6f2d6f4d8b69e86708e6d08642ed0df04bee15087d10b9a0e35"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台MiniMaxH3_多合一多分段拼接.json",
|
||||
"sha256": "34fde3a91f9ef932adc2837cc9d4254bf75a3251ad5c6474d90e4085690cbafc"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_双采样多段循环-PV动画尾帧衔接.json",
|
||||
"sha256": "c8a442bd8cae8dcd75a6a01847ca99b75dcc37ef8ff0a855c82213ed25e943e0"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_双采样潜空间放大.json",
|
||||
"sha256": "2434bd48e3c29abf9e6ed0931f3c8825481772a134a065f6cfdd3c0b89ba81b7"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_文-图-参考-分段循环-双采放大_多合一.json",
|
||||
"sha256": "698430e2b234a107b15f1bebf7704833afeea819bd21a3af56f7121daa1383e0"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_文_图_首尾_参考多合一(单采样).json",
|
||||
"sha256": "526986a02875bbefebeb8a81cce9b58a8e764ab0c0092b2d8e858ecfac771638"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_短剧创作-多宫格分镜参考.json",
|
||||
"sha256": "d2850f5fb3e5b54e3e4ec9e17f34bdb11bf7009728b5e585c769fb2f11f80275"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_短剧创作-音频参考.json",
|
||||
"sha256": "c188a7383a6c7a0dbd5d4d0717527b096ec73c1232373ee50c731bceefcfe7fb"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_视频人物替换.json",
|
||||
"sha256": "dce57cfc239c9f90cda2107fff5614b2cb0944e0441d9d8137b3f1c325f41a7a"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_视频参考+多参图-SelfLift双采样潜放大.json",
|
||||
"sha256": "97ec7f73f32126aa24798fc65736734dfa839b74d25c4b2a94021abe063f06d7"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台_视频参考+多参图.json",
|
||||
"sha256": "40f92a22aa66c9d87b876784e33b02471339d64504e22e1672155608fbcbf079"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台时间线素材_双采样潜空间放大_多分段拼接.json",
|
||||
"sha256": "172eb8af3aca70082941427520fdcca06568957bab3d39101c5e9d6641b45e4a"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_音频MV_多参长视频分段_Selflift双采潜放大_Qwen3.8官方Skills自动提示词.json",
|
||||
"sha256": "bdc93d36fb8a4728dfa8031d1f00782d68e8e6aedd718b166f57e54216f2882f"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_音频数字人_SelfLift双采样潜放大分块_Qwen3.8官方Skills自动提示词.json",
|
||||
"sha256": "903e32248fc0c53df36c5841f4f4ccdb5fb8190a39c6c9015d3e55a451aaf7eb"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/Minimax_H3_T8双时钟采样_参考生视频-8步高质量极速版.json",
|
||||
"sha256": "fae96106a128342a6903bd32680463d1be98c0d5ad738d2fff40fc0f52a35389"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/Minimax_H3_T8双时钟采样_图生视频-8步高质量极速版.json",
|
||||
"sha256": "97f188c9295af0dbe6358a4b23117ca1612e812d2fa3df67dd7b10ee68e96fb5"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/Minimax_H3_T8双时钟采样_文生音视频-8步高质量极速版.json",
|
||||
"sha256": "5b45b49ebe4402c207e7d894e03a1bb53482b24a0c09ce50d549be4a01f9c6d0"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/Minimax_H3_T8双采样_潜空间放大_参考生视频.json",
|
||||
"sha256": "fab48be409cf423aaed7be268c6655ae39ecd1733218413c51874c5ba2ad0bdf"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/Minimax_H3_r2v_参考生视频_双采样潜空间放大+Qwen3.8官方Skills自动提示词.json",
|
||||
"sha256": "4c1305fdfe6d5643e64a7b6c99cc92e331ffc9475f30fef5e0119c887367aab0"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/Minimax_H3_视频动作参考_SelfLift双采样潜放大_Qwen3.8官方Skills自动提示词.json",
|
||||
"sha256": "2be3981360fff849a53a928a6a2040c97bcf1944dce2df82d716a805c0ef2594"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/Minimax_H3_音频数字人_单采样.json",
|
||||
"sha256": "77b665bf6bcd11195f424d42d88f5142b43b0c608af776eef5744aca896f4b56"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/minimax_h3_i2v_图生视频.json",
|
||||
"sha256": "a071e6070ee933396f225b4447c363bbf6b0df059b3cd43da567e81bc7937e84"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/minimax_h3_r2v_多参生视频.json",
|
||||
"sha256": "89166eb9cce4c9177a0f9a0a3a058e140429413e7beb3692e7ee5c30b76bc4fb"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/minimax_h3_t2v_文生视频.json",
|
||||
"sha256": "039d46a5bbb809b84fab3b42c777118f91d0c06835555d54410631742584f1be"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/uncensored/minimax-h3多参生视频无审核版.json",
|
||||
"sha256": "e501089f36c4c7f76a9e926e09ab9c467316d0778e62dff4c9e9faa6b155cb83"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/uncensored/minimax-h3文生视频无审核版.json",
|
||||
"sha256": "07baed6dd4a259701f7e5563fa1f19799fbbb558668d09a74876db3729fff3a2"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/4-视频生成/uncensored/minimax-h3首尾帧生视频无审核版.json",
|
||||
"sha256": "d47d3e995858a9c581863a593d89d4f6a24ea04014a1df3faeffa7e07cb19537"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/5-数字人/Wan2.1_I2V_InfiniteTalk_rCM_数字人对口型多动态(KJ版).json",
|
||||
"sha256": "90fb512939d5bbaebfd3462d8edd019ad388611951748e6df09993ddd7f3a36f"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/5-数字人/Wan2.1_I2V_InfiniteTalk_提示词调度动作控制图生视频数字人(KJ版).json",
|
||||
"sha256": "98b4c399948f99aeac9326b4de9638d9a7bc3d718edd2561ab745f6bec12478c"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/5-数字人/Wan2.1_infinitetalk_音频驱动视频配音-单人for循环长视频(官流).json",
|
||||
"sha256": "ebd0c2823b70e5121f9642f781f2d0fa32cda6abe7d4a68fb0eecacc30e92d06"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/5-数字人/Wan2.1_infinitetalk_音频驱动视频配音-双人for循环长视频(官流).json",
|
||||
"sha256": "87412366e6bedd2a2f4490d1a945d0fc005251bb49a20e4ba1157cd6c4ddfbcd"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/6-动作迁移/Wan2.1_SCAIL2_角色迁移_动作迁移_FOR循环长视频.json",
|
||||
"sha256": "60d7a6c9b1b567d726ffd0981de3d8afb3675f88b320733d8442081d849b0ba8"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/6-动作迁移/Wan2.1_Scail-2_动作迁移_WanAnimatePlus_v4.2.json",
|
||||
"sha256": "f0da1e6c1eab5706d29d8d12897db0cea0d9d5f7a73b4882cf07ef2a626dda45"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/6-动作迁移/Wan2.1_Scail-2_角色迁移_WanAnimatePlus_v4.2.json",
|
||||
"sha256": "395dc48ad21d9da6a3a815654922193a9893696015154f53be0cc6f484882637"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/6-动作迁移/Wan2.2_Animate_SAM3-人物迁移-动作迁移-长视频循环(KJ流).json",
|
||||
"sha256": "3ea95e56f193c046937ad246087292865a809d2cc26571357c22fff415295f41"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/6-动作迁移/Wan2.2_Animate_人物遮罩替换(官流整理).json",
|
||||
"sha256": "394c3c31ad05255d3eb130f309d8445764f4d3772b40fa07fbf19708bfcc1002"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/6-动作迁移/Wan_Animate2_动作迁移_for循环长视频.json",
|
||||
"sha256": "22b7853e22629822dd354b0b768e2961a53b4c2f480cfaceeaea9dc51c0f0d0b"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/Krea2_t2i_20260818_API.json",
|
||||
"sha256": "dcf5fad9b464e4154d8ec7ba7af1c21987cb0153c7df747266a02de9f24e1313"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/MiniMax-H3-Turbo-R2V-Extend-2Refs1Vid_API.json",
|
||||
"sha256": "080a17d7ae079f278518de1af15b880a4404105ec89edbac4fd82cf16097b757"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/krea2_T2I_CharSheetV1_API.json",
|
||||
"sha256": "6a991229721d0a501846bf0bc55f793d1ab5225be28b2c9eea485fed56ed5b40"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/minimax_h3-Turbo_Image2Video_20260813_API.json",
|
||||
"sha256": "3d895b01e72c10008c036a9c65fa281b3dfe0d0808417089960fd8f4b56c48ce"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/minimax_h3-Turbo_Text2Video_20260813_API.json",
|
||||
"sha256": "55c6d0e7fb323e05c3d9373606607e0e8fefb3127cac356b03e29f19b7aaa4ed"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/video_minimax_h3_r2v_2ref_API.json",
|
||||
"sha256": "56ab7cbf2402f94000eb1df2b5415f90f36a2821e68f1c35af17a2d9498e7c49"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/video_minimax_h3_r2v_3ref_API.json",
|
||||
"sha256": "2a687133f175180584ebfc3b4318f29cfcac3a24a0f422e1b9c77e6b16c9862a"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/video_minimax_h3_r2v_4ref_API.json",
|
||||
"sha256": "0b00bfc29ad48f8af3c7b6ebc1dcaa03b809b33c24bc31dadc628289480b154a"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/video_minimax_h3_r2v_5ref_API.json",
|
||||
"sha256": "0b6c1bee6507c2485aa115d3b6c038c6c3dabf1ce8569205f8ece50e58f4e909"
|
||||
},
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/video_minimax_h3_r2v_API.json",
|
||||
"sha256": "29f440f7123b9ce64e0fda01ee3cdafb7f87408c47c1fe46c2b73f88682eae0c"
|
||||
}
|
||||
],
|
||||
"original_files": 156,
|
||||
"all_unchanged": true
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"base": "a7ea35daecd51369d28e42e92536252776ea5d7b",
|
||||
"first": {
|
||||
"imported": 155,
|
||||
"user_excluded": 1
|
||||
},
|
||||
"upgrade": {
|
||||
"skipped": 154,
|
||||
"updated": 1,
|
||||
"user_excluded": 1
|
||||
},
|
||||
"repeat": {
|
||||
"skipped": 155,
|
||||
"user_excluded": 1
|
||||
},
|
||||
"restored_rows": 1,
|
||||
"untouched_whole_rows": 154,
|
||||
"eligibility_unchanged": true,
|
||||
"redo": {
|
||||
"skipped": 154,
|
||||
"updated": 1,
|
||||
"user_excluded": 1
|
||||
},
|
||||
"user_protection": [
|
||||
{
|
||||
"phase": "user-before",
|
||||
"counts": {
|
||||
"skipped": 154,
|
||||
"conflict": 1,
|
||||
"user_excluded": 1
|
||||
},
|
||||
"whole_rows": 1,
|
||||
"columns": 29
|
||||
},
|
||||
{
|
||||
"phase": "user-after",
|
||||
"counts": {
|
||||
"skipped": 154,
|
||||
"conflict": 1,
|
||||
"user_excluded": 1
|
||||
},
|
||||
"whole_rows": 1,
|
||||
"columns": 29
|
||||
}
|
||||
],
|
||||
"fresh": {
|
||||
"imported": 155,
|
||||
"user_excluded": 1
|
||||
},
|
||||
"fresh_repeat": {
|
||||
"skipped": 155,
|
||||
"user_excluded": 1
|
||||
},
|
||||
"states": {
|
||||
"pending_check": 16,
|
||||
"needs_conversion": 139
|
||||
},
|
||||
"source_named_fields": 1217,
|
||||
"positional_widgets": 3660,
|
||||
"companion_values": 294,
|
||||
"new_saved": 67,
|
||||
"new_notes": 1,
|
||||
"old_saved": 1281,
|
||||
"old_notes": 40,
|
||||
"overviews": 38,
|
||||
"all_disabled": true,
|
||||
"doc_done": 0,
|
||||
"executed": 0
|
||||
}
|
||||
@@ -0,0 +1,683 @@
|
||||
{
|
||||
"path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json",
|
||||
"sha256": "a50e8b9961fbdd83fa42ca121ff77b3c1b058c7e454ad374b0de7c60e7b8c4a9",
|
||||
"fields": [
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 3,
|
||||
"pointer": "/nodes/0/widgets_values/0",
|
||||
"json_type": "str",
|
||||
"value": "1.png"
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 3,
|
||||
"pointer": "/nodes/0/widgets_values/1",
|
||||
"json_type": "str",
|
||||
"value": "image"
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 7,
|
||||
"pointer": "/nodes/2/widgets_values/0",
|
||||
"json_type": "int",
|
||||
"value": 9
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 7,
|
||||
"pointer": "/nodes/2/widgets_values/1",
|
||||
"json_type": "int",
|
||||
"value": 4
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 7,
|
||||
"pointer": "/nodes/2/widgets_values/2",
|
||||
"json_type": "str",
|
||||
"value": "depth"
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 7,
|
||||
"pointer": "/nodes/2/widgets_values/3",
|
||||
"json_type": "str",
|
||||
"value": "moge_3_vitg_fp16.safetensors"
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 92,
|
||||
"pointer": "/nodes/4/widgets_values/0",
|
||||
"json_type": "int",
|
||||
"value": 9
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 92,
|
||||
"pointer": "/nodes/4/widgets_values/1",
|
||||
"json_type": "int",
|
||||
"value": 4
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 92,
|
||||
"pointer": "/nodes/4/widgets_values/2",
|
||||
"json_type": "str",
|
||||
"value": "depth_colored"
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 92,
|
||||
"pointer": "/nodes/4/widgets_values/3",
|
||||
"json_type": "str",
|
||||
"value": "moge_3_vitg_fp16.safetensors"
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 96,
|
||||
"pointer": "/nodes/5/widgets_values/0",
|
||||
"json_type": "int",
|
||||
"value": 9
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 96,
|
||||
"pointer": "/nodes/5/widgets_values/1",
|
||||
"json_type": "int",
|
||||
"value": 4
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 96,
|
||||
"pointer": "/nodes/5/widgets_values/2",
|
||||
"json_type": "str",
|
||||
"value": "normal_directx"
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 96,
|
||||
"pointer": "/nodes/5/widgets_values/3",
|
||||
"json_type": "str",
|
||||
"value": "moge_3_vitg_fp16.safetensors"
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 103,
|
||||
"pointer": "/nodes/9/widgets_values/0",
|
||||
"json_type": "int",
|
||||
"value": 9
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 103,
|
||||
"pointer": "/nodes/9/widgets_values/1",
|
||||
"json_type": "int",
|
||||
"value": 4
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 103,
|
||||
"pointer": "/nodes/9/widgets_values/2",
|
||||
"json_type": "str",
|
||||
"value": "normal_opengl"
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 103,
|
||||
"pointer": "/nodes/9/widgets_values/3",
|
||||
"json_type": "str",
|
||||
"value": "moge_3_vitg_fp16.safetensors"
|
||||
},
|
||||
{
|
||||
"scope": "5b702329-a5ec-4a7d-b000-213d0c04bbbd",
|
||||
"node": 1,
|
||||
"pointer": "/definitions/subgraphs/0/nodes/0/widgets_values/0",
|
||||
"json_type": "str",
|
||||
"value": "moge_3_vitg_fp16.safetensors"
|
||||
},
|
||||
{
|
||||
"scope": "5b702329-a5ec-4a7d-b000-213d0c04bbbd",
|
||||
"node": 2,
|
||||
"pointer": "/definitions/subgraphs/0/nodes/1/widgets_values/0",
|
||||
"json_type": "int",
|
||||
"value": 9
|
||||
},
|
||||
{
|
||||
"scope": "5b702329-a5ec-4a7d-b000-213d0c04bbbd",
|
||||
"node": 2,
|
||||
"pointer": "/definitions/subgraphs/0/nodes/1/widgets_values/1",
|
||||
"json_type": "int",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"scope": "5b702329-a5ec-4a7d-b000-213d0c04bbbd",
|
||||
"node": 2,
|
||||
"pointer": "/definitions/subgraphs/0/nodes/1/widgets_values/2",
|
||||
"json_type": "int",
|
||||
"value": 4
|
||||
},
|
||||
{
|
||||
"scope": "5b702329-a5ec-4a7d-b000-213d0c04bbbd",
|
||||
"node": 2,
|
||||
"pointer": "/definitions/subgraphs/0/nodes/1/widgets_values/3",
|
||||
"json_type": "bool",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"scope": "5b702329-a5ec-4a7d-b000-213d0c04bbbd",
|
||||
"node": 2,
|
||||
"pointer": "/definitions/subgraphs/0/nodes/1/widgets_values/4",
|
||||
"json_type": "bool",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"scope": "5b702329-a5ec-4a7d-b000-213d0c04bbbd",
|
||||
"node": 2,
|
||||
"pointer": "/definitions/subgraphs/0/nodes/1/widgets_values/5",
|
||||
"json_type": "int",
|
||||
"value": 3
|
||||
},
|
||||
{
|
||||
"scope": "5b702329-a5ec-4a7d-b000-213d0c04bbbd",
|
||||
"node": 5,
|
||||
"pointer": "/definitions/subgraphs/0/nodes/2/widgets_values/0",
|
||||
"json_type": "str",
|
||||
"value": "mask"
|
||||
},
|
||||
{
|
||||
"scope": "ccd1d80d-83f8-49cd-8cdd-3dbcf528db88",
|
||||
"node": 89,
|
||||
"pointer": "/definitions/subgraphs/1/nodes/0/widgets_values/0",
|
||||
"json_type": "str",
|
||||
"value": "moge_3_vitg_fp16.safetensors"
|
||||
},
|
||||
{
|
||||
"scope": "ccd1d80d-83f8-49cd-8cdd-3dbcf528db88",
|
||||
"node": 90,
|
||||
"pointer": "/definitions/subgraphs/1/nodes/1/widgets_values/0",
|
||||
"json_type": "int",
|
||||
"value": 9
|
||||
},
|
||||
{
|
||||
"scope": "ccd1d80d-83f8-49cd-8cdd-3dbcf528db88",
|
||||
"node": 90,
|
||||
"pointer": "/definitions/subgraphs/1/nodes/1/widgets_values/1",
|
||||
"json_type": "int",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"scope": "ccd1d80d-83f8-49cd-8cdd-3dbcf528db88",
|
||||
"node": 90,
|
||||
"pointer": "/definitions/subgraphs/1/nodes/1/widgets_values/2",
|
||||
"json_type": "int",
|
||||
"value": 4
|
||||
},
|
||||
{
|
||||
"scope": "ccd1d80d-83f8-49cd-8cdd-3dbcf528db88",
|
||||
"node": 90,
|
||||
"pointer": "/definitions/subgraphs/1/nodes/1/widgets_values/3",
|
||||
"json_type": "bool",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"scope": "ccd1d80d-83f8-49cd-8cdd-3dbcf528db88",
|
||||
"node": 90,
|
||||
"pointer": "/definitions/subgraphs/1/nodes/1/widgets_values/4",
|
||||
"json_type": "bool",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"scope": "ccd1d80d-83f8-49cd-8cdd-3dbcf528db88",
|
||||
"node": 90,
|
||||
"pointer": "/definitions/subgraphs/1/nodes/1/widgets_values/5",
|
||||
"json_type": "int",
|
||||
"value": 3
|
||||
},
|
||||
{
|
||||
"scope": "ccd1d80d-83f8-49cd-8cdd-3dbcf528db88",
|
||||
"node": 91,
|
||||
"pointer": "/definitions/subgraphs/1/nodes/2/widgets_values/0",
|
||||
"json_type": "str",
|
||||
"value": "mask"
|
||||
},
|
||||
{
|
||||
"scope": "316e9ff3-946b-4908-8b75-b7764b83e62d",
|
||||
"node": 93,
|
||||
"pointer": "/definitions/subgraphs/2/nodes/0/widgets_values/0",
|
||||
"json_type": "str",
|
||||
"value": "moge_3_vitg_fp16.safetensors"
|
||||
},
|
||||
{
|
||||
"scope": "316e9ff3-946b-4908-8b75-b7764b83e62d",
|
||||
"node": 94,
|
||||
"pointer": "/definitions/subgraphs/2/nodes/1/widgets_values/0",
|
||||
"json_type": "int",
|
||||
"value": 9
|
||||
},
|
||||
{
|
||||
"scope": "316e9ff3-946b-4908-8b75-b7764b83e62d",
|
||||
"node": 94,
|
||||
"pointer": "/definitions/subgraphs/2/nodes/1/widgets_values/1",
|
||||
"json_type": "int",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"scope": "316e9ff3-946b-4908-8b75-b7764b83e62d",
|
||||
"node": 94,
|
||||
"pointer": "/definitions/subgraphs/2/nodes/1/widgets_values/2",
|
||||
"json_type": "int",
|
||||
"value": 4
|
||||
},
|
||||
{
|
||||
"scope": "316e9ff3-946b-4908-8b75-b7764b83e62d",
|
||||
"node": 94,
|
||||
"pointer": "/definitions/subgraphs/2/nodes/1/widgets_values/3",
|
||||
"json_type": "bool",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"scope": "316e9ff3-946b-4908-8b75-b7764b83e62d",
|
||||
"node": 94,
|
||||
"pointer": "/definitions/subgraphs/2/nodes/1/widgets_values/4",
|
||||
"json_type": "bool",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"scope": "316e9ff3-946b-4908-8b75-b7764b83e62d",
|
||||
"node": 94,
|
||||
"pointer": "/definitions/subgraphs/2/nodes/1/widgets_values/5",
|
||||
"json_type": "int",
|
||||
"value": 3
|
||||
},
|
||||
{
|
||||
"scope": "316e9ff3-946b-4908-8b75-b7764b83e62d",
|
||||
"node": 95,
|
||||
"pointer": "/definitions/subgraphs/2/nodes/2/widgets_values/0",
|
||||
"json_type": "str",
|
||||
"value": "mask"
|
||||
},
|
||||
{
|
||||
"scope": "245fac4e-786b-4738-ae3a-982feb33a47d",
|
||||
"node": 100,
|
||||
"pointer": "/definitions/subgraphs/3/nodes/0/widgets_values/0",
|
||||
"json_type": "str",
|
||||
"value": "moge_3_vitg_fp16.safetensors"
|
||||
},
|
||||
{
|
||||
"scope": "245fac4e-786b-4738-ae3a-982feb33a47d",
|
||||
"node": 101,
|
||||
"pointer": "/definitions/subgraphs/3/nodes/1/widgets_values/0",
|
||||
"json_type": "int",
|
||||
"value": 9
|
||||
},
|
||||
{
|
||||
"scope": "245fac4e-786b-4738-ae3a-982feb33a47d",
|
||||
"node": 101,
|
||||
"pointer": "/definitions/subgraphs/3/nodes/1/widgets_values/1",
|
||||
"json_type": "int",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"scope": "245fac4e-786b-4738-ae3a-982feb33a47d",
|
||||
"node": 101,
|
||||
"pointer": "/definitions/subgraphs/3/nodes/1/widgets_values/2",
|
||||
"json_type": "int",
|
||||
"value": 4
|
||||
},
|
||||
{
|
||||
"scope": "245fac4e-786b-4738-ae3a-982feb33a47d",
|
||||
"node": 101,
|
||||
"pointer": "/definitions/subgraphs/3/nodes/1/widgets_values/3",
|
||||
"json_type": "bool",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"scope": "245fac4e-786b-4738-ae3a-982feb33a47d",
|
||||
"node": 101,
|
||||
"pointer": "/definitions/subgraphs/3/nodes/1/widgets_values/4",
|
||||
"json_type": "bool",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"scope": "245fac4e-786b-4738-ae3a-982feb33a47d",
|
||||
"node": 101,
|
||||
"pointer": "/definitions/subgraphs/3/nodes/1/widgets_values/5",
|
||||
"json_type": "int",
|
||||
"value": 3
|
||||
},
|
||||
{
|
||||
"scope": "245fac4e-786b-4738-ae3a-982feb33a47d",
|
||||
"node": 102,
|
||||
"pointer": "/definitions/subgraphs/3/nodes/2/widgets_values/0",
|
||||
"json_type": "str",
|
||||
"value": "mask"
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 107,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/0/widgets_values/0",
|
||||
"json_type": "str",
|
||||
"value": "right"
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 107,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/0/widgets_values/1",
|
||||
"json_type": "bool",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 107,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/0/widgets_values/2",
|
||||
"json_type": "int",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 107,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/0/widgets_values/3",
|
||||
"json_type": "str",
|
||||
"value": "white"
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 108,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/1/widgets_values/0",
|
||||
"json_type": "str",
|
||||
"value": "right"
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 108,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/1/widgets_values/1",
|
||||
"json_type": "bool",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 108,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/1/widgets_values/2",
|
||||
"json_type": "int",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 108,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/1/widgets_values/3",
|
||||
"json_type": "str",
|
||||
"value": "white"
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 109,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/2/widgets_values/0",
|
||||
"json_type": "str",
|
||||
"value": "down"
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 109,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/2/widgets_values/1",
|
||||
"json_type": "bool",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 109,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/2/widgets_values/2",
|
||||
"json_type": "int",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 109,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/2/widgets_values/3",
|
||||
"json_type": "str",
|
||||
"value": "white"
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 110,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/3/widgets_values/0",
|
||||
"json_type": "str",
|
||||
"value": "scale dimensions"
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 110,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/3/widgets_values/1",
|
||||
"json_type": "int",
|
||||
"value": 2048
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 110,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/3/widgets_values/2",
|
||||
"json_type": "int",
|
||||
"value": 2048
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 110,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/3/widgets_values/3",
|
||||
"json_type": "str",
|
||||
"value": "center"
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"node": 110,
|
||||
"pointer": "/definitions/subgraphs/4/nodes/3/widgets_values/4",
|
||||
"json_type": "str",
|
||||
"value": "lanczos"
|
||||
}
|
||||
],
|
||||
"notes": [
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 8,
|
||||
"pointer": "/nodes/3/widgets_values/0",
|
||||
"json_type": "str",
|
||||
"value": "Guide: [Subgraph](https://docs.comfy.org/interface/features/subgraph)\n\n## Input Asset\n\n- [cosmic_suitcase.png](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/refs/heads/main/input/cosmic_suitcase.png)\n\n## Model Link\n\n**geometry_estimation** (one of the models below)\n\n- [moge_3_vitg_fp16.safetensors](https://huggingface.co/Comfy-Org/MoGe/resolve/main/geometry_estimation/moge_3_vitg_fp16.safetensors)\n- [moge_3_vitl_fp16.safetensors](https://huggingface.co/Comfy-Org/MoGe/resolve/main/geometry_estimation/moge_3_vitl_fp16.safetensors)\n\n\n## Model Storage Location\n\n```\n📂 ComfyUI/\n├── 📂 models/\n│ └── 📂 geometry_estimation/\n│ ├── moge_3_vitl_fp16.safetensors\n│ └── moge_3_vitg_fp16.safetensors\n```\n\n## Report Issue\n\nNote: Please update ComfyUI first ([guide](https://docs.comfy.org/installation/update_comfyui)) and prepare required models. Desktop/Cloud updates follow stable releases, so some nightly-supported models may not be available yet.\n\n- Cannot run / runtime errors: [ComfyUI/issues](https://github.com/comfyanonymous/ComfyUI/issues)\n- UI / frontend issues: [ComfyUI_frontend/issues](https://github.com/Comfy-Org/ComfyUI_frontend/issues)\n- Workflow issues: [workflow_templates/issues](https://github.com/Comfy-Org/workflow_templates/issues)\n"
|
||||
}
|
||||
],
|
||||
"empty": [
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 6,
|
||||
"state": "list",
|
||||
"value": []
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 97,
|
||||
"state": "list",
|
||||
"value": []
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 98,
|
||||
"state": "list",
|
||||
"value": []
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 99,
|
||||
"state": "list",
|
||||
"value": []
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 106,
|
||||
"state": "list",
|
||||
"value": []
|
||||
},
|
||||
{
|
||||
"scope": "root",
|
||||
"node": 111,
|
||||
"state": "missing"
|
||||
}
|
||||
],
|
||||
"scopes": [
|
||||
{
|
||||
"scope": "root",
|
||||
"nodes": 12,
|
||||
"edges": 13,
|
||||
"canonical_sha256": "1d82eb9b2c154bd82aefa3bb2a60397c15582a74f53e536fb8fce8f23ccde23e",
|
||||
"modes": [
|
||||
{
|
||||
"node": 3,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 6,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 7,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 8,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 92,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 96,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 97,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 98,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 99,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 103,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 106,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 111,
|
||||
"mode": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"scope": "5b702329-a5ec-4a7d-b000-213d0c04bbbd",
|
||||
"nodes": 3,
|
||||
"edges": 8,
|
||||
"canonical_sha256": "6c6bedb5b8c9a8d436d236eb58fbe42d12a3ccbd11a5e134b216468db331b18a",
|
||||
"modes": [
|
||||
{
|
||||
"node": 1,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 2,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 5,
|
||||
"mode": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"scope": "ccd1d80d-83f8-49cd-8cdd-3dbcf528db88",
|
||||
"nodes": 3,
|
||||
"edges": 8,
|
||||
"canonical_sha256": "4ea23431385d72954c6a394190272e35fa31ed0280a62e3cf2aea8093586d27e",
|
||||
"modes": [
|
||||
{
|
||||
"node": 89,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 90,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 91,
|
||||
"mode": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"scope": "316e9ff3-946b-4908-8b75-b7764b83e62d",
|
||||
"nodes": 3,
|
||||
"edges": 8,
|
||||
"canonical_sha256": "2009394697ad299493383704616832875f68a9554fc1fc171006dbf451129d71",
|
||||
"modes": [
|
||||
{
|
||||
"node": 93,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 94,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 95,
|
||||
"mode": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"scope": "245fac4e-786b-4738-ae3a-982feb33a47d",
|
||||
"nodes": 3,
|
||||
"edges": 8,
|
||||
"canonical_sha256": "1246bed08aefb1ce9bd3922585826b7a68a3ca4c60286c443d5309f6b2cfb67f",
|
||||
"modes": [
|
||||
{
|
||||
"node": 100,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 101,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 102,
|
||||
"mode": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"scope": "8153e69f-6ca0-4bdb-8fae-ebc79a251f18",
|
||||
"nodes": 4,
|
||||
"edges": 8,
|
||||
"canonical_sha256": "a583e6ba9e2acbb950f2ac36bd634b1f4c5835bd8107461dc59a9071313dae9c",
|
||||
"modes": [
|
||||
{
|
||||
"node": 107,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 108,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 109,
|
||||
"mode": 0
|
||||
},
|
||||
{
|
||||
"node": 110,
|
||||
"mode": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"ports": [8247, 5173], "connections_refused": true}
|
||||
@@ -0,0 +1,71 @@
|
||||
"""Independent byte/pointer inventory; no inferred widget names or execution."""
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[3]
|
||||
OUT = Path(__file__).resolve().parent
|
||||
|
||||
|
||||
def inventory():
|
||||
p = next((ROOT / "example_ComfyUI_workflows").rglob("moge3_*.json"))
|
||||
raw = p.read_bytes()
|
||||
g = json.loads(raw)
|
||||
fields = []
|
||||
notes = []
|
||||
empty = []
|
||||
scopes = [("root", "", g)] + [
|
||||
(s["id"], f"/definitions/subgraphs/{i}", s)
|
||||
for i, s in enumerate(g["definitions"]["subgraphs"])
|
||||
]
|
||||
for scope, base, graph in scopes:
|
||||
for i, n in enumerate(graph["nodes"]):
|
||||
ptr = f"{base}/nodes/{i}/widgets_values"
|
||||
if "widgets_values" not in n:
|
||||
empty.append({"scope": scope, "node": n["id"], "state": "missing"})
|
||||
continue
|
||||
w = n["widgets_values"]
|
||||
if not w:
|
||||
empty.append(
|
||||
{"scope": scope, "node": n["id"], "state": type(w).__name__, "value": w}
|
||||
)
|
||||
for k in w if isinstance(w, dict) else range(len(w)):
|
||||
v = w[k]
|
||||
e = {
|
||||
"scope": scope,
|
||||
"node": n["id"],
|
||||
"pointer": ptr + "/" + str(k),
|
||||
"json_type": type(v).__name__,
|
||||
"value": v,
|
||||
}
|
||||
(notes if n["type"] == "MarkdownNote" else fields).append(e)
|
||||
return {
|
||||
"path": str(p.relative_to(ROOT)),
|
||||
"sha256": hashlib.sha256(raw).hexdigest(),
|
||||
"fields": fields,
|
||||
"notes": notes,
|
||||
"empty": empty,
|
||||
"scopes": [
|
||||
{
|
||||
"scope": s,
|
||||
"nodes": len(gr["nodes"]),
|
||||
"edges": len(gr["links"]),
|
||||
"canonical_sha256": hashlib.sha256(
|
||||
json.dumps(
|
||||
gr, ensure_ascii=False, sort_keys=True, separators=(",", ":")
|
||||
).encode()
|
||||
).hexdigest(),
|
||||
"modes": [{"node": n["id"], "mode": n["mode"]} for n in gr["nodes"]],
|
||||
}
|
||||
for s, _, gr in scopes
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
x = inventory()
|
||||
(OUT / "independent-inventory.json").write_text(
|
||||
json.dumps(x, ensure_ascii=False, indent=2) + "\n"
|
||||
)
|
||||
print(len(x["fields"]), len(x["notes"]), x["scopes"])
|
||||
@@ -0,0 +1,3 @@
|
||||
All checks passed!
|
||||
13 files already formatted
|
||||
PASS 13 authored Python files and one JS syntax check
|
||||
@@ -0,0 +1,25 @@
|
||||
All checks passed!
|
||||
unformatted: File would be reformatted
|
||||
--> calliope-backend/src/calliope/comfyui/fixed_document.py:19:9
|
||||
|
|
||||
18 | (
|
||||
- 'example_ComfyUI_workflows/0-基础处理:图像合并-音频'
|
||||
- '分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.j'
|
||||
- 'son'
|
||||
- ): '79c898a182b898814999d7eafaf9f4fd023c64e5482f4415e3d3ef1247836df6',
|
||||
19 + "example_ComfyUI_workflows/0-基础处理:图像合并-音频"
|
||||
20 + "分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.j"
|
||||
21 + "son"
|
||||
22 + ): "79c898a182b898814999d7eafaf9f4fd023c64e5482f4415e3d3ef1247836df6",
|
||||
23 | (
|
||||
|
|
||||
|
||||
1 file would be reformatted, 11 files already formatted
|
||||
Traceback (most recent call last):
|
||||
File "/home/xiaomo/multica_workspaces/hello-af23464d222e/hel-892-c5b13bb9a9b3/workdir/aigc-home/docs/hel-892/moge3-document-evidence/check_code.py", line 40, in <module>
|
||||
main()
|
||||
File "/home/xiaomo/multica_workspaces/hello-af23464d222e/hel-892-c5b13bb9a9b3/workdir/aigc-home/docs/hel-892/moge3-document-evidence/check_code.py", line 18, in main
|
||||
subprocess.run(
|
||||
File "/usr/lib/python3.10/subprocess.py", line 526, in run
|
||||
raise CalledProcessError(retcode, process.args,
|
||||
subprocess.CalledProcessError: Command '['uv', 'run', '--project', 'calliope-backend', '--offline', 'ruff', 'format', '--check', '--config', 'calliope-backend/pyproject.toml', 'calliope-backend/src/calliope/comfyui/fixed_document.py', 'calliope-backend/tests/test_moge3_fixed_document.py', 'e2e/run-moge3-document.py', 'docs/hel-892/moge3-document-evidence/build_definition.py', 'docs/hel-892/moge3-document-evidence/check_code.py', 'docs/hel-892/moge3-document-evidence/fetch_sources.py', 'docs/hel-892/moge3-document-evidence/inventory.py', 'docs/hel-892/moge3-document-evidence/rebuild.py', 'docs/hel-892/moge3-document-evidence/recompute.py', 'docs/hel-892/moge3-document-evidence/render_report.py', 'docs/hel-892/moge3-document-evidence/repeat.py', 'docs/hel-892/moge3-document-evidence/verify_sources.py']' returned non-zero exit status 1.
|
||||
@@ -0,0 +1,23 @@
|
||||
[
|
||||
{
|
||||
"file": "fixed_document.py",
|
||||
"sha256": "dee51e5672429470215afef9bdf788143037e6339f12841b524fe38133ef58e2",
|
||||
"wheel": true,
|
||||
"sdist": true,
|
||||
"definitions": 38
|
||||
},
|
||||
{
|
||||
"file": "source_reviews.json",
|
||||
"sha256": "71b3b5bb9526d183e1d76f05ca59369e77ab8ffb36447a98be5a3e4ce82a4f73",
|
||||
"wheel": true,
|
||||
"sdist": true,
|
||||
"definitions": 38
|
||||
},
|
||||
{
|
||||
"file": "library.py",
|
||||
"sha256": "b9cbfce28267642e6db3ebe9d591cf8dd260c7772a5a21a8d36cb98915eca13c",
|
||||
"wheel": true,
|
||||
"sdist": true,
|
||||
"definitions": 38
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json": "4648bba0e64192278393c36433c58f742b1f4f189083f992baef9e055d7ef280"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"url": "https://gitea.xbay.cc/leefer/aigc-home/pulls/25",
|
||||
"state": "open",
|
||||
"merged": false,
|
||||
"base": "main",
|
||||
"head": "agent/agent/a64a969a6a44",
|
||||
"sha": "a7ea35daecd51369d28e42e92536252776ea5d7b",
|
||||
"multica_link_table": "empty; provider checked directly"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
........................................................................ [ 16%]
|
||||
........................................................................ [ 33%]
|
||||
........................................................................ [ 50%]
|
||||
........................................................................ [ 66%]
|
||||
........................................................................ [ 83%]
|
||||
....................................................................... [100%]
|
||||
=============================== warnings summary ===============================
|
||||
calliope-backend/.venv/lib/python3.12/site-packages/starlette/testclient.py:53
|
||||
/home/xiaomo/multica_workspaces/hello-af23464d222e/hel-892-c5b13bb9a9b3/workdir/aigc-home/calliope-backend/.venv/lib/python3.12/site-packages/starlette/testclient.py:53: DeprecationWarning: The anyio.abc.BlockingPortal alias is deprecated, use anyio.from_thread.BlockingPortal instead.
|
||||
_PortalFactoryType = Callable[[], AbstractContextManager[anyio.abc.BlockingPortal]]
|
||||
|
||||
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
|
||||
431 passed, 1 warning in 5.38s
|
||||
@@ -0,0 +1,8 @@
|
||||
. [100%]
|
||||
=============================== warnings summary ===============================
|
||||
calliope-backend/.venv/lib/python3.12/site-packages/starlette/testclient.py:53
|
||||
/home/xiaomo/multica_workspaces/hello-af23464d222e/hel-892-c5b13bb9a9b3/workdir/aigc-home/calliope-backend/.venv/lib/python3.12/site-packages/starlette/testclient.py:53: DeprecationWarning: The anyio.abc.BlockingPortal alias is deprecated, use anyio.from_thread.BlockingPortal instead.
|
||||
_PortalFactoryType = Callable[[], AbstractContextManager[anyio.abc.BlockingPortal]]
|
||||
|
||||
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
|
||||
1 passed, 1 warning in 0.08s
|
||||
@@ -0,0 +1,43 @@
|
||||
........................................................................ [ 16%]
|
||||
........................................................................ [ 33%]
|
||||
........................................................................ [ 50%]
|
||||
........................................................................ [ 66%]
|
||||
........................................................................ [ 83%]
|
||||
.......................................................F............... [100%]
|
||||
=================================== FAILURES ===================================
|
||||
___________ test_inventory_all_instances_and_frozen_previous_reviews ___________
|
||||
|
||||
def test_inventory_all_instances_and_frozen_previous_reviews():
|
||||
inv=json.loads((OUT/'independent-inventory.json').read_bytes())
|
||||
assert [f['pointer'] for f in inv['fields']]==[f['pointer'] for f in BLOCK['fields']]
|
||||
assert len(BLOCK['fields'])==67 and len(BLOCK['comments'])==1
|
||||
assert sum(f['scope']=='root' for f in BLOCK['fields'])==18
|
||||
assert len({f['scope'] for f in BLOCK['fields']})==6
|
||||
assert [e['state'] for e in inv['empty']]==['list']*5+['missing']
|
||||
assert BLOCK['comments'][0]['text']==pointer(SOURCE,BLOCK['comments'][0]['pointer'])
|
||||
resource='calliope-backend/src/calliope/comfyui/source_reviews.json'
|
||||
old=json.loads(subprocess.check_output(['git','show','a7ea35daecd51369d28e42e92536252776ea5d7b:'+resource],cwd=REPO))
|
||||
cur=json.loads((REPO/resource).read_bytes());cur[PATH].pop('fixed_version_document');assert cur==old
|
||||
blocks=[r['fixed_version_document'] for r in old.values() if 'fixed_version_document' in r]
|
||||
> assert len(blocks)==37 and sum(len(b['fields']) for b in blocks)==1281 and sum(len(b['comments']) for b in blocks)==40
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
calliope-backend/tests/test_moge3_fixed_document.py:156:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
|
||||
.0 = <list_iterator object at 0x7f1d77b985e0>
|
||||
|
||||
> assert len(blocks)==37 and sum(len(b['fields']) for b in blocks)==1281 and sum(len(b['comments']) for b in blocks)==40
|
||||
^^^^^^^^^^^^^
|
||||
E KeyError: 'comments'
|
||||
|
||||
calliope-backend/tests/test_moge3_fixed_document.py:156: KeyError
|
||||
=============================== warnings summary ===============================
|
||||
calliope-backend/.venv/lib/python3.12/site-packages/starlette/testclient.py:53
|
||||
/home/xiaomo/multica_workspaces/hello-af23464d222e/hel-892-c5b13bb9a9b3/workdir/aigc-home/calliope-backend/.venv/lib/python3.12/site-packages/starlette/testclient.py:53: DeprecationWarning: The anyio.abc.BlockingPortal alias is deprecated, use anyio.from_thread.BlockingPortal instead.
|
||||
_PortalFactoryType = Callable[[], AbstractContextManager[anyio.abc.BlockingPortal]]
|
||||
|
||||
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
|
||||
=========================== short test summary info ============================
|
||||
FAILED calliope-backend/tests/test_moge3_fixed_document.py::test_inventory_all_instances_and_frozen_previous_reviews
|
||||
1 failed, 430 passed, 1 warning in 5.32s
|
||||
@@ -0,0 +1,15 @@
|
||||
[
|
||||
"calliope-backend/src/calliope/comfyui/fixed_document.py",
|
||||
"calliope-backend/tests/test_moge3_fixed_document.py",
|
||||
"e2e/run-moge3-document.py",
|
||||
"docs/hel-892/moge3-document-evidence/build_definition.py",
|
||||
"docs/hel-892/moge3-document-evidence/check_code.py",
|
||||
"docs/hel-892/moge3-document-evidence/fetch_sources.py",
|
||||
"docs/hel-892/moge3-document-evidence/inventory.py",
|
||||
"docs/hel-892/moge3-document-evidence/rebuild.py",
|
||||
"docs/hel-892/moge3-document-evidence/recompute.py",
|
||||
"docs/hel-892/moge3-document-evidence/render_report.py",
|
||||
"docs/hel-892/moge3-document-evidence/repeat.py",
|
||||
"docs/hel-892/moge3-document-evidence/request_counts.py",
|
||||
"docs/hel-892/moge3-document-evidence/verify_sources.py"
|
||||
]
|
||||
@@ -0,0 +1,64 @@
|
||||
"Add one reviewed definition; preserve every other review object exactly."
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import subprocess
|
||||
|
||||
from build_definition import OUT, PATHS, REPO, build, canonical
|
||||
|
||||
BASE = "a7ea35daecd51369d28e42e92536252776ea5d7b"
|
||||
RESOURCE = "calliope-backend/src/calliope/co" + "mfyui/source_reviews.json"
|
||||
|
||||
|
||||
def build_all():
|
||||
previous = json.loads(subprocess.check_output(["git", "show", f"{BASE}:{RESOURCE}"], cwd=REPO))
|
||||
reviews = json.loads(json.dumps(previous, ensure_ascii=False))
|
||||
for i, path in enumerate(PATHS):
|
||||
block = build(i)
|
||||
assert reviews[path]["source_sha"] == block["source_sha1"]
|
||||
assert "fixed_version_document" not in previous[path]
|
||||
reviews[path]["fixed_version_document"] = block
|
||||
return reviews, previous
|
||||
|
||||
|
||||
def main():
|
||||
current = json.loads((REPO / RESOURCE).read_bytes())
|
||||
reviews, _previous = build_all()
|
||||
(REPO / RESOURCE).write_text(json.dumps(reviews, ensure_ascii=False, indent=2) + "\n")
|
||||
pins = {}
|
||||
for i, path in enumerate(PATHS):
|
||||
block = reviews[path]["fixed_version_document"]
|
||||
pins[path] = hashlib.sha256(canonical(block)).hexdigest()
|
||||
(OUT / f"definition-{i}.json").write_text(
|
||||
json.dumps(block, ensure_ascii=False, indent=2) + "\n"
|
||||
)
|
||||
# Explicit maintenance of the code-owned allowlist, never trust runtime caller digests.
|
||||
module = REPO / ("calliope-backend/src/calliope/co" + "mfyui/fixed_document.py")
|
||||
text = module.read_text()
|
||||
for path, digest in pins.items():
|
||||
old_block = current[path].get("fixed_version_document")
|
||||
old_digest = hashlib.sha256(canonical(old_block)).hexdigest() if old_block else None
|
||||
if old_digest and old_digest in text:
|
||||
text = text.replace(old_digest, digest)
|
||||
elif digest in text:
|
||||
pass
|
||||
else:
|
||||
text = text.replace(
|
||||
"DEFINITIONS = {",
|
||||
"DEFINITIONS = {\n (\n"
|
||||
+ "".join(
|
||||
" " + repr(path[i : i + 40]) + "\n" for i in range(0, len(path), 40)
|
||||
)
|
||||
+ " ): "
|
||||
+ repr(digest)
|
||||
+ ",",
|
||||
)
|
||||
module.write_text(text)
|
||||
(OUT / "pins.json").write_text(json.dumps(pins, ensure_ascii=False, indent=2) + "\n")
|
||||
print(("PASS one definition; other 155 r" + "eviews and old 37 blocks unchang" + "ed"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,340 @@
|
||||
"Real historical-code upgrade/rollback, including an existing reference document."
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
import sqlite3
|
||||
import subprocess
|
||||
import sys
|
||||
import tarfile
|
||||
import tempfile
|
||||
import zipfile
|
||||
from pathlib import Path
|
||||
|
||||
from build_definition import OUT, PATHS, REPO, canonical
|
||||
from rebuild import BASE, RESOURCE, build_all
|
||||
|
||||
BASE = os.environ.get("MOGE3_IMPORT_BASE", BASE)
|
||||
|
||||
sys.path.insert(0, str(REPO / "calliope-backend"))
|
||||
|
||||
|
||||
def write(name, value):
|
||||
(OUT / name).write_text(json.dumps(value, ensure_ascii=False, indent=2) + "\n")
|
||||
|
||||
|
||||
def require_packages():
|
||||
dist = REPO / "calliope-backend/dist"
|
||||
w = sorted(dist.glob("*.whl"))
|
||||
s = sorted(dist.glob("*.tar.gz"))
|
||||
if not w or not s:
|
||||
raise SystemExit(
|
||||
(
|
||||
"缺少wheel/sdist包产物,请先在仓库根执行:uv bui"
|
||||
+ "ld --project calliope-backend --"
|
||||
+ "offline"
|
||||
)
|
||||
)
|
||||
return w[-1], s[-1]
|
||||
|
||||
|
||||
def main():
|
||||
from calliope.comfyui.fixed_document import DEFINITIONS
|
||||
from calliope.comfyui.library import rollback_batch
|
||||
from scripts.audit_library_documents import audit
|
||||
|
||||
wheels, sdists = require_packages()
|
||||
from verify_sources import main as verify_sources
|
||||
|
||||
verify_sources()
|
||||
rebuilt, previous = build_all()
|
||||
assert rebuilt == json.loads((REPO / RESOURCE).read_bytes())
|
||||
old_blocks = {
|
||||
p: r["fixed_version_document"] for p, r in previous.items() if "fixed_version_document" in r
|
||||
}
|
||||
assert len(old_blocks) == 37
|
||||
assert all(rebuilt[p]["fixed_version_document"] == b for p, b in old_blocks.items())
|
||||
assert sum(len(b["fields"]) for b in old_blocks.values()) == 1281
|
||||
for p, d in DEFINITIONS.items():
|
||||
assert hashlib.sha256(canonical(rebuilt[p]["fixed_version_document"])).hexdigest() == d
|
||||
write(
|
||||
"review-delta.json",
|
||||
{
|
||||
"base": BASE,
|
||||
"changed_paths": PATHS,
|
||||
"other_reviews_unchanged": 155,
|
||||
"old_blocks_unchanged": 37,
|
||||
"old_saved": 1281,
|
||||
"old_notes": 40,
|
||||
"new_saved": 67,
|
||||
"new_notes": 1,
|
||||
"total_documents": 38,
|
||||
"total_saved": 1348,
|
||||
"total_notes": 41,
|
||||
},
|
||||
)
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
work = Path(directory)
|
||||
old = work / "old"
|
||||
old.mkdir()
|
||||
data = subprocess.check_output(["git", "archive", BASE, "calliope-backend/src"], cwd=REPO)
|
||||
with tarfile.open(fileobj=io.BytesIO(data)) as a:
|
||||
a.extractall(old, filter="data")
|
||||
db = work / "library.db"
|
||||
|
||||
def run(name, historical=False):
|
||||
out = work / name
|
||||
env = {
|
||||
**os.environ,
|
||||
"PYTHONPATH": str((old if historical else REPO) / "calliope-backend/src"),
|
||||
}
|
||||
subprocess.run(
|
||||
[
|
||||
sys.executable,
|
||||
"-m",
|
||||
"calliope.comfyui.library_cli",
|
||||
"import",
|
||||
"--root",
|
||||
str(REPO / "example_ComfyUI_workflows"),
|
||||
"--db",
|
||||
str(db),
|
||||
"--source-commit",
|
||||
BASE,
|
||||
"--companions",
|
||||
str(REPO / ("docs/hel-892/supplied-api/manife" + "st.json")),
|
||||
"--output-dir",
|
||||
str(out),
|
||||
],
|
||||
cwd=REPO,
|
||||
env=env,
|
||||
check=True,
|
||||
stdout=subprocess.DEVNULL,
|
||||
)
|
||||
return json.loads((out / "import_report.json").read_bytes()), out
|
||||
|
||||
def rows():
|
||||
with sqlite3.connect(db) as c:
|
||||
c.row_factory = sqlite3.Row
|
||||
return {
|
||||
r["source_repo_path"]: dict(r) for r in c.execute("SELECT * FROM workflows")
|
||||
}
|
||||
|
||||
first, _ = run("historical", True)
|
||||
before = rows()
|
||||
assert first["counts"] == {"imported": 155, "user_excluded": 1}
|
||||
assert all(
|
||||
"fixed_version" in json.loads(before[p]["doc_json"])
|
||||
if BASE.startswith("3c307e0")
|
||||
else "fixed_version" not in json.loads(before[p]["doc_json"])
|
||||
for p in PATHS
|
||||
)
|
||||
assert all(
|
||||
json.loads(before[p]["doc_json"])["fixed_version"]["matched"]
|
||||
for p in DEFINITIONS
|
||||
if p not in PATHS
|
||||
)
|
||||
original = db
|
||||
protected = []
|
||||
|
||||
def protect(name):
|
||||
nonlocal db
|
||||
db = work / (name + ".db")
|
||||
with sqlite3.connect(original) as src, sqlite3.connect(db) as dst:
|
||||
src.backup(dst)
|
||||
for p in PATHS:
|
||||
dst.execute(
|
||||
("UPDATE workflows SET description" + "=? WHERE source_repo_path=?"),
|
||||
(name, p),
|
||||
)
|
||||
snapshot = rows()
|
||||
r, _ = run(name)
|
||||
assert r["counts"] == {"conflict": 1, "skipped": 154, "user_excluded": 1}
|
||||
assert rows() == snapshot and all(len(snapshot[p]) == 29 for p in PATHS)
|
||||
protected.append({"phase": name, "counts": r["counts"], "whole_rows": 1, "columns": 29})
|
||||
db = original
|
||||
|
||||
protect("user-before")
|
||||
upgrade, exported = run("upgrade")
|
||||
after = rows()
|
||||
assert upgrade["counts"] == {"updated": 1, "skipped": 154, "user_excluded": 1}
|
||||
for p, row in after.items():
|
||||
if p not in PATHS:
|
||||
assert row == before[p]
|
||||
continue
|
||||
assert len(row) == 29
|
||||
assert all(
|
||||
row[k] == before[p][k]
|
||||
for k in row.keys() - {"doc_json", "batch_id", "imported_at", "library_fingerprint"}
|
||||
)
|
||||
d = json.loads(row["doc_json"])
|
||||
assert d["fixed_version"]["matched"]
|
||||
old_doc = json.loads(before[p]["doc_json"])
|
||||
without = dict(d)
|
||||
fixed = without.pop("fixed_version")
|
||||
replaced_steps = len(old_doc.get("fixed_version", {}).get("steps", [])) or 3
|
||||
assert without["steps"] == old_doc["steps"][:-replaced_steps] + fixed["steps"]
|
||||
without["steps"] = old_doc["steps"]
|
||||
assert without.pop("source_review_sha") != old_doc.pop("source_review_sha")
|
||||
old_doc.pop("fixed_version", None)
|
||||
assert without == old_doc
|
||||
write("actual-" + Path(p).stem + ".json", d)
|
||||
repeat, _ = run("repeat")
|
||||
assert repeat["counts"] == {"skipped": 155, "user_excluded": 1}
|
||||
with sqlite3.connect(db) as c:
|
||||
c.row_factory = sqlite3.Row
|
||||
r = rollback_batch(c, upgrade["batch_id"])
|
||||
assert len(r["files"]) == 1 and all(f["result"] == "restored" for f in r["files"])
|
||||
assert rows() == before
|
||||
redo, _ = run("redo")
|
||||
assert redo["counts"] == upgrade["counts"]
|
||||
protect("user-after")
|
||||
db = work / "fresh.db"
|
||||
fresh, exported = run("fresh")
|
||||
fresh_repeat, _ = run("fresh-repeat")
|
||||
assert fresh["counts"] == first["counts"] and fresh_repeat["counts"] == repeat["counts"]
|
||||
assert fresh["states"] == {"pending_check": 16, "needs_conversion": 139}
|
||||
companion = 0
|
||||
for row in rows().values():
|
||||
d = json.loads(row["doc_json"])
|
||||
companion += sum(p.get("value_origin") == "supplied_api_companion" for p in d["params"])
|
||||
assert (
|
||||
not row["is_enabled"]
|
||||
and row["doc_completed_at"] is None
|
||||
and row["exec_verified_at"] is None
|
||||
)
|
||||
assert not d["status"]["doc_done"] and not d["status"]["exec_verified"]
|
||||
assert d["dependencies"]["check_state"] == "unchecked"
|
||||
report = audit(REPO, exported)
|
||||
assert (
|
||||
report["named_values_preserved"] == 1217
|
||||
and report["unnamed_widget_nodes"] == 3660
|
||||
and companion == 294
|
||||
)
|
||||
assert report["full_documents_completed"] == report["real_executions"] == 0
|
||||
write("audit-summary.json", {k: v for k, v in report.items() if k != "files"})
|
||||
write(
|
||||
"import-protection.json",
|
||||
{
|
||||
"base": BASE,
|
||||
"first": first["counts"],
|
||||
"upgrade": upgrade["counts"],
|
||||
"repeat": repeat["counts"],
|
||||
"restored_rows": 1,
|
||||
"untouched_whole_rows": 154,
|
||||
"eligibility_unchanged": True,
|
||||
"redo": redo["counts"],
|
||||
"user_protection": protected,
|
||||
"fresh": fresh["counts"],
|
||||
"fresh_repeat": fresh_repeat["counts"],
|
||||
"states": fresh["states"],
|
||||
"source_named_fields": 1217,
|
||||
"positional_widgets": 3660,
|
||||
"companion_values": companion,
|
||||
"new_saved": 67,
|
||||
"new_notes": 1,
|
||||
"old_saved": 1281,
|
||||
"old_notes": 40,
|
||||
"overviews": 38,
|
||||
"all_disabled": True,
|
||||
"doc_done": 0,
|
||||
"executed": 0,
|
||||
},
|
||||
)
|
||||
old_reviews = json.loads(
|
||||
subprocess.check_output(["git", "show", f"{BASE}:{RESOURCE}"], cwd=REPO)
|
||||
)
|
||||
current = json.loads((REPO / RESOURCE).read_bytes())
|
||||
for p in PATHS:
|
||||
current[p].pop("fixed_version_document")
|
||||
old_reviews[p].pop("fixed_version_document", None)
|
||||
assert current == old_reviews
|
||||
boundaries = json.loads(
|
||||
(REPO / ("docs/hel-892/h3-document-evidenc" + "e/unchanged-boundaries.json")).read_bytes()
|
||||
)
|
||||
paths = (
|
||||
[f["path"] for f in boundaries["files"]]
|
||||
+ boundaries["frozen_conversion_and_audits"]
|
||||
+ [("calliope-backend/src/calliope/co" + "mfyui/library.py")]
|
||||
)
|
||||
kept = []
|
||||
for p in paths:
|
||||
raw = (REPO / p).read_bytes()
|
||||
assert raw == subprocess.check_output(["git", "show", f"{BASE}:{p}"], cwd=REPO)
|
||||
kept.append({"path": p, "sha256": hashlib.sha256(raw).hexdigest()})
|
||||
ui = "calliope-web/src/lib/components/" + "WorkflowDocumentDrawer.svelte"
|
||||
drawer_bytes = (REPO / ui).read_bytes()
|
||||
assert drawer_bytes == subprocess.check_output(["git", "show", f"{BASE}:{ui}"], cwd=REPO)
|
||||
|
||||
write(
|
||||
"boundaries.json",
|
||||
{
|
||||
"base": BASE,
|
||||
"files": kept,
|
||||
"originals": 163,
|
||||
"old_thirty_seven_blocks_unchanged": True,
|
||||
"drawer_css_unchanged": True,
|
||||
"drawer_whole_file_unchanged": True,
|
||||
"drawer_sha256": hashlib.sha256(drawer_bytes).hexdigest(),
|
||||
"conversion_rerun": False,
|
||||
"profiles_28_candidates_9_diffs_6": "unchanged",
|
||||
},
|
||||
)
|
||||
tracked = (
|
||||
subprocess.check_output(["git", "ls-tree", "-rz", "--name-only", BASE], cwd=REPO)
|
||||
.decode()
|
||||
.rstrip("\0")
|
||||
.split("\0")
|
||||
)
|
||||
frozen = [
|
||||
p
|
||||
for p in tracked
|
||||
if p.startswith(("example_ComfyUI_workflows/", "docs/hel-892/supplied-api/"))
|
||||
or p.startswith(("calliope-backend/src/calliope/co" + "mfyui/"))
|
||||
and p not in [RESOURCE, ("calliope-backend/src/calliope/co" + "mfyui/fixed_document.py")]
|
||||
]
|
||||
for p in frozen:
|
||||
assert (REPO / p).read_bytes() == subprocess.check_output(
|
||||
["git", "show", f"{BASE}:{p}"], cwd=REPO
|
||||
)
|
||||
write(
|
||||
"frozen-resource-check.json",
|
||||
{
|
||||
"base": BASE,
|
||||
"files": [
|
||||
{"path": p, "sha256": hashlib.sha256((REPO / p).read_bytes()).hexdigest()}
|
||||
for p in frozen
|
||||
],
|
||||
"original_files": sum(p.startswith("example_ComfyUI_workflows/") for p in frozen),
|
||||
"all_unchanged": True,
|
||||
},
|
||||
)
|
||||
packages = []
|
||||
with zipfile.ZipFile(wheels) as w, tarfile.open(sdists) as s:
|
||||
for name in ["fixed_document.py", "source_reviews.json", "library.py"]:
|
||||
raw = (REPO / ("calliope-backend/src/calliope/co" + "mfyui") / name).read_bytes()
|
||||
assert w.read("calliope/comfyui/" + name) == raw
|
||||
member = next(n for n in s.getnames() if n.endswith("/src/calliope/comfyui/" + name))
|
||||
assert s.extractfile(member).read() == raw
|
||||
packages.append(
|
||||
{
|
||||
"file": name,
|
||||
"sha256": hashlib.sha256(raw).hexdigest(),
|
||||
"wheel": True,
|
||||
"sdist": True,
|
||||
"definitions": 38,
|
||||
}
|
||||
)
|
||||
write("package-check.json", packages)
|
||||
print(
|
||||
f"PASS actual {BASE} upgrade1/skip154, repe"
|
||||
"at155, rollback1, edits1/29cols, fresh155,"
|
||||
" 1217/3660/294, 38 definitions, frozen bou"
|
||||
"ndaries, wheel/sdist"
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,2 @@
|
||||
PASS exact provenance, every scope/pointer/value and all physical edges
|
||||
PASS actual a7ea35daecd51369d28e42e92536252776ea5d7b upgrade1/skip154, repeat155, rollback1, edits1/29cols, fresh155, 1217/3660/294, 38 definitions, frozen boundaries, wheel/sdist
|
||||
@@ -0,0 +1,131 @@
|
||||
"Readable complete Chinese definitions and fixed source index from delivered data."
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
OUT = Path(__file__).resolve().parent
|
||||
|
||||
|
||||
def main():
|
||||
lines = [
|
||||
"# MoGe3深度几何固定参考中文说明",
|
||||
"",
|
||||
(
|
||||
"新增67保存位置/1注释;旧37块1281位置+40注释逐对象不"
|
||||
+ "变,38图1348+41仅参考;155定稿0/实跑0/新增转换0"
|
||||
+ "。"
|
||||
),
|
||||
"",
|
||||
(
|
||||
"来源local_file以docs/hel-892/moge3-document"
|
||||
+ ("-evidence为基准;源SHA/全图摘要/定义摘要绑定;不加" + "载上游代码、媒体或链接。")
|
||||
),
|
||||
"",
|
||||
]
|
||||
index = []
|
||||
for i in range(1):
|
||||
b = json.loads((OUT / f"definition-{i}.json").read_bytes())
|
||||
lines += [
|
||||
"## " + Path(b["source_path"]).stem,
|
||||
"",
|
||||
b["user_overview"],
|
||||
"",
|
||||
b["notice"],
|
||||
"",
|
||||
"源路径:`" + b["source_path"] + "`",
|
||||
"",
|
||||
"SHA1:" + b["source_sha1"],
|
||||
"",
|
||||
"原字节SHA256:" + b["source_sha256"],
|
||||
"",
|
||||
"规范全图SHA256:" + b["canonical_sha256"],
|
||||
"",
|
||||
*[v + "\n" for v in b["versions"]],
|
||||
"### 具体连线与处理条件",
|
||||
"",
|
||||
*[v + "\n" for v in b["flow"]],
|
||||
"### 使用与核对",
|
||||
"",
|
||||
*[v + "\n" for v in b["steps"]],
|
||||
"### 逐保存位置说明",
|
||||
"",
|
||||
]
|
||||
for j, f in enumerate(b["fields"], 1):
|
||||
lines += [
|
||||
f"#### {j}. 节点{f['node_id']} · {f['label']}({f['field']})",
|
||||
"",
|
||||
f["effect"],
|
||||
"",
|
||||
"```json",
|
||||
json.dumps(f["value"], ensure_ascii=False, indent=2),
|
||||
"```",
|
||||
"",
|
||||
f"类:{f['class_type']};JSON类型:{f['json_type']};角色:{f['role']}。",
|
||||
"",
|
||||
"源保存位置:`" + f["pointer"] + "`;源输入口:`" + f["input_pointer"] + "`",
|
||||
"",
|
||||
"具名保存位置:`" + f["named_pointer"] + "`;作用域:" + f["scope"],
|
||||
"",
|
||||
"定义默认:" + f["schema_default"] + ";单位:" + f["unit"],
|
||||
"",
|
||||
"范围/条件:" + f["limits"],
|
||||
"",
|
||||
f["execution_note"],
|
||||
"",
|
||||
"依据:",
|
||||
]
|
||||
for k in f["evidence"]:
|
||||
e = b["sources"][k]
|
||||
lines += [
|
||||
(
|
||||
f"- [{k}] {e['claim']};{e['file']} {e['lines'][0]}~{e['lines'][1]}行;"
|
||||
f"commit {e['commit']};SHA256 {e['sha256']};{e['url']}"
|
||||
)
|
||||
]
|
||||
if "named_value" in f and f["named_value"] != f["value"]:
|
||||
lines += [
|
||||
"具名保存完整形态(与位置列表分开保留):",
|
||||
"",
|
||||
"```json",
|
||||
json.dumps(f["named_value"], ensure_ascii=False, indent=2),
|
||||
"```",
|
||||
"",
|
||||
]
|
||||
lines += [""]
|
||||
lines += ["### 零保存节点与源注释", ""]
|
||||
for z in b["zero_saved_nodes"]:
|
||||
lines += [z["node_id"] + " " + z["class_type"] + ":" + z["effect"], ""]
|
||||
for n in b["comments"]:
|
||||
lines += [
|
||||
"节点" + n["node_id"] + ",位置`" + n["pointer"] + "`",
|
||||
"",
|
||||
n["meaning"],
|
||||
"",
|
||||
"```text",
|
||||
n["text"],
|
||||
"```",
|
||||
"",
|
||||
]
|
||||
lines += ["### 固定原件索引", ""]
|
||||
for k, e in enumerate(b["sources"]):
|
||||
data = (OUT / e["local_file"]).read_bytes()
|
||||
assert hashlib.sha256(data).hexdigest() == e["sha256"]
|
||||
lines += [
|
||||
(
|
||||
f"{k}. {e['claim']};{e['file']} 第{e['lines'][0]}~{e['lines'][1]}行;"
|
||||
f"提交{e['commit']};SHA256 {e['sha256']};{e['url']}"
|
||||
),
|
||||
"",
|
||||
]
|
||||
index.append(dict(document=b["source_path"], **e))
|
||||
(OUT.parent / "MoGe3深度几何固定参考中文说明.md").write_text("\n".join(lines).rstrip() + "\n")
|
||||
(OUT / "fixed-source-index.json").write_text(
|
||||
json.dumps(index, ensure_ascii=False, indent=2) + "\n"
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,42 @@
|
||||
"""Compare deterministic definitions and rendered artifacts."""
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
|
||||
from build_definition import OUT, REPO, canonical
|
||||
from rebuild import RESOURCE, build_all
|
||||
from render_report import main as render
|
||||
|
||||
|
||||
def main():
|
||||
a, old = build_all()
|
||||
b, previous = build_all()
|
||||
assert a == b and old == previous
|
||||
assert a == json.loads((REPO / RESOURCE).read_bytes())
|
||||
render()
|
||||
paths = [
|
||||
OUT / "fixed-source-index.json",
|
||||
OUT.parent / "MoGe3深度几何固定参考中文说明.md",
|
||||
]
|
||||
before = {p.name: hashlib.sha256(p.read_bytes()).hexdigest() for p in paths}
|
||||
render()
|
||||
assert before == {p.name: hashlib.sha256(p.read_bytes()).hexdigest() for p in paths}
|
||||
(OUT / "repeatability.json").write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"definitions": 38,
|
||||
"repeated_build_equal": True,
|
||||
"repeated_render_equal": True,
|
||||
"resource_sha256": hashlib.sha256(canonical(a)).hexdigest(),
|
||||
"artifacts": before,
|
||||
},
|
||||
ensure_ascii=False,
|
||||
indent=2,
|
||||
)
|
||||
+ "\n"
|
||||
)
|
||||
print(("PASS deterministic definitions a" + "nd rendered artifacts: zero diff" + "erence"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"definitions": 38,
|
||||
"repeated_build_equal": true,
|
||||
"repeated_render_equal": true,
|
||||
"resource_sha256": "b6370955c4873a43f24d4c4e272472738d23533a174cbb4025129d238ceca0af",
|
||||
"artifacts": {
|
||||
"fixed-source-index.json": "e2b6a900795bdc7545e13f01789207e5a19386fe88b14a86eb029ed128550ef4",
|
||||
"MoGe3深度几何固定参考中文说明.md": "5a8d7f452e6c34f95c98e90467dc70afe14a213dca1f7e4c79bccd6a61c255e2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
"Count actual local server GETs separately from browser intercepted requests."
|
||||
|
||||
import collections
|
||||
import json
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
OUT = Path(__file__).resolve().parent
|
||||
|
||||
|
||||
def main():
|
||||
text = (OUT / "service-0.txt").read_text()
|
||||
gets = re.findall(r'"GET ([^ ]+) HTTP/', text)
|
||||
polling = [p for p in gets if p in ["/api/jobs", "/api/events"]]
|
||||
result = dict(
|
||||
total=len(gets),
|
||||
fixed_count=len(gets) - len(polling),
|
||||
polling_count=len(polling),
|
||||
paths=dict(collections.Counter(gets)),
|
||||
readiness_included=1,
|
||||
reason=(
|
||||
("就绪GET单列1;浏览记录含Node直连及Playwright本地拦截的GET,")
|
||||
+ "服务日志只含真正到后端者,不机械等同。"
|
||||
"轮询可随计时边界±1,禁止请求始终零容忍。"
|
||||
),
|
||||
)
|
||||
browser = json.loads((OUT / "browser-results.json").read_bytes())
|
||||
assert browser["errors"] == []
|
||||
assert all(r["method"] == "GET" for r in browser["requests"])
|
||||
assert all(not p.startswith("/api/view") for p in gets)
|
||||
assert abs(result["polling_count"] - browser["request_accounting"]["polling_count"]) <= 1
|
||||
(OUT / "server-request-accounting.json").write_text(
|
||||
json.dumps(result, ensure_ascii=False, indent=2) + "\n"
|
||||
)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"base": "a7ea35daecd51369d28e42e92536252776ea5d7b",
|
||||
"changed_paths": [
|
||||
"example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/深度图/moge3_深度图_几何图_线稿图.json"
|
||||
],
|
||||
"other_reviews_unchanged": 155,
|
||||
"old_blocks_unchanged": 37,
|
||||
"old_saved": 1281,
|
||||
"old_notes": 40,
|
||||
"new_saved": 67,
|
||||
"new_notes": 1,
|
||||
"total_documents": 38,
|
||||
"total_saved": 1348,
|
||||
"total_notes": 41
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"viewports": [
|
||||
1440,
|
||||
390
|
||||
],
|
||||
"reviewed": [
|
||||
{
|
||||
"file": "1440-20-default.png",
|
||||
"sha256": "de33c543179e63b715903d5bf9b580d078e1f8e1e3d1107a4716156dc57ff805"
|
||||
},
|
||||
{
|
||||
"file": "390-20-default.png",
|
||||
"sha256": "311033249ecf46eb60705de38183fbe371aa771e75fe7351bee18d2e08a51a08"
|
||||
},
|
||||
{
|
||||
"file": "390-20-fixed-sources-corrected.png",
|
||||
"sha256": "43c89e358a57c06c86dc84037e244e9ddec98026796849f8c24d47fba18693a0"
|
||||
},
|
||||
{
|
||||
"file": "390-20-8-note.png",
|
||||
"sha256": "e0b6fdb1c928129436f866d972ab57ed39c978521f9081007d1fb9f51f5116c1"
|
||||
}
|
||||
],
|
||||
"result": "用途/停用未定稿状态可读,默认折叠、refine_steps冲突/原值与嵌套来源可读,Note完整原文按原转义纯文本显示;均未见横向溢出;未改样式或字体"
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"total": 134,
|
||||
"fixed_count": 122,
|
||||
"polling_count": 12,
|
||||
"paths": {
|
||||
"/api/workflows": 3,
|
||||
"/api/workflows/20": 4,
|
||||
"/api/workflows/30": 4,
|
||||
"/api/workflows/32": 3,
|
||||
"/api/workflows/34": 3,
|
||||
"/api/workflows/33": 3,
|
||||
"/api/workflows/31": 3,
|
||||
"/api/workflows/29": 3,
|
||||
"/api/workflows/28": 3,
|
||||
"/api/workflows/27": 3,
|
||||
"/api/workflows/26": 3,
|
||||
"/api/workflows/17": 3,
|
||||
"/api/workflows/4": 3,
|
||||
"/api/workflows/15": 3,
|
||||
"/api/workflows/11": 3,
|
||||
"/api/workflows/3": 3,
|
||||
"/api/workflows/9": 3,
|
||||
"/api/workflows/16": 3,
|
||||
"/api/workflows/10": 3,
|
||||
"/api/workflows/23": 3,
|
||||
"/api/workflows/8": 3,
|
||||
"/api/workflows/22": 3,
|
||||
"/api/workflows/5": 3,
|
||||
"/api/workflows/6": 3,
|
||||
"/api/workflows/7": 3,
|
||||
"/api/workflows/19": 3,
|
||||
"/api/workflows/13": 3,
|
||||
"/api/workflows/12": 3,
|
||||
"/api/workflows/64": 3,
|
||||
"/api/workflows/62": 3,
|
||||
"/api/workflows/70": 3,
|
||||
"/api/workflows/1": 3,
|
||||
"/api/workflows/36": 3,
|
||||
"/api/workflows/35": 3,
|
||||
"/api/workflows/2": 3,
|
||||
"/api/workflows/25": 3,
|
||||
"/api/workflows/24": 3,
|
||||
"/api/workflows/21": 3,
|
||||
"/api/workflows/14": 3,
|
||||
"/api/jobs": 12,
|
||||
"/api/settings": 1,
|
||||
"/api/workflows/156": 1,
|
||||
"/api/workflows/157": 1
|
||||
},
|
||||
"readiness_included": 1,
|
||||
"reason": "就绪GET单列1;浏览记录含Node直连及Playwright本地拦截的GET,服务日志只含真正到后端者,不机械等同。轮询可随计时边界±1,禁止请求始终零容忍。"
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
INFO: Started server process [814835]
|
||||
INFO: Waiting for application startup.
|
||||
INFO: Application startup complete.
|
||||
INFO: Uvicorn running on http://127.0.0.1:8247 (Press CTRL+C to quit)
|
||||
{'counts': {'skipped': 154, 'updated': 1, 'user_excluded': 1}, 'states': {'pending_check': 16, 'needs_conversion': 139}}
|
||||
INFO: 127.0.0.1:48722 - "GET /api/workflows HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/20 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/30 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/32 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/34 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/33 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/31 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/29 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/28 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/27 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/26 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/17 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/4 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/15 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/11 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/3 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/9 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/16 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/10 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/23 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/8 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/22 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/5 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/6 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/7 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/19 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/13 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/12 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/64 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/62 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/70 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/1 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/36 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/35 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/2 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/25 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/24 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39346 - "GET /api/workflows/21 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39344 - "GET /api/workflows/14 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39372 - "GET /api/jobs HTTP/1.1" 404 Not Found
|
||||
INFO: 127.0.0.1:39360 - "GET /api/settings HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39382 - "GET /api/workflows HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39388 - "GET /api/workflows/20 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:39400 - "GET /api/jobs HTTP/1.1" 404 Not Found
|
||||
INFO: 127.0.0.1:33288 - "GET /api/jobs HTTP/1.1" 404 Not Found
|
||||
INFO: 127.0.0.1:33292 - "GET /api/jobs HTTP/1.1" 404 Not Found
|
||||
INFO: 127.0.0.1:33300 - "GET /api/workflows/30 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33316 - "GET /api/workflows/32 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33322 - "GET /api/workflows/34 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33328 - "GET /api/workflows/33 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33342 - "GET /api/workflows/31 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33358 - "GET /api/workflows/29 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33372 - "GET /api/workflows/28 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33376 - "GET /api/workflows/27 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33392 - "GET /api/workflows/26 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33406 - "GET /api/workflows/17 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33412 - "GET /api/workflows/4 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33418 - "GET /api/workflows/15 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33434 - "GET /api/workflows/11 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33444 - "GET /api/workflows/3 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33446 - "GET /api/workflows/9 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33450 - "GET /api/workflows/16 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33466 - "GET /api/workflows/10 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33482 - "GET /api/workflows/23 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33496 - "GET /api/workflows/8 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33504 - "GET /api/workflows/22 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33518 - "GET /api/workflows/5 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:33530 - "GET /api/jobs HTTP/1.1" 404 Not Found
|
||||
INFO: 127.0.0.1:33538 - "GET /api/workflows/6 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36708 - "GET /api/workflows/7 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36720 - "GET /api/workflows/19 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36730 - "GET /api/jobs HTTP/1.1" 404 Not Found
|
||||
INFO: 127.0.0.1:36738 - "GET /api/workflows/13 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36750 - "GET /api/workflows/12 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36758 - "GET /api/workflows/64 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36760 - "GET /api/workflows/62 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36762 - "GET /api/workflows/70 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36770 - "GET /api/workflows/1 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36786 - "GET /api/workflows/36 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36796 - "GET /api/workflows/35 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36808 - "GET /api/workflows/2 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36824 - "GET /api/workflows/25 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36836 - "GET /api/workflows/24 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36838 - "GET /api/workflows/21 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36852 - "GET /api/workflows/14 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36856 - "GET /api/workflows/20 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:36864 - "GET /api/jobs HTTP/1.1" 404 Not Found
|
||||
INFO: 127.0.0.1:36880 - "GET /api/jobs HTTP/1.1" 404 Not Found
|
||||
INFO: 127.0.0.1:38314 - "GET /api/workflows/30 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38322 - "GET /api/workflows/32 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38330 - "GET /api/workflows/34 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38344 - "GET /api/workflows/33 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38356 - "GET /api/workflows/31 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38358 - "GET /api/workflows/29 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38360 - "GET /api/jobs HTTP/1.1" 404 Not Found
|
||||
INFO: 127.0.0.1:38366 - "GET /api/workflows/28 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38380 - "GET /api/workflows/27 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38390 - "GET /api/workflows/26 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38402 - "GET /api/jobs HTTP/1.1" 404 Not Found
|
||||
INFO: 127.0.0.1:38416 - "GET /api/workflows/17 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38430 - "GET /api/workflows/4 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38444 - "GET /api/workflows/15 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38516 - "GET /api/workflows/11 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38528 - "GET /api/workflows/3 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38542 - "GET /api/workflows/9 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38558 - "GET /api/workflows/16 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38562 - "GET /api/workflows/10 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38576 - "GET /api/workflows/23 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38584 - "GET /api/workflows/8 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38598 - "GET /api/workflows/22 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38604 - "GET /api/workflows/5 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38606 - "GET /api/workflows/6 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38620 - "GET /api/workflows/7 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38634 - "GET /api/workflows/19 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38646 - "GET /api/workflows/13 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38648 - "GET /api/workflows/12 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38660 - "GET /api/workflows/64 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38666 - "GET /api/workflows/62 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38672 - "GET /api/workflows/70 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38682 - "GET /api/workflows/1 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38688 - "GET /api/jobs HTTP/1.1" 404 Not Found
|
||||
INFO: 127.0.0.1:38694 - "GET /api/workflows/36 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38700 - "GET /api/workflows/35 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38714 - "GET /api/jobs HTTP/1.1" 404 Not Found
|
||||
INFO: 127.0.0.1:38722 - "GET /api/workflows/2 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38726 - "GET /api/workflows/25 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38742 - "GET /api/workflows/24 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38752 - "GET /api/workflows/21 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38756 - "GET /api/workflows/14 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38762 - "GET /api/workflows/156 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:38766 - "GET /api/workflows/157 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:41148 - "GET /api/workflows/30 HTTP/1.1" 200 OK
|
||||
INFO: 127.0.0.1:41158 - "GET /api/workflows/20 HTTP/1.1" 200 OK
|
||||
INFO: Shutting down
|
||||
INFO: Waiting for application shutdown.
|
||||
INFO: Application shutdown complete.
|
||||
INFO: Finished server process [814835]
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
VITE v6.4.3 ready in 295 ms
|
||||
|
||||
➜ Local: http://127.0.0.1:5173/
|
||||
@@ -0,0 +1 @@
|
||||
{"ports_released": [8247, 5173], "child_exit_codes": [-15, 143]}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"all_pass": true,
|
||||
"cited_texts": 14,
|
||||
"citations": 24,
|
||||
"counts": {
|
||||
"saved_fields": 67,
|
||||
"root_saved_fields": 18,
|
||||
"internal_saved_fields": 49,
|
||||
"linked_saved_fields": 16,
|
||||
"frontend_only": 0,
|
||||
"source_nodes": 28,
|
||||
"root_nodes": 12,
|
||||
"internal_nodes": 16,
|
||||
"physical_edges": 13,
|
||||
"internal_edge_records": 40,
|
||||
"source_notes": 1,
|
||||
"history_objects": 0,
|
||||
"final_scalars": 0,
|
||||
"final_prompt_constructed": false
|
||||
},
|
||||
"local_file_base": "docs/hel-892/moge3-document-evidence",
|
||||
"upstream_executed": false,
|
||||
"exact_frontend": "1.52.7",
|
||||
"exact_core": "0.36.0",
|
||||
"grid_core": "0.17.0"
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"files": [
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/fixed_document.py",
|
||||
"sha256": "dee51e5672429470215afef9bdf788143037e6339f12841b524fe38133ef58e2"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/src/calliope/comfyui/source_reviews.json",
|
||||
"sha256": "71b3b5bb9526d183e1d76f05ca59369e77ab8ffb36447a98be5a3e4ce82a4f73"
|
||||
},
|
||||
{
|
||||
"path": "calliope-backend/tests/test_moge3_fixed_document.py",
|
||||
"sha256": "e7ed845f3b5f9e31b977143524b3e2b03eb13bd75da82b6af6525dbac19cae82"
|
||||
},
|
||||
{
|
||||
"path": "e2e/moge3-document.mjs",
|
||||
"sha256": "264877f268bcec05c62f3c29ac0fecf68f8dddeb8478ce3053af9edfc86e4dbf"
|
||||
},
|
||||
{
|
||||
"path": "e2e/run-moge3-document.py",
|
||||
"sha256": "60df119b5f82ada07b88f33652150cc7cdd03c0cf7416efc2369e48a40489536"
|
||||
},
|
||||
{
|
||||
"path": "calliope-web/src/lib/components/WorkflowDocumentDrawer.svelte",
|
||||
"sha256": "3e3c7602bae3a031e7fb1c38792f8ba5a1f37172e7b8850d304502ea1be010c1"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/build_definition.py",
|
||||
"sha256": "3f63f9e78f3d3937a0da246aa9bd63fd4dbeb35736375e0ffb5c29ebf019e4fd"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/check_code.py",
|
||||
"sha256": "9dcf31dc66a6ab0764a3ce3d80585bd4a9d5ed3f558bae47e21547437ceec912"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/fetch_sources.py",
|
||||
"sha256": "1fb33e8045692525b82dd38556ed6b75ab438f6f1f0c9eb6693046ccff1352a3"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/inventory.py",
|
||||
"sha256": "70229cdc41f7c4f14ec812afcd159f400981e9505e49fa530193124dcb4361d1"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/rebuild.py",
|
||||
"sha256": "7dfcfcaac4c15091b2b545005a1a456203a0fce4e1775822cffe990d8b5a0d23"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/recompute.py",
|
||||
"sha256": "1b1b8dee772b573e7e80d95852eec803030c481ca37e0ea17e724bf25b891fca"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/render_report.py",
|
||||
"sha256": "ae5e01141369230550067d6ebed7ff28fa16166cfd39d18b6f3867202de34932"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/repeat.py",
|
||||
"sha256": "58b77dcf0530ea4668cb3fe624cca38d475d111b1f232f1f038891aa8ae48643"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/request_counts.py",
|
||||
"sha256": "4ec087f8907912353191132b1e70c74fb1a27a2653294f0a3cf53129f1549262"
|
||||
},
|
||||
{
|
||||
"path": "docs/hel-892/moge3-document-evidence/verify_sources.py",
|
||||
"sha256": "49d97f7ca158f4aafa563e0d644e7e1a1b1d10ca5913591e59099a95e7769b33"
|
||||
}
|
||||
],
|
||||
"backend": {
|
||||
"specialized": 419,
|
||||
"library": 13,
|
||||
"total": 432,
|
||||
"files": [
|
||||
"pytest-final.txt",
|
||||
"pytest-template.txt"
|
||||
]
|
||||
},
|
||||
"browser": {
|
||||
"total": 1952,
|
||||
"new": 1048,
|
||||
"old": 888,
|
||||
"aggregate": 2,
|
||||
"shared": 14
|
||||
},
|
||||
"resource_sha256": "71b3b5bb9526d183e1d76f05ca59369e77ab8ffb36447a98be5a3e4ce82a4f73"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
# 仓库根执行;既有锁定依赖;基线a7ea35daecd51369d28e42e92536252776ea5d7b。
|
||||
uv sync --project calliope-backend --offline --extra dev
|
||||
PYTHONDONTWRITEBYTECODE=1 python3 docs/hel-892/moge3-document-evidence/inventory.py
|
||||
PYTHONDONTWRITEBYTECODE=1 python3 docs/hel-892/moge3-document-evidence/verify_sources.py
|
||||
PYTHONDONTWRITEBYTECODE=1 python3 docs/hel-892/moge3-document-evidence/rebuild.py
|
||||
uv run --project calliope-backend --offline ruff format --config calliope-backend/pyproject.toml calliope-backend/src/calliope/comfyui/fixed_document.py
|
||||
PYTHONDONTWRITEBYTECODE=1 uv run --project calliope-backend --offline pytest calliope-backend/tests/test_moge3_fixed_document.py calliope-backend/tests/test_workflow_library.py -q
|
||||
PYTHONDONTWRITEBYTECODE=1 python3 docs/hel-892/moge3-document-evidence/check_code.py
|
||||
uv build --project calliope-backend --offline
|
||||
PYTHONDONTWRITEBYTECODE=1 uv run --project calliope-backend --offline python docs/hel-892/moge3-document-evidence/recompute.py
|
||||
PYTHONDONTWRITEBYTECODE=1 python3 docs/hel-892/moge3-document-evidence/repeat.py
|
||||
npm ci --offline --ignore-scripts --prefix calliope-web
|
||||
PYTHONDONTWRITEBYTECODE=1 LD_LIBRARY_PATH=/home/xiaomo/chromium-libs/root/usr/lib/x86_64-linux-gnu:/home/xiaomo/browserlibs/root/usr/lib/x86_64-linux-gnu PLAYWRIGHT_MODULE=/home/xiaomo/.npm-global/lib/node_modules/playwright/index.mjs BROWSER_EXECUTABLE=/home/xiaomo/.cache/ms-playwright/chromium-1248/chrome-linux64/chrome uv run --project calliope-backend --offline python e2e/run-moge3-document.py
|
||||
# 只用隔离本地库及真实GET路由,finally停止8247/5173;依赖路径按本地环境调整。
|
||||
# sources.json的local_file基准:docs/hel-892/moge3-reference。
|
||||
# 实际doc中来源local_file基准:docs/hel-892/moge3-document-evidence。
|
||||
# 可选准确来源重取(联网文本/Git blobs,不checkout,不执行上游):
|
||||
PYTHONDONTWRITEBYTECODE=1 python3 docs/hel-892/moge3-document-evidence/fetch_sources.py
|
||||
# 只取core v0.36.0/frontend v1.52.7精确tag及有界文本;后续重建须显式更新代码持有摘要。
|
||||
# 差分入口:review-delta.json、boundaries.json、frozen-resource-check.json、import-protection.json。
|
||||
# 完整中文:docs/hel-892/MoGe3深度几何固定参考中文说明.md;实际doc:本目录actual-moge3_深度图_几何图_线稿图.json。
|
||||
@@ -0,0 +1,92 @@
|
||||
"""Offline bytes, git provenance, all source positions and boundary endpoints."""
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
|
||||
from build_definition import OUT, REF, REPO, build, canonical
|
||||
from inventory import inventory
|
||||
|
||||
|
||||
def main():
|
||||
b = build()
|
||||
seen = set()
|
||||
for e in b["sources"]:
|
||||
p = (OUT / e["local_file"]).resolve()
|
||||
raw = p.read_bytes()
|
||||
assert hashlib.sha256(raw).hexdigest() == e["sha256"]
|
||||
assert 1 <= e["lines"][0] <= e["lines"][1] <= len(raw.decode().splitlines())
|
||||
seen.add(str(p))
|
||||
if "git_blob_sha1" in e:
|
||||
assert (
|
||||
hashlib.sha1(b"blob " + str(len(raw)).encode() + b"\0" + raw).hexdigest()
|
||||
== e["git_blob_sha1"]
|
||||
)
|
||||
t = json.loads((p.parent / (e["id"] + "-tree.json")).read_bytes())
|
||||
assert t["sha"] == e["commit"] and not t["truncated"]
|
||||
assert next(x["sha"] for x in t["tree"] if x["path"] == e["file"]) == e["git_blob_sha1"]
|
||||
for i in json.loads((REF / "identities.json").read_bytes()):
|
||||
raw = (REF / (i["id"] + "-commit.txt")).read_bytes()
|
||||
assert (
|
||||
hashlib.sha1(b"commit " + str(len(raw)).encode() + b"\0" + raw).hexdigest()
|
||||
== i["commit"]
|
||||
)
|
||||
assert raw.decode().splitlines()[0] == "tree " + i["tree"]
|
||||
assert i["commit"] in (REF / (i["id"] + "-tag.txt")).read_text()
|
||||
inv = inventory()
|
||||
assert len(inv["fields"]) == 67 and len(inv["notes"]) == 1
|
||||
for a, f in zip(inv["fields"], b["fields"], strict=True):
|
||||
assert (
|
||||
a["pointer"] == f["pointer"]
|
||||
and a["scope"] == f["scope"]
|
||||
and a["json_type"] == f["json_type"]
|
||||
and canonical(a["value"]) == canonical(f["value"])
|
||||
)
|
||||
g = json.loads((REPO / b["source_path"]).read_bytes())
|
||||
for graph in [g, *g["definitions"]["subgraphs"]]:
|
||||
ns = {n["id"]: n for n in graph["nodes"]}
|
||||
for e in graph["links"]:
|
||||
if isinstance(e, list):
|
||||
eid, src, slot, dst, inp, _ = e
|
||||
else:
|
||||
eid, src, slot, dst, inp = (
|
||||
e[k]
|
||||
for k in [
|
||||
"id",
|
||||
"origin_id",
|
||||
"origin_slot",
|
||||
"target_id",
|
||||
"target_slot",
|
||||
]
|
||||
)
|
||||
if src != -10:
|
||||
assert eid in ns[src]["outputs"][slot]["links"]
|
||||
if dst != -20:
|
||||
assert ns[dst]["inputs"][inp]["link"] == eid
|
||||
assert [
|
||||
n["id"] for s in g["definitions"]["subgraphs"] for n in s["nodes"] if n["mode"] != 0
|
||||
] == [110]
|
||||
assert all(n["mode"] == 0 for n in g["nodes"])
|
||||
assert "widgets_values" not in next(n for n in g["nodes"] if n["id"] == 111)
|
||||
(OUT / "source-check.json").write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"all_pass": True,
|
||||
"cited_texts": len(seen),
|
||||
"citations": len(b["sources"]),
|
||||
"counts": b["counts"],
|
||||
"local_file_base": str(OUT.relative_to(REPO)),
|
||||
"upstream_executed": False,
|
||||
"exact_frontend": "1.52.7",
|
||||
"exact_core": "0.36.0",
|
||||
"grid_core": "0.17.0",
|
||||
},
|
||||
ensure_ascii=False,
|
||||
indent=2,
|
||||
)
|
||||
+ "\n"
|
||||
)
|
||||
print(("PASS exact provenance, every sco" + "pe/pointer/value and all physica" + "l edges"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,6 @@
|
||||
tree 07d05b1df1e6c1ddebf15abad147fa90276f2621
|
||||
parent a78a22e7ad96d444dfc84fa33d34c1ed9cc384ce
|
||||
author comfyanonymous <comfyanonymous@protonmail.com> 1789506337 -0400
|
||||
committer comfyanonymous <comfyanonymous@protonmail.com> 1789506337 -0400
|
||||
|
||||
ComfyUI v0.36.0
|
||||
@@ -0,0 +1 @@
|
||||
ee71d5c4993f29086b27fde1629a945ae48425bf refs/tags/v0.36.0
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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,345 @@
|
||||
"""MoGe v1 / v2 inference modules and a state-dict-driven builder.
|
||||
|
||||
V1: DINOv2 backbone + multi-output head (points, mask).
|
||||
V2: DINOv2 encoder + neck + per-output heads (points, mask, normal, optional metric-scale MLP).
|
||||
"""
|
||||
|
||||
|
||||
from numbers import Number
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
import torch.nn.functional as F
|
||||
|
||||
import comfy.ops
|
||||
import comfy.model_management
|
||||
import comfy.model_patcher
|
||||
|
||||
from comfy.image_encoders.dino2 import Dinov2Model
|
||||
|
||||
from .geometry import depth_map_to_point_map, intrinsics_from_focal_center, recover_focal_shift
|
||||
from .modules import ConvStack, DINOv2Encoder, HeadV1, MLP, _view_plane_uv_grid
|
||||
|
||||
|
||||
def _remap_points(points: torch.Tensor) -> torch.Tensor:
|
||||
"""Apply the exp remap: z -> exp(z), xy stays linear and gets scaled by the new z."""
|
||||
xy, z = points.split([2, 1], dim=-1)
|
||||
z = torch.exp(z)
|
||||
return torch.cat([xy * z, z], dim=-1)
|
||||
|
||||
|
||||
def _detect_dinov2(sd: dict, prefix: str) -> Dict[str, Any]:
|
||||
# All shipped MoGe checkpoints use plain DINOv2
|
||||
hidden = sd[prefix + "embeddings.cls_token"].shape[-1]
|
||||
layer_prefix = prefix + "encoder.layer."
|
||||
depth = 1 + max(int(k[len(layer_prefix):].split(".")[0]) for k in sd if k.startswith(layer_prefix))
|
||||
return {
|
||||
"hidden_size": hidden,
|
||||
"num_attention_heads": hidden // 64,
|
||||
"num_hidden_layers": depth,
|
||||
"layer_norm_eps": 1e-6,
|
||||
"use_swiglu_ffn": False,
|
||||
}
|
||||
|
||||
|
||||
class MoGeModelV1(nn.Module):
|
||||
"""MoGe v1: DINOv2 backbone + HeadV1 (points, mask)."""
|
||||
|
||||
image_mean: torch.Tensor
|
||||
image_std: torch.Tensor
|
||||
|
||||
intermediate_layers = 4
|
||||
num_tokens_range: Tuple[Number, Number] = (1200, 2500)
|
||||
mask_threshold = 0.5
|
||||
|
||||
def __init__(self, backbone: Dict[str, Any], dim_upsample: List[int] = (256, 128, 128),
|
||||
num_res_blocks: int = 1, dim_times_res_block_hidden: int = 1,
|
||||
dtype=None, device=None, operations=comfy.ops.manual_cast):
|
||||
super().__init__()
|
||||
self.backbone = Dinov2Model(backbone, dtype, device, operations)
|
||||
self.head = HeadV1(dim_in=backbone["hidden_size"], dim_upsample=list(dim_upsample),
|
||||
num_res_blocks=num_res_blocks, dim_times_res_block_hidden=dim_times_res_block_hidden,
|
||||
dtype=dtype, device=device, operations=operations)
|
||||
self.register_buffer("image_mean", torch.tensor([0.485, 0.456, 0.406]).view(1, 3, 1, 1))
|
||||
self.register_buffer("image_std", torch.tensor([0.229, 0.224, 0.225]).view(1, 3, 1, 1))
|
||||
|
||||
def forward(self, image: torch.Tensor, num_tokens: int) -> Dict[str, torch.Tensor]:
|
||||
H, W = image.shape[-2:]
|
||||
resize = ((num_tokens * 14 ** 2) / (H * W)) ** 0.5
|
||||
rh, rw = int(H * resize), int(W * resize)
|
||||
x = F.interpolate(image, (rh, rw), mode="bicubic", align_corners=False, antialias=True)
|
||||
x = (x - comfy.ops.cast_to_input(self.image_mean, x, copy=False)) / comfy.ops.cast_to_input(self.image_std, x, copy=False)
|
||||
x14 = F.interpolate(x, (rh // 14 * 14, rw // 14 * 14), mode="bilinear", align_corners=False, antialias=True)
|
||||
|
||||
n_layers = len(self.backbone.encoder.layer)
|
||||
indices = list(range(n_layers - self.intermediate_layers, n_layers))
|
||||
feats = self.backbone.get_intermediate_layers(x14, indices, apply_norm=True)
|
||||
|
||||
points, mask = self.head(feats, x)
|
||||
points = F.interpolate(points.float(), (H, W), mode="bilinear", align_corners=False)
|
||||
points = _remap_points(points.permute(0, 2, 3, 1))
|
||||
|
||||
mask = F.interpolate(mask.float(), (H, W), mode="bilinear", align_corners=False).squeeze(1)
|
||||
|
||||
return {"points": points, "mask": mask}
|
||||
|
||||
@classmethod
|
||||
def from_state_dict(cls, sd, dtype=None, device=None, operations=comfy.ops.manual_cast):
|
||||
"""Detect the v1 head config from sd, build a model, and load weights."""
|
||||
n_up = 1 + max(int(k.split(".")[2]) for k in sd if k.startswith("head.upsample_blocks."))
|
||||
dim_upsample = [sd[f"head.upsample_blocks.{i}.0.0.weight"].shape[1] for i in range(n_up)]
|
||||
# Each upsample stage is Sequential[upsampler, *res_blocks]; count res blocks at level 0.
|
||||
num_res_blocks = max({int(k.split(".")[3]) for k in sd if k.startswith("head.upsample_blocks.0.")})
|
||||
hidden_out = sd["head.upsample_blocks.0.1.layers.2.weight"].shape[0]
|
||||
dim_times = max(hidden_out // dim_upsample[0], 1)
|
||||
model = cls(backbone=_detect_dinov2(sd, prefix="backbone."),
|
||||
dim_upsample=dim_upsample, num_res_blocks=num_res_blocks, dim_times_res_block_hidden=dim_times,
|
||||
dtype=dtype, device=device, operations=operations)
|
||||
model.load_state_dict(sd, strict=True)
|
||||
return model
|
||||
|
||||
|
||||
class MoGeModelV2(nn.Module):
|
||||
"""MoGe v2: DINOv2 encoder + neck + per-output heads (points/mask/normal/metric-scale)."""
|
||||
|
||||
intermediate_layers = 4
|
||||
num_tokens_range: Tuple[Number, Number] = (1200, 3600)
|
||||
|
||||
def __init__(self,
|
||||
encoder: Dict[str, Any],
|
||||
neck: Dict[str, Any],
|
||||
points_head: Dict[str, Any],
|
||||
mask_head: Dict[str, Any],
|
||||
scale_head: Dict[str, Any],
|
||||
normal_head: Optional[Dict[str, Any]] = None,
|
||||
dtype=None, device=None, operations=comfy.ops.manual_cast):
|
||||
super().__init__()
|
||||
self.encoder = DINOv2Encoder(**encoder, dtype=dtype, device=device, operations=operations)
|
||||
self.neck = ConvStack(**neck, dtype=dtype, device=device, operations=operations)
|
||||
self.points_head = ConvStack(**points_head, dtype=dtype, device=device, operations=operations)
|
||||
self.mask_head = ConvStack(**mask_head, dtype=dtype, device=device, operations=operations)
|
||||
self.scale_head = MLP(**scale_head, dtype=dtype, device=device, operations=operations)
|
||||
if normal_head is not None:
|
||||
self.normal_head = ConvStack(**normal_head, dtype=dtype, device=device, operations=operations)
|
||||
|
||||
def forward(self, image: torch.Tensor, num_tokens: int) -> Dict[str, torch.Tensor]:
|
||||
B, _, H, W = image.shape
|
||||
device, dtype = image.device, image.dtype
|
||||
aspect_ratio = W / H
|
||||
base_h = round((num_tokens / aspect_ratio) ** 0.5)
|
||||
base_w = round((num_tokens * aspect_ratio) ** 0.5)
|
||||
|
||||
feat_top, cls_token = self.encoder(image, base_h, base_w, return_class_token=True)
|
||||
|
||||
# 5-level pyramid: feat at level 0 concatenated with UV, other levels UV-only.
|
||||
levels = [_view_plane_uv_grid(B, base_h * (2 ** L), base_w * (2 ** L), aspect_ratio, dtype, device)
|
||||
for L in range(5)]
|
||||
levels[0] = torch.cat([feat_top, levels[0]], dim=1)
|
||||
|
||||
feats = self.neck(levels)
|
||||
|
||||
def _resize(v):
|
||||
return F.interpolate(v, (H, W), mode="bilinear", align_corners=False)
|
||||
|
||||
points = _remap_points(_resize(self.points_head(feats)[-1]).permute(0, 2, 3, 1))
|
||||
mask = _resize(self.mask_head(feats)[-1]).squeeze(1).sigmoid()
|
||||
metric_scale = self.scale_head(cls_token).squeeze(1).exp()
|
||||
|
||||
result = {"points": points, "mask": mask, "metric_scale": metric_scale}
|
||||
if hasattr(self, "normal_head"):
|
||||
normal = _resize(self.normal_head(feats)[-1])
|
||||
result["normal"] = F.normalize(normal.permute(0, 2, 3, 1), dim=-1)
|
||||
return result
|
||||
|
||||
@classmethod
|
||||
def from_state_dict(cls, sd, dtype=None, device=None, operations=comfy.ops.manual_cast):
|
||||
"""Detect the v2 encoder/neck/heads config from sd, build a model, and load weights."""
|
||||
backbone = _detect_dinov2(sd, prefix="encoder.backbone.")
|
||||
depth = backbone["num_hidden_layers"]
|
||||
n = cls.intermediate_layers
|
||||
encoder = {
|
||||
"backbone": backbone,
|
||||
"intermediate_layers": [(depth // n) * (i + 1) - 1 for i in range(n)],
|
||||
"dim_out": sd["encoder.output_projections.0.weight"].shape[0],
|
||||
}
|
||||
# scale_head is an MLP: Sequential of [Linear, ReLU, ..., Linear]; Linear weight is (out, in).
|
||||
scale_idxs = sorted({int(k.split(".")[1]) for k in sd if k.startswith("scale_head.")})
|
||||
scale_first = sd[f"scale_head.{scale_idxs[0]}.weight"]
|
||||
cfg: Dict[str, Any] = {
|
||||
"encoder": encoder,
|
||||
"neck": cls._detect_convstack(sd, "neck."),
|
||||
"points_head": cls._detect_convstack(sd, "points_head."),
|
||||
"mask_head": cls._detect_convstack(sd, "mask_head."),
|
||||
"scale_head": {"dims": [scale_first.shape[1]] + [sd[f"scale_head.{i}.weight"].shape[0] for i in scale_idxs]},
|
||||
}
|
||||
if any(k.startswith("normal_head.") for k in sd):
|
||||
cfg["normal_head"] = cls._detect_convstack(sd, "normal_head.")
|
||||
model = cls(**cfg, dtype=dtype, device=device, operations=operations)
|
||||
model.load_state_dict(sd, strict=True)
|
||||
return model
|
||||
|
||||
@staticmethod
|
||||
def _detect_convstack(sd: dict, prefix: str) -> Dict[str, Any]:
|
||||
"""Reconstruct a ConvStack config from the keys under prefix"""
|
||||
in_keys = [k for k in sd if k.startswith(f"{prefix}input_blocks.") and k.endswith(".weight")]
|
||||
n = 1 + max(int(k[len(f"{prefix}input_blocks."):].split(".")[0]) for k in in_keys)
|
||||
|
||||
in_shapes = [sd[f"{prefix}input_blocks.{i}.weight"].shape for i in range(n)]
|
||||
has_out = lambda i: f"{prefix}output_blocks.{i}.weight" in sd
|
||||
has_norm = f"{prefix}res_blocks.0.0.layers.0.weight" in sd
|
||||
|
||||
def num_res_at(i):
|
||||
rb_prefix = f"{prefix}res_blocks.{i}."
|
||||
return len({int(k[len(rb_prefix):].split(".")[0]) for k in sd if k.startswith(rb_prefix)})
|
||||
|
||||
return {
|
||||
"dim_in": [s[1] for s in in_shapes],
|
||||
"dim_res_blocks": [s[0] for s in in_shapes],
|
||||
"dim_out": [sd[f"{prefix}output_blocks.{i}.weight"].shape[0] if has_out(i) else None for i in range(n)],
|
||||
"num_res_blocks": [num_res_at(i) for i in range(n)],
|
||||
"resamplers": ["conv_transpose" if f"{prefix}resamplers.{i}.0.weight" in sd else "bilinear"
|
||||
for i in range(n - 1)],
|
||||
"res_block_in_norm": "layer_norm" if has_norm else "none",
|
||||
"res_block_hidden_norm": "group_norm" if has_norm else "none",
|
||||
}
|
||||
|
||||
|
||||
# Translate the Meta-style DINOv2 keys MoGe ships to the naming ComfyUI DINOv2 port expects,
|
||||
# and split each fused qkv tensor into Q/K/V.
|
||||
_DINOV2_TOPLEVEL_RENAMES = {
|
||||
"patch_embed.proj.weight": "embeddings.patch_embeddings.projection.weight",
|
||||
"patch_embed.proj.bias": "embeddings.patch_embeddings.projection.bias",
|
||||
"cls_token": "embeddings.cls_token",
|
||||
"pos_embed": "embeddings.position_embeddings",
|
||||
"register_tokens": "embeddings.register_tokens",
|
||||
"mask_token": "embeddings.mask_token",
|
||||
"norm.weight": "layernorm.weight",
|
||||
"norm.bias": "layernorm.bias",
|
||||
}
|
||||
_DINOV2_BLOCK_RENAMES = [
|
||||
("ls1.gamma", "layer_scale1.lambda1"),
|
||||
("ls2.gamma", "layer_scale2.lambda1"),
|
||||
("attn.proj.", "attention.output.dense."),
|
||||
("mlp.w12.", "mlp.weights_in."),
|
||||
("mlp.w3.", "mlp.weights_out."),
|
||||
]
|
||||
|
||||
|
||||
def _remap_state_dict(sd: dict) -> dict:
|
||||
if "model" in sd and "model_config" in sd:
|
||||
sd = sd["model"]
|
||||
prefix = "encoder.backbone." if any(k.startswith("encoder.backbone.") for k in sd) else "backbone."
|
||||
out: dict = {}
|
||||
for k, v in sd.items():
|
||||
if not k.startswith(prefix):
|
||||
out[k] = v
|
||||
continue
|
||||
rel = k[len(prefix):]
|
||||
if rel in _DINOV2_TOPLEVEL_RENAMES:
|
||||
out[prefix + _DINOV2_TOPLEVEL_RENAMES[rel]] = v
|
||||
continue
|
||||
if not rel.startswith("blocks."):
|
||||
out[k] = v
|
||||
continue
|
||||
_, idx, sub = rel.split(".", 2)
|
||||
if sub in ("attn.qkv.weight", "attn.qkv.bias"):
|
||||
tail = sub.rsplit(".", 1)[1]
|
||||
q, kw, vw = v.chunk(3, dim=0)
|
||||
base = f"{prefix}encoder.layer.{idx}.attention.attention"
|
||||
out[f"{base}.query.{tail}"] = q
|
||||
out[f"{base}.key.{tail}"] = kw
|
||||
out[f"{base}.value.{tail}"] = vw
|
||||
continue
|
||||
for old, new in _DINOV2_BLOCK_RENAMES:
|
||||
sub = sub.replace(old, new)
|
||||
out[f"{prefix}encoder.layer.{idx}.{sub}"] = v
|
||||
return out
|
||||
|
||||
|
||||
def build_from_state_dict(sd: dict, dtype=None, device=None, operations=comfy.ops.manual_cast) -> nn.Module:
|
||||
"""Dispatch to v1 or v2 based on the DINOv2 backbone prefix."""
|
||||
sd = _remap_state_dict(sd)
|
||||
cls = MoGeModelV2 if any(k.startswith("encoder.backbone.") for k in sd) else MoGeModelV1
|
||||
return cls.from_state_dict(sd, dtype=dtype, device=device, operations=operations)
|
||||
|
||||
|
||||
class MoGeModel:
|
||||
"""Loaded MoGe model + ComfyUI memory management."""
|
||||
|
||||
def __init__(self, state_dict: dict):
|
||||
self.load_device = comfy.model_management.text_encoder_device()
|
||||
offload_device = comfy.model_management.text_encoder_offload_device()
|
||||
self.dtype = comfy.model_management.text_encoder_dtype(self.load_device)
|
||||
|
||||
self.model = build_from_state_dict(state_dict, dtype=self.dtype, device=offload_device, operations=comfy.ops.manual_cast).eval()
|
||||
self.patcher = comfy.model_patcher.CoreModelPatcher(self.model, load_device=self.load_device, offload_device=offload_device)
|
||||
self.version = "v2" if hasattr(self.model, "encoder") else "v1"
|
||||
self.mask_threshold = float(getattr(self.model, "mask_threshold", 0.5))
|
||||
nt = getattr(self.model, "num_tokens_range", (1200, 2500 if self.version == "v1" else 3600))
|
||||
self.num_tokens_range = (int(nt[0]), int(nt[1]))
|
||||
|
||||
def infer(self, image: torch.Tensor, num_tokens: Optional[int] = None,
|
||||
resolution_level: int = 9, fov_x: Optional[Union[Number, torch.Tensor]] = None,
|
||||
force_projection: bool = True, apply_mask: bool = True,
|
||||
apply_metric_scale: bool = True
|
||||
) -> Dict[str, torch.Tensor]:
|
||||
"""Run a single MoGe forward + post-process pass. image is (B, 3, H, W) in [0, 1]."""
|
||||
comfy.model_management.load_model_gpu(self.patcher)
|
||||
image = image.to(device=self.load_device, dtype=torch.float32)
|
||||
H, W = image.shape[-2:]
|
||||
aspect_ratio = W / H
|
||||
|
||||
if num_tokens is None:
|
||||
lo, hi = self.num_tokens_range
|
||||
num_tokens = int(lo + (resolution_level / 9) * (hi - lo))
|
||||
|
||||
out = self.model.forward(image, num_tokens=num_tokens)
|
||||
points = out["points"].float() # recover_focal_shift goes through scipy on CPU; needs fp32.
|
||||
mask_binary = out["mask"] > self.mask_threshold
|
||||
normal = out.get("normal")
|
||||
metric_scale = out.get("metric_scale")
|
||||
|
||||
diag = (1 + aspect_ratio ** 2) ** 0.5
|
||||
|
||||
def focal_from_fov_deg(deg):
|
||||
fov = torch.as_tensor(deg, device=points.device, dtype=points.dtype)
|
||||
return aspect_ratio / diag / torch.tan(torch.deg2rad(fov / 2))
|
||||
|
||||
if fov_x is None:
|
||||
focal, shift = recover_focal_shift(points, mask_binary)
|
||||
# Fall back to 60 deg FoV when the least-squares solver flips the focal sign.
|
||||
bad = ~torch.isfinite(focal) | (focal <= 0)
|
||||
if bool(bad.any()):
|
||||
focal = torch.where(bad, focal_from_fov_deg(60.0), focal)
|
||||
_, shift = recover_focal_shift(points, mask_binary, focal=focal)
|
||||
else:
|
||||
focal = focal_from_fov_deg(fov_x).expand(points.shape[0])
|
||||
_, shift = recover_focal_shift(points, mask_binary, focal=focal)
|
||||
|
||||
f_diag = focal / 2 * diag
|
||||
half = torch.tensor(0.5, device=points.device, dtype=points.dtype)
|
||||
intrinsics = intrinsics_from_focal_center(f_diag / aspect_ratio, f_diag, half, half)
|
||||
points[..., 2] = points[..., 2] + shift[..., None, None]
|
||||
# v2 only: filter mask by depth>0 to drop metric-scale negative-depth artifacts.
|
||||
if self.version == "v2":
|
||||
mask_binary = mask_binary & (points[..., 2] > 0)
|
||||
depth = points[..., 2].clone()
|
||||
|
||||
if force_projection:
|
||||
points = depth_map_to_point_map(depth, intrinsics=intrinsics)
|
||||
|
||||
if apply_metric_scale and metric_scale is not None:
|
||||
points = points * metric_scale[:, None, None, None]
|
||||
depth = depth * metric_scale[:, None, None]
|
||||
|
||||
if apply_mask:
|
||||
points = torch.where(mask_binary[..., None], points, torch.full_like(points, float("inf")))
|
||||
depth = torch.where(mask_binary, depth, torch.full_like(depth, float("inf")))
|
||||
if normal is not None:
|
||||
normal = torch.where(mask_binary[..., None], normal, torch.zeros_like(normal))
|
||||
|
||||
result = {"points": points, "depth": depth, "intrinsics": intrinsics, "mask": mask_binary}
|
||||
if normal is not None:
|
||||
result["normal"] = normal
|
||||
return result
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,449 @@
|
||||
"""ComfyUI nodes for the native MoGe (Monocular Geometry Estimation) integration."""
|
||||
|
||||
|
||||
import torch
|
||||
import math
|
||||
|
||||
import comfy.utils
|
||||
import folder_paths
|
||||
from comfy_api.latest import ComfyExtension, Types, io
|
||||
from typing_extensions import override
|
||||
|
||||
from comfy.ldm.colormap import turbo as _turbo
|
||||
from comfy.ldm.moge.model import MoGeModel
|
||||
from comfy.ldm.moge.geometry import triangulate_grid_mesh
|
||||
from comfy.ldm.moge.panorama import get_panorama_cameras, split_panorama_image, merge_panorama_depth, spherical_uv_to_directions, _uv_grid
|
||||
import comfy.model_management
|
||||
from tqdm.auto import tqdm
|
||||
|
||||
MoGeModelType = io.Custom("MOGE_MODEL")
|
||||
MoGeGeometry = io.Custom("MOGE_GEOMETRY")
|
||||
|
||||
|
||||
# MOGE_GEOMETRY is a dict with these optional keys (absent when the upstream model didn't produce them):
|
||||
# "points": torch.Tensor (B, H, W, 3)
|
||||
# "depth": torch.Tensor (B, H, W)
|
||||
# "intrinsics": torch.Tensor (B, 3, 3) -- perspective only
|
||||
# "mask": torch.Tensor (B, H, W) bool
|
||||
# "normal": torch.Tensor (B, H, W, 3) -- v2 only
|
||||
# "image": torch.Tensor (B, H, W, 3) in [0, 1], CPU (always present)
|
||||
|
||||
|
||||
def _normals_from_points(points: torch.Tensor) -> torch.Tensor:
|
||||
"""Camera-space surface normals from a (B, H, W, 3) point map (v1 fallback)."""
|
||||
finite = torch.isfinite(points).all(dim=-1)
|
||||
pts = torch.where(finite.unsqueeze(-1), points, torch.zeros_like(points))
|
||||
dx = pts[..., :, 2:, :] - pts[..., :, :-2, :]
|
||||
dy = pts[..., 2:, :, :] - pts[..., :-2, :, :]
|
||||
dx = torch.nn.functional.pad(dx.permute(0, 3, 1, 2), (1, 1, 0, 0)).permute(0, 2, 3, 1)
|
||||
dy = torch.nn.functional.pad(dy.permute(0, 3, 1, 2), (0, 0, 1, 1)).permute(0, 2, 3, 1)
|
||||
# dy x dx (not dx x dy) so the result is outward-facing in OpenCV (Y-down flips the right-hand rule), matching v2's predicted normals.
|
||||
n = torch.cross(dy, dx, dim=-1)
|
||||
n = torch.nn.functional.normalize(n, dim=-1)
|
||||
return torch.where(finite.unsqueeze(-1), n, torch.zeros_like(n))
|
||||
|
||||
|
||||
def _normalize_disparity(depth: torch.Tensor) -> torch.Tensor:
|
||||
"""Per-batch normalize 1/depth to [0, 1] using 0.1/99.9 percentile clipping."""
|
||||
out = torch.zeros_like(depth)
|
||||
for i in range(depth.shape[0]):
|
||||
d = depth[i]
|
||||
valid = torch.isfinite(d) & (d > 0)
|
||||
if not valid.any():
|
||||
continue
|
||||
disp = torch.where(valid, 1.0 / d.clamp_min(1e-6), torch.zeros_like(d))
|
||||
disp_valid = disp[valid]
|
||||
lo = torch.quantile(disp_valid, 0.001)
|
||||
hi = torch.quantile(disp_valid, 0.999)
|
||||
scale = (hi - lo).clamp_min(1e-6)
|
||||
norm = ((disp - lo) / scale).clamp(0.0, 1.0)
|
||||
out[i] = torch.where(valid, norm, torch.zeros_like(norm))
|
||||
return out
|
||||
|
||||
|
||||
class LoadMoGeModel(io.ComfyNode):
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
return io.Schema(
|
||||
node_id="LoadMoGeModel",
|
||||
display_name="Load MoGe Model",
|
||||
category="model/loaders",
|
||||
inputs=[
|
||||
io.Combo.Input("model_name", options=folder_paths.get_filename_list("geometry_estimation")),
|
||||
],
|
||||
outputs=[MoGeModelType.Output()],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, model_name) -> io.NodeOutput:
|
||||
path = folder_paths.get_full_path_or_raise("geometry_estimation", model_name)
|
||||
sd = comfy.utils.load_torch_file(path, safe_load=True)
|
||||
return io.NodeOutput(MoGeModel(sd))
|
||||
|
||||
|
||||
class MoGePanoramaInference(io.ComfyNode):
|
||||
"""Equirectangular panorama inference: split into 12 perspective views, run
|
||||
MoGe at fov_x=90 on each, merge via multi-scale Poisson + gradient solve.
|
||||
v2's predicted normals and metric scale are ignored (per-view scales would not align across seams).
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
return io.Schema(
|
||||
node_id="MoGePanoramaInference",
|
||||
search_aliases=["moge", "panorama", "depth", "geometry", "depth estimation", "geometry estimation"],
|
||||
display_name="Run MoGe Panorama Inference",
|
||||
category="image/geometry estimation",
|
||||
description="Run MoGe on an equirectangular panorama by splitting it into 12 perspective views, running inference on each, and merging the results into a single depth map.",
|
||||
inputs=[
|
||||
MoGeModelType.Input("moge_model"),
|
||||
io.Image.Input("image", tooltip="Equirectangular panorama (any aspect)."),
|
||||
io.Int.Input("resolution_level", default=9, min=0, max=9,
|
||||
tooltip="Per-view detail (0 = fastest, 9 = most detailed)."),
|
||||
io.Int.Input("split_resolution", default=512, min=256, max=1024,
|
||||
tooltip="Resolution of each perspective split."),
|
||||
io.Int.Input("merge_resolution", default=1920, min=256, max=8192,
|
||||
tooltip="Long-side resolution of the merged equirect distance map."),
|
||||
io.Int.Input("batch_size", default=4, min=1, max=12,
|
||||
tooltip="Views per inference batch (12 splits total)."),
|
||||
],
|
||||
outputs=[MoGeGeometry.Output(display_name="moge_geometry")],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, moge_model, image, resolution_level, split_resolution, merge_resolution, batch_size) -> io.NodeOutput:
|
||||
|
||||
if image.shape[0] != 1:
|
||||
raise ValueError(f"MoGePanoramaInference takes a single image (got batch of {image.shape[0]})")
|
||||
|
||||
image = image[..., :3]
|
||||
H, W = int(image.shape[1]), int(image.shape[2])
|
||||
scale = min(merge_resolution / max(H, W), 1.0)
|
||||
merge_h, merge_w = max(int(H * scale), 32), max(int(W * scale), 32)
|
||||
|
||||
extrinsics, intrinsics = get_panorama_cameras()
|
||||
|
||||
comfy.model_management.load_model_gpu(moge_model.patcher)
|
||||
device = moge_model.load_device
|
||||
img_chw = image[0].movedim(-1, -3).to(device=device, dtype=moge_model.dtype)
|
||||
splits = split_panorama_image(img_chw, extrinsics, intrinsics, split_resolution)
|
||||
|
||||
n_views = splits.shape[0]
|
||||
|
||||
# Weight each lsmr solve by 4^level so the final-resolution solve doesn't leave the bar idle.
|
||||
merge_levels: list[tuple[int, int]] = []
|
||||
w_, h_ = merge_w, merge_h
|
||||
while True:
|
||||
merge_levels.append((w_, h_))
|
||||
if max(w_, h_) <= 256:
|
||||
break
|
||||
w_, h_ = w_ // 2, h_ // 2
|
||||
merge_levels.reverse()
|
||||
|
||||
solve_weight = {wh: 4 ** i for i, wh in enumerate(merge_levels)}
|
||||
n_merge_view_units = n_views * len(merge_levels)
|
||||
n_merge_solve_units = sum(solve_weight.values())
|
||||
|
||||
pbar = comfy.utils.ProgressBar(n_views + n_merge_view_units + n_merge_solve_units)
|
||||
done = 0
|
||||
|
||||
distance_maps: list = []
|
||||
masks: list = []
|
||||
with tqdm(total=n_views, desc="MoGe panorama inference") as tq:
|
||||
for i in range(0, n_views, batch_size):
|
||||
batch = splits[i:i + batch_size]
|
||||
# apply_metric_scale=False: per-view scales would not align across overlap seams.
|
||||
result = moge_model.infer(batch, resolution_level=resolution_level,
|
||||
fov_x=90.0, force_projection=True,
|
||||
apply_mask=False, apply_metric_scale=False)
|
||||
distance_maps.extend(list(result["points"].float().norm(dim=-1).cpu().numpy()))
|
||||
masks.extend(list(result["mask"].cpu().numpy()))
|
||||
n = batch.shape[0]
|
||||
done += n
|
||||
pbar.update_absolute(done)
|
||||
tq.update(n)
|
||||
|
||||
with tqdm(total=n_merge_view_units + n_merge_solve_units, desc="MoGe panorama merge: views") as tq:
|
||||
def _on_merge_view():
|
||||
nonlocal done
|
||||
done += 1
|
||||
pbar.update_absolute(done)
|
||||
tq.update(1)
|
||||
|
||||
def _on_solve_start(w, h):
|
||||
tq.set_description(f"MoGe panorama merge: solving {w}x{h}")
|
||||
|
||||
def _on_solve_end(w, h):
|
||||
nonlocal done
|
||||
weight = solve_weight[(w, h)]
|
||||
done += weight
|
||||
pbar.update_absolute(done)
|
||||
tq.update(weight)
|
||||
tq.set_description("MoGe panorama merge: views")
|
||||
|
||||
pano_depth, pano_mask = merge_panorama_depth(
|
||||
merge_w, merge_h, distance_maps, masks, list(extrinsics), intrinsics,
|
||||
on_view=_on_merge_view, on_solve_start=_on_solve_start, on_solve_end=_on_solve_end)
|
||||
|
||||
pano_depth = torch.from_numpy(pano_depth)
|
||||
pano_mask = torch.from_numpy(pano_mask)
|
||||
|
||||
if (merge_h, merge_w) != (H, W):
|
||||
pano_depth = torch.nn.functional.interpolate(pano_depth[None, None], size=(H, W), mode="bilinear", align_corners=False).squeeze()
|
||||
pano_mask = torch.nn.functional.interpolate(pano_mask[None, None].float(), size=(H, W), mode="nearest").squeeze() > 0
|
||||
|
||||
# Pixels uncovered by any view's predicted foreground are unconstrained in the lsmr solve and stay at log_depth=0 (depth=1)
|
||||
if pano_mask.any() and not pano_mask.all():
|
||||
far = torch.quantile(pano_depth[pano_mask], 0.95) * 5.0
|
||||
pano_depth = torch.where(pano_mask, pano_depth, far)
|
||||
|
||||
directions = torch.from_numpy(spherical_uv_to_directions(_uv_grid(H, W)))
|
||||
points = (directions * pano_depth[..., None]).unsqueeze(0)
|
||||
depth = pano_depth.unsqueeze(0)
|
||||
mask = pano_mask.unsqueeze(0)
|
||||
|
||||
# Points stay in MoGe spherical coords; MoGePointMapToMesh applies the spherical->glTF rotation after triangulation
|
||||
moge_geometry = {"points": points, "depth": depth, "mask": mask, "image": image.cpu()}
|
||||
return io.NodeOutput(moge_geometry)
|
||||
|
||||
|
||||
class MoGeInference(io.ComfyNode):
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
return io.Schema(
|
||||
node_id="MoGeInference",
|
||||
search_aliases=["moge", "depth", "geometry", "depth estimation", "geometry estimation"],
|
||||
display_name="Run MoGe Inference",
|
||||
description="Run MoGe on a single image to estimate depth and geometry.",
|
||||
category="image/geometry estimation",
|
||||
inputs=[
|
||||
MoGeModelType.Input("moge_model"),
|
||||
io.Image.Input("image"),
|
||||
io.Int.Input("resolution_level", default=9, min=0, max=9,
|
||||
tooltip="0 = fastest, 9 = most detail."),
|
||||
io.Float.Input("fov_x_degrees", default=0.0, min=0.0, max=170.0, step=0.1, advanced=True,
|
||||
tooltip="Horizontal field of view of the source camera. Sets the focal length used to unproject the depth map into 3D. 0 = auto-recover from the predicted points."),
|
||||
io.Int.Input("batch_size", default=4, min=1, max=64,
|
||||
tooltip="Images per inference call. Lower if you OOM on a long video / image set."),
|
||||
io.Boolean.Input("force_projection", default=True, advanced=True),
|
||||
io.Boolean.Input("apply_mask", default=True, advanced=True,
|
||||
tooltip="Set masked-out (sky / invalid) pixels to inf in points and depth so meshing culls them. Disable to keep the raw predicted geometry everywhere; the mask is still returned separately."),
|
||||
],
|
||||
outputs=[MoGeGeometry.Output(display_name="moge_geometry")],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, moge_model, image, resolution_level, fov_x_degrees, batch_size, force_projection, apply_mask) -> io.NodeOutput:
|
||||
|
||||
image = image[..., :3]
|
||||
bchw = image.movedim(-1, -3).contiguous()
|
||||
B = bchw.shape[0]
|
||||
fov = None if fov_x_degrees <= 0 else float(fov_x_degrees)
|
||||
|
||||
pbar = comfy.utils.ProgressBar(B)
|
||||
chunks: list[dict] = []
|
||||
with tqdm(total=B, desc="MoGe inference") as tq:
|
||||
for i in range(0, B, batch_size):
|
||||
chunk = bchw[i:i + batch_size]
|
||||
chunks.append(moge_model.infer(chunk, resolution_level=resolution_level, fov_x=fov,
|
||||
force_projection=force_projection, apply_mask=apply_mask))
|
||||
pbar.update_absolute(min(i + batch_size, B))
|
||||
tq.update(chunk.shape[0])
|
||||
|
||||
def stack(field):
|
||||
vals = [c[field] for c in chunks if field in c]
|
||||
return torch.cat(vals, dim=0) if vals else None
|
||||
|
||||
moge_geometry = {"image": image.cpu()}
|
||||
for field in ("points", "depth", "intrinsics", "mask", "normal"):
|
||||
v = stack(field)
|
||||
if v is not None:
|
||||
moge_geometry[field] = v
|
||||
return io.NodeOutput(moge_geometry)
|
||||
|
||||
|
||||
class MoGeRender(io.ComfyNode):
|
||||
"""Render a visualization or mask from a MOGE_GEOMETRY packet."""
|
||||
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
return io.Schema(
|
||||
node_id="MoGeRender",
|
||||
search_aliases=["moge", "render", "geometry", "depth", "normal"],
|
||||
display_name="Render MoGe Geometry",
|
||||
description="Render a depth map or normal map from geometry data",
|
||||
category="image/geometry estimation",
|
||||
inputs=[
|
||||
MoGeGeometry.Input("moge_geometry"),
|
||||
io.Combo.Input("output", options=["depth", "depth_colored", "normal_opengl", "normal_directx", "mask"], default="depth",
|
||||
tooltip="DirectX vs OpenGL controls the normal-map green-channel convention. DirectX: green = -Y down (Unreal). OpenGL: green = +Y up (Blender, Substance, Unity, glTF)."),
|
||||
],
|
||||
outputs=[io.Image.Output()],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, moge_geometry, output) -> io.NodeOutput:
|
||||
is_normal = output in ("normal_directx", "normal_opengl")
|
||||
opengl = output.endswith("_opengl")
|
||||
|
||||
# Pick the input tensor for the chosen mode and validate availability.
|
||||
if output in ("depth", "depth_colored"):
|
||||
if "depth" not in moge_geometry:
|
||||
raise ValueError("moge_geometry has no depth output.")
|
||||
src = moge_geometry["depth"]
|
||||
elif is_normal:
|
||||
if "normal" in moge_geometry:
|
||||
src = moge_geometry["normal"]
|
||||
elif "points" in moge_geometry:
|
||||
src = moge_geometry["points"]
|
||||
else:
|
||||
raise ValueError("moge_geometry has neither normals nor points to derive normals from.")
|
||||
elif output == "mask":
|
||||
if "mask" not in moge_geometry:
|
||||
raise ValueError("moge_geometry has no mask output.")
|
||||
src = moge_geometry["mask"]
|
||||
else:
|
||||
raise ValueError(f"Unknown output mode: {output}")
|
||||
|
||||
B = src.shape[0]
|
||||
pbar = comfy.utils.ProgressBar(B)
|
||||
out: list[torch.Tensor] = []
|
||||
with tqdm(total=B, desc=f"MoGe render: {output}") as tq:
|
||||
for i in range(B):
|
||||
slc = src[i:i + 1].float()
|
||||
if output in ("depth", "depth_colored"):
|
||||
d = _normalize_disparity(slc)
|
||||
out.append(_turbo(d) if output == "depth_colored"
|
||||
else d.unsqueeze(-1).expand(*d.shape, 3).contiguous())
|
||||
elif is_normal:
|
||||
n = slc if "normal" in moge_geometry else _normals_from_points(slc)
|
||||
# MoGe is OpenCV (Z+ into scene); normal-map convention is Z+ out of surface, so flip Z.
|
||||
y_sign = -1.0 if opengl else 1.0
|
||||
n = n * n.new_tensor([1.0, y_sign, -1.0])
|
||||
out.append((n * 0.5 + 0.5).clamp(0.0, 1.0))
|
||||
elif output == "mask":
|
||||
out.append(slc.unsqueeze(-1).expand(*slc.shape, 3).contiguous())
|
||||
pbar.update_absolute(i + 1)
|
||||
tq.update(1)
|
||||
result = torch.cat(out, dim=0).to(device=comfy.model_management.intermediate_device(), dtype=comfy.model_management.intermediate_dtype())
|
||||
return io.NodeOutput(result)
|
||||
|
||||
|
||||
class MoGePointMapToMesh(io.ComfyNode):
|
||||
"""Triangulate one image of a MoGe point map into a Types.MESH (UVs + texture)."""
|
||||
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
return io.Schema(
|
||||
node_id="MoGePointMapToMesh",
|
||||
search_aliases=["moge", "mesh", "geometry", "point map"],
|
||||
display_name="Convert MoGe Point Map to Mesh",
|
||||
description="Convert a MoGe point map into a 3D mesh.",
|
||||
category="image/geometry estimation",
|
||||
inputs=[
|
||||
MoGeGeometry.Input("moge_geometry"),
|
||||
io.Int.Input("batch_index", default=0, min=0, max=4096,
|
||||
tooltip="Which image of a batched MoGe geometry to mesh. Per-image vertex counts "
|
||||
"differ, so batches can't be stacked into a single MESH."),
|
||||
io.Int.Input("decimation", default=1, min=1, max=8,
|
||||
tooltip="Vertex stride; 1 = full resolution."),
|
||||
io.Float.Input("discontinuity_threshold", default=0.04, min=0.0, max=1.0, step=0.01,
|
||||
tooltip="Drop pixels whose 3x3 depth span exceeds this fraction. 0 = off."),
|
||||
io.Boolean.Input("texture", default=True,
|
||||
tooltip="Carry the source image through as the baseColor texture."),
|
||||
],
|
||||
outputs=[io.Mesh.Output()],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, moge_geometry, batch_index, decimation, discontinuity_threshold, texture) -> io.NodeOutput:
|
||||
if "points" not in moge_geometry:
|
||||
raise ValueError("moge_geometry has no points output.")
|
||||
points = moge_geometry["points"]
|
||||
B = points.shape[0]
|
||||
if batch_index >= B:
|
||||
raise ValueError(f"batch_index {batch_index} out of range; moge_geometry has batch size {B}.")
|
||||
|
||||
# Pass depth so the rtol edge check sees radial depth -- for panoramas
|
||||
# points[..., 2] = cos(phi)*r goes negative below the equator and the rtol clamp would drop the bottom half.
|
||||
edge_depth = moge_geometry["depth"][batch_index] if "depth" in moge_geometry else None
|
||||
verts, faces, uvs = triangulate_grid_mesh(
|
||||
points[batch_index], decimation=decimation,
|
||||
discontinuity_threshold=discontinuity_threshold, depth=edge_depth,
|
||||
)
|
||||
if verts.shape[0] == 0 or faces.shape[0] == 0:
|
||||
raise ValueError("MoGe produced an empty mesh; try discontinuity_threshold=0 or apply_mask=False.")
|
||||
|
||||
if "intrinsics" not in moge_geometry:
|
||||
# Panorama: rotate MoGe spherical (Z up) -> glTF (Y up, Z back), correct for inside-the-sphere viewing)
|
||||
verts = verts[:, [1, 2, 0]].contiguous()
|
||||
else:
|
||||
# Perspective MoGe (X right, Y down, Z forward) -> glTF; face flip keeps winding CCW after the Y/Z flip.
|
||||
verts = verts * torch.tensor([1.0, -1.0, -1.0], dtype=verts.dtype)
|
||||
faces = faces[:, [0, 2, 1]].contiguous()
|
||||
|
||||
tex = moge_geometry["image"][batch_index:batch_index + 1] if texture else None
|
||||
mesh = Types.MESH(
|
||||
vertices=verts.unsqueeze(0),
|
||||
faces=faces.unsqueeze(0),
|
||||
uvs=uvs.unsqueeze(0),
|
||||
texture=tex,
|
||||
)
|
||||
return io.NodeOutput(mesh)
|
||||
|
||||
|
||||
class MoGeGeometryToFOV(io.ComfyNode):
|
||||
"""Extract horizontal/vertical FOV from MoGe intrinsics, e.g. fov_y to feed SAM3DBody_Predict."""
|
||||
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
return io.Schema(
|
||||
node_id="MoGeGeometryToFOV",
|
||||
search_aliases=["moge", "fov", "geometry", "intrinsics", "field of view"],
|
||||
display_name="Get FoV from MoGe Geometry",
|
||||
description="Derive the field of view and focal length from MoGe intrinsics.",
|
||||
category="image/geometry estimation",
|
||||
inputs=[
|
||||
MoGeGeometry.Input("moge_geometry"),
|
||||
io.Combo.Input("axis", options=["vertical", "horizontal", "diagonal"], default="vertical",
|
||||
tooltip="'vertical' (fov_y), 'horizontal' (fov_x), or 'diagonal'."),
|
||||
io.Combo.Input("unit", options=["degrees", "radians"], default="degrees",
|
||||
tooltip="Output unit for the FOV."),
|
||||
],
|
||||
outputs=[
|
||||
io.Float.Output(display_name="fov"),
|
||||
io.Float.Output(display_name="focal_pixels"),
|
||||
],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, moge_geometry, axis, unit) -> io.NodeOutput:
|
||||
K = moge_geometry.get("intrinsics") if isinstance(moge_geometry, dict) else None
|
||||
if K is None:
|
||||
raise ValueError("moge_geometry has no intrinsics (panorama geometry has none).")
|
||||
if K.ndim == 3:
|
||||
K = K[0]
|
||||
# MoGe normalizes fx by width and fy by height; with cx=cy=0.5 the half-extent
|
||||
# in normalized units is 0.5, so fov = 2*atan(0.5 / f) per axis (hypot for diagonal).
|
||||
hx = 0.5 / float(K[0, 0].item())
|
||||
hy = 0.5 / float(K[1, 1].item())
|
||||
half_tan = {"horizontal": hx, "vertical": hy, "diagonal": math.hypot(hx, hy)}[axis]
|
||||
fov_radians = 2.0 * math.atan(half_tan)
|
||||
fov = fov_radians if unit == "radians" else math.degrees(fov_radians)
|
||||
# Pixels are square here, so fy*H == fx*W is the single lens focal in pixels.
|
||||
src = next((moge_geometry[k] for k in ("image", "points", "depth") if k in moge_geometry), None)
|
||||
if src is None:
|
||||
raise ValueError("moge_geometry has no image/points/depth to read the pixel height from.")
|
||||
H = int(src.shape[1])
|
||||
focal_pixels = float(K[1, 1].item()) * H
|
||||
return io.NodeOutput(fov, focal_pixels)
|
||||
|
||||
|
||||
class MoGeExtension(ComfyExtension):
|
||||
@override
|
||||
async def get_node_list(self) -> list[type[io.ComfyNode]]:
|
||||
return [LoadMoGeModel, MoGeInference, MoGePanoramaInference, MoGeRender, MoGePointMapToMesh, MoGeGeometryToFOV]
|
||||
|
||||
|
||||
async def comfy_entrypoint() -> MoGeExtension:
|
||||
return MoGeExtension()
|
||||
@@ -0,0 +1,914 @@
|
||||
from typing_extensions import override
|
||||
import numpy as np
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
from PIL import Image
|
||||
import math
|
||||
from enum import Enum
|
||||
from typing import TypedDict, Literal
|
||||
import kornia
|
||||
|
||||
import comfy.utils
|
||||
import comfy.model_management
|
||||
from comfy_extras.nodes_latent import reshape_latent_to
|
||||
import node_helpers
|
||||
from comfy_api.latest import ComfyExtension, io
|
||||
from nodes import MAX_RESOLUTION
|
||||
|
||||
class Blend(io.ComfyNode):
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
return io.Schema(
|
||||
node_id="ImageBlend",
|
||||
search_aliases=["mix images"],
|
||||
display_name="Blend Images",
|
||||
category="image/filters",
|
||||
essentials_category="Image Tools",
|
||||
inputs=[
|
||||
io.Image.Input("image1"),
|
||||
io.Image.Input("image2"),
|
||||
io.Float.Input("blend_factor", default=0.5, min=0.0, max=1.0, step=0.01),
|
||||
io.Combo.Input("blend_mode", options=["normal", "multiply", "screen", "overlay", "soft_light", "difference"]),
|
||||
],
|
||||
outputs=[
|
||||
io.Image.Output(),
|
||||
],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, image1: torch.Tensor, image2: torch.Tensor, blend_factor: float, blend_mode: str) -> io.NodeOutput:
|
||||
image1, image2 = node_helpers.image_alpha_fix(image1, image2)
|
||||
image2 = image2.to(image1.device)
|
||||
if image1.shape != image2.shape:
|
||||
image2 = image2.permute(0, 3, 1, 2)
|
||||
image2 = comfy.utils.common_upscale(image2, image1.shape[2], image1.shape[1], upscale_method='bicubic', crop='center')
|
||||
image2 = image2.permute(0, 2, 3, 1)
|
||||
|
||||
blended_image = cls.blend_mode(image1, image2, blend_mode)
|
||||
blended_image = image1 * (1 - blend_factor) + blended_image * blend_factor
|
||||
blended_image = torch.clamp(blended_image, 0, 1)
|
||||
if image1.shape[-1] == 4: # alpha stores transparency, not color
|
||||
blended_image[..., 3] = image1[..., 3]
|
||||
return io.NodeOutput(blended_image)
|
||||
|
||||
@classmethod
|
||||
def blend_mode(cls, img1, img2, mode):
|
||||
if mode == "normal":
|
||||
return img2
|
||||
elif mode == "multiply":
|
||||
return img1 * img2
|
||||
elif mode == "screen":
|
||||
return 1 - (1 - img1) * (1 - img2)
|
||||
elif mode == "overlay":
|
||||
return torch.where(img1 <= 0.5, 2 * img1 * img2, 1 - 2 * (1 - img1) * (1 - img2))
|
||||
elif mode == "soft_light":
|
||||
return torch.where(img2 <= 0.5, img1 - (1 - 2 * img2) * img1 * (1 - img1), img1 + (2 * img2 - 1) * (cls.g(img1) - img1))
|
||||
elif mode == "difference":
|
||||
return img1 - img2
|
||||
raise ValueError(f"Unsupported blend mode: {mode}")
|
||||
|
||||
@classmethod
|
||||
def g(cls, x):
|
||||
return torch.where(x <= 0.25, ((16 * x - 12) * x + 4) * x, torch.sqrt(x))
|
||||
|
||||
def gaussian_kernel(kernel_size: int, sigma: float, device=None, dtype=torch.float32):
|
||||
x, y = torch.meshgrid(torch.linspace(-1, 1, kernel_size, device=device), torch.linspace(-1, 1, kernel_size, device=device), indexing="ij")
|
||||
d = torch.sqrt(x * x + y * y)
|
||||
g = torch.exp(-(d * d) / (2.0 * sigma * sigma))
|
||||
return (g / g.sum()).to(dtype)
|
||||
|
||||
class Blur(io.ComfyNode):
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
return io.Schema(
|
||||
node_id="ImageBlur",
|
||||
display_name="Blur Image",
|
||||
category="image/filters",
|
||||
inputs=[
|
||||
io.Image.Input("image"),
|
||||
io.Int.Input("blur_radius", default=1, min=1, max=31, step=1),
|
||||
io.Float.Input("sigma", default=1.0, min=0.1, max=10.0, step=0.1),
|
||||
],
|
||||
outputs=[
|
||||
io.Image.Output(),
|
||||
],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, image: torch.Tensor, blur_radius: int, sigma: float) -> io.NodeOutput:
|
||||
if blur_radius == 0:
|
||||
return io.NodeOutput(image)
|
||||
|
||||
image = image.to(comfy.model_management.get_torch_device())
|
||||
batch_size, height, width, channels = image.shape
|
||||
|
||||
kernel_size = blur_radius * 2 + 1
|
||||
kernel = gaussian_kernel(kernel_size, sigma, device=image.device, dtype=image.dtype).repeat(channels, 1, 1).unsqueeze(1)
|
||||
|
||||
image = image.permute(0, 3, 1, 2) # Torch wants (B, C, H, W) we use (B, H, W, C)
|
||||
padded_image = F.pad(image, (blur_radius,blur_radius,blur_radius,blur_radius), 'reflect')
|
||||
blurred = F.conv2d(padded_image, kernel, padding=kernel_size // 2, groups=channels)[:,:,blur_radius:-blur_radius, blur_radius:-blur_radius]
|
||||
blurred = blurred.permute(0, 2, 3, 1)
|
||||
|
||||
return io.NodeOutput(blurred.to(comfy.model_management.intermediate_device()))
|
||||
|
||||
|
||||
class Quantize(io.ComfyNode):
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
return io.Schema(
|
||||
node_id="ImageQuantize",
|
||||
display_name="Quantize Image",
|
||||
category="image/filters",
|
||||
inputs=[
|
||||
io.Image.Input("image"),
|
||||
io.Int.Input("colors", default=256, min=1, max=256, step=1),
|
||||
io.Combo.Input("dither", options=["none", "floyd-steinberg", "bayer-2", "bayer-4", "bayer-8", "bayer-16"]),
|
||||
],
|
||||
outputs=[
|
||||
io.Image.Output(),
|
||||
],
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def bayer(im, pal_im, order):
|
||||
def normalized_bayer_matrix(n):
|
||||
if n == 0:
|
||||
return np.zeros((1,1), "float32")
|
||||
else:
|
||||
q = 4 ** n
|
||||
m = q * normalized_bayer_matrix(n - 1)
|
||||
return np.bmat(((m-1.5, m+0.5), (m+1.5, m-0.5))) / q
|
||||
|
||||
num_colors = len(pal_im.getpalette()) // 3
|
||||
spread = 2 * 256 / num_colors
|
||||
bayer_n = int(math.log2(order))
|
||||
bayer_matrix = torch.from_numpy(spread * normalized_bayer_matrix(bayer_n) + 0.5)
|
||||
|
||||
result = torch.from_numpy(np.array(im).astype(np.float32))
|
||||
tw = math.ceil(result.shape[0] / bayer_matrix.shape[0])
|
||||
th = math.ceil(result.shape[1] / bayer_matrix.shape[1])
|
||||
tiled_matrix = bayer_matrix.tile(tw, th).unsqueeze(-1)
|
||||
result.add_(tiled_matrix[:result.shape[0],:result.shape[1]]).clamp_(0, 255)
|
||||
result = result.to(dtype=torch.uint8)
|
||||
|
||||
im = Image.fromarray(result.cpu().numpy())
|
||||
im = im.quantize(palette=pal_im, dither=Image.Dither.NONE)
|
||||
return im
|
||||
|
||||
@classmethod
|
||||
def execute(cls, image: torch.Tensor, colors: int, dither: str) -> io.NodeOutput:
|
||||
rgb = image[..., :3]
|
||||
batch_size, height, width, _ = rgb.shape
|
||||
result = torch.zeros_like(rgb)
|
||||
|
||||
for b in range(batch_size):
|
||||
im = Image.fromarray((rgb[b] * 255).to(torch.uint8).numpy(), mode='RGB')
|
||||
|
||||
pal_im = im.quantize(colors=colors) # Required as described in https://github.com/python-pillow/Pillow/issues/5836
|
||||
|
||||
if dither == "none":
|
||||
quantized_image = im.quantize(palette=pal_im, dither=Image.Dither.NONE)
|
||||
elif dither == "floyd-steinberg":
|
||||
quantized_image = im.quantize(palette=pal_im, dither=Image.Dither.FLOYDSTEINBERG)
|
||||
elif dither.startswith("bayer"):
|
||||
order = int(dither.split('-')[-1])
|
||||
quantized_image = Quantize.bayer(im, pal_im, order)
|
||||
|
||||
quantized_array = torch.tensor(np.array(quantized_image.convert("RGB"))).float() / 255
|
||||
result[b] = quantized_array
|
||||
|
||||
if image.shape[-1] == 4:
|
||||
result = torch.cat((result, image[..., 3:]), dim=-1)
|
||||
return io.NodeOutput(result)
|
||||
|
||||
class Sharpen(io.ComfyNode):
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
return io.Schema(
|
||||
node_id="ImageSharpen",
|
||||
display_name="Sharpen Image",
|
||||
category="image/filters",
|
||||
inputs=[
|
||||
io.Image.Input("image"),
|
||||
io.Int.Input("sharpen_radius", default=1, min=1, max=31, step=1, advanced=True),
|
||||
io.Float.Input("sigma", default=1.0, min=0.1, max=10.0, step=0.01, advanced=True),
|
||||
io.Float.Input("alpha", default=1.0, min=0.0, max=5.0, step=0.01, advanced=True),
|
||||
],
|
||||
outputs=[
|
||||
io.Image.Output(),
|
||||
],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, image: torch.Tensor, sharpen_radius: int, sigma:float, alpha: float) -> io.NodeOutput:
|
||||
if sharpen_radius == 0:
|
||||
return io.NodeOutput(image)
|
||||
|
||||
batch_size, height, width, channels = image.shape
|
||||
image = image.to(comfy.model_management.get_torch_device())
|
||||
|
||||
kernel_size = sharpen_radius * 2 + 1
|
||||
kernel = gaussian_kernel(kernel_size, sigma, device=image.device, dtype=image.dtype) * -(alpha*10)
|
||||
kernel = kernel.to(dtype=image.dtype)
|
||||
center = kernel_size // 2
|
||||
kernel[center, center] = kernel[center, center] - kernel.sum() + 1.0
|
||||
kernel = kernel.repeat(channels, 1, 1).unsqueeze(1)
|
||||
|
||||
tensor_image = image.permute(0, 3, 1, 2) # Torch wants (B, C, H, W) we use (B, H, W, C)
|
||||
tensor_image = F.pad(tensor_image, (sharpen_radius,sharpen_radius,sharpen_radius,sharpen_radius), 'reflect')
|
||||
sharpened = F.conv2d(tensor_image, kernel, padding=center, groups=channels)[:,:,sharpen_radius:-sharpen_radius, sharpen_radius:-sharpen_radius]
|
||||
sharpened = sharpened.permute(0, 2, 3, 1)
|
||||
|
||||
result = torch.clamp(sharpened, 0, 1)
|
||||
|
||||
return io.NodeOutput(result.to(comfy.model_management.intermediate_device()))
|
||||
|
||||
class ImageScaleToTotalPixels(io.ComfyNode):
|
||||
upscale_methods = ["nearest-exact", "bilinear", "area", "bicubic", "lanczos"]
|
||||
crop_methods = ["disabled", "center"]
|
||||
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
return io.Schema(
|
||||
node_id="ImageScaleToTotalPixels",
|
||||
display_name="Scale Image to Total Pixels",
|
||||
category="image/upscaling",
|
||||
inputs=[
|
||||
io.Image.Input("image"),
|
||||
io.Combo.Input("upscale_method", options=cls.upscale_methods),
|
||||
io.Float.Input("megapixels", default=1.0, min=0.01, max=16.0, step=0.01),
|
||||
io.Int.Input("resolution_steps", default=1, min=1, max=256, advanced=True),
|
||||
],
|
||||
outputs=[
|
||||
io.Image.Output(),
|
||||
],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, image, upscale_method, megapixels, resolution_steps) -> io.NodeOutput:
|
||||
samples = image.movedim(-1,1)
|
||||
total = megapixels * 1024 * 1024
|
||||
|
||||
scale_by = math.sqrt(total / (samples.shape[3] * samples.shape[2]))
|
||||
width = round(samples.shape[3] * scale_by / resolution_steps) * resolution_steps
|
||||
height = round(samples.shape[2] * scale_by / resolution_steps) * resolution_steps
|
||||
|
||||
s = comfy.utils.common_upscale(samples, int(width), int(height), upscale_method, "disabled")
|
||||
s = s.movedim(1,-1)
|
||||
return io.NodeOutput(s)
|
||||
|
||||
class ResizeType(str, Enum):
|
||||
SCALE_BY = "scale by multiplier"
|
||||
SCALE_DIMENSIONS = "scale dimensions"
|
||||
SCALE_LONGER_DIMENSION = "scale longer dimension"
|
||||
SCALE_SHORTER_DIMENSION = "scale shorter dimension"
|
||||
SCALE_WIDTH = "scale width"
|
||||
SCALE_HEIGHT = "scale height"
|
||||
SCALE_TOTAL_PIXELS = "scale total pixels"
|
||||
MATCH_SIZE = "match size"
|
||||
SCALE_TO_MULTIPLE = "scale to multiple"
|
||||
|
||||
def is_image(input: torch.Tensor) -> bool:
|
||||
# images have 4 dimensions: [batch, height, width, channels]
|
||||
# masks have 3 dimensions: [batch, height, width]
|
||||
return len(input.shape) == 4
|
||||
|
||||
def init_image_mask_input(input: torch.Tensor, is_type_image: bool) -> torch.Tensor:
|
||||
if is_type_image:
|
||||
input = input.movedim(-1, 1)
|
||||
else:
|
||||
input = input.unsqueeze(1)
|
||||
return input
|
||||
|
||||
def finalize_image_mask_input(input: torch.Tensor, is_type_image: bool) -> torch.Tensor:
|
||||
if is_type_image:
|
||||
input = input.movedim(1, -1)
|
||||
else:
|
||||
input = input.squeeze(1)
|
||||
return input
|
||||
|
||||
def scale_by(input: torch.Tensor, multiplier: float, scale_method: str) -> torch.Tensor:
|
||||
is_type_image = is_image(input)
|
||||
input = init_image_mask_input(input, is_type_image)
|
||||
width = round(input.shape[-1] * multiplier)
|
||||
height = round(input.shape[-2] * multiplier)
|
||||
|
||||
input = comfy.utils.common_upscale(input, width, height, scale_method, "disabled")
|
||||
input = finalize_image_mask_input(input, is_type_image)
|
||||
return input
|
||||
|
||||
def scale_dimensions(input: torch.Tensor, width: int, height: int, scale_method: str, crop: str="disabled") -> torch.Tensor:
|
||||
if width == 0 and height == 0:
|
||||
return input
|
||||
is_type_image = is_image(input)
|
||||
input = init_image_mask_input(input, is_type_image)
|
||||
|
||||
if width == 0:
|
||||
width = max(1, round(input.shape[-1] * height / input.shape[-2]))
|
||||
elif height == 0:
|
||||
height = max(1, round(input.shape[-2] * width / input.shape[-1]))
|
||||
|
||||
input = comfy.utils.common_upscale(input, width, height, scale_method, crop)
|
||||
input = finalize_image_mask_input(input, is_type_image)
|
||||
return input
|
||||
|
||||
def scale_longer_dimension(input: torch.Tensor, longer_size: int, scale_method: str) -> torch.Tensor:
|
||||
is_type_image = is_image(input)
|
||||
input = init_image_mask_input(input, is_type_image)
|
||||
width = input.shape[-1]
|
||||
height = input.shape[-2]
|
||||
|
||||
if height > width:
|
||||
width = round((width / height) * longer_size)
|
||||
height = longer_size
|
||||
elif width > height:
|
||||
height = round((height / width) * longer_size)
|
||||
width = longer_size
|
||||
else:
|
||||
height = longer_size
|
||||
width = longer_size
|
||||
|
||||
input = comfy.utils.common_upscale(input, width, height, scale_method, "disabled")
|
||||
input = finalize_image_mask_input(input, is_type_image)
|
||||
return input
|
||||
|
||||
def scale_shorter_dimension(input: torch.Tensor, shorter_size: int, scale_method: str) -> torch.Tensor:
|
||||
is_type_image = is_image(input)
|
||||
input = init_image_mask_input(input, is_type_image)
|
||||
width = input.shape[-1]
|
||||
height = input.shape[-2]
|
||||
|
||||
if height < width:
|
||||
width = round((width / height) * shorter_size)
|
||||
height = shorter_size
|
||||
elif width < height:
|
||||
height = round((height / width) * shorter_size)
|
||||
width = shorter_size
|
||||
else:
|
||||
height = shorter_size
|
||||
width = shorter_size
|
||||
|
||||
input = comfy.utils.common_upscale(input, width, height, scale_method, "disabled")
|
||||
input = finalize_image_mask_input(input, is_type_image)
|
||||
return input
|
||||
|
||||
def scale_total_pixels(input: torch.Tensor, megapixels: float, scale_method: str) -> torch.Tensor:
|
||||
is_type_image = is_image(input)
|
||||
input = init_image_mask_input(input, is_type_image)
|
||||
total = int(megapixels * 1024 * 1024)
|
||||
|
||||
scale_by = math.sqrt(total / (input.shape[-1] * input.shape[-2]))
|
||||
width = round(input.shape[-1] * scale_by)
|
||||
height = round(input.shape[-2] * scale_by)
|
||||
|
||||
input = comfy.utils.common_upscale(input, width, height, scale_method, "disabled")
|
||||
input = finalize_image_mask_input(input, is_type_image)
|
||||
return input
|
||||
|
||||
def scale_match_size(input: torch.Tensor, match: torch.Tensor, scale_method: str, crop: str) -> torch.Tensor:
|
||||
is_type_image = is_image(input)
|
||||
input = init_image_mask_input(input, is_type_image)
|
||||
match = init_image_mask_input(match, is_image(match))
|
||||
|
||||
width = match.shape[-1]
|
||||
height = match.shape[-2]
|
||||
input = comfy.utils.common_upscale(input, width, height, scale_method, crop)
|
||||
input = finalize_image_mask_input(input, is_type_image)
|
||||
return input
|
||||
|
||||
def scale_to_multiple_cover(input: torch.Tensor, multiple: int, scale_method: str) -> torch.Tensor:
|
||||
if multiple <= 1:
|
||||
return input
|
||||
is_type_image = is_image(input)
|
||||
if is_type_image:
|
||||
_, height, width, _ = input.shape
|
||||
else:
|
||||
_, height, width = input.shape
|
||||
target_w = (width // multiple) * multiple
|
||||
target_h = (height // multiple) * multiple
|
||||
if target_w == 0 or target_h == 0:
|
||||
return input
|
||||
if target_w == width and target_h == height:
|
||||
return input
|
||||
s_w = target_w / width
|
||||
s_h = target_h / height
|
||||
if s_w >= s_h:
|
||||
scaled_w = target_w
|
||||
scaled_h = int(math.ceil(height * s_w))
|
||||
if scaled_h < target_h:
|
||||
scaled_h = target_h
|
||||
else:
|
||||
scaled_h = target_h
|
||||
scaled_w = int(math.ceil(width * s_h))
|
||||
if scaled_w < target_w:
|
||||
scaled_w = target_w
|
||||
input = init_image_mask_input(input, is_type_image)
|
||||
input = comfy.utils.common_upscale(input, scaled_w, scaled_h, scale_method, "disabled")
|
||||
input = finalize_image_mask_input(input, is_type_image)
|
||||
x0 = (scaled_w - target_w) // 2
|
||||
y0 = (scaled_h - target_h) // 2
|
||||
x1 = x0 + target_w
|
||||
y1 = y0 + target_h
|
||||
if is_type_image:
|
||||
return input[:, y0:y1, x0:x1, :]
|
||||
return input[:, y0:y1, x0:x1]
|
||||
|
||||
class ResizeImageMaskNode(io.ComfyNode):
|
||||
scale_methods = ["nearest-exact", "bilinear", "area", "bicubic", "lanczos"]
|
||||
crop_methods = ["disabled", "center"]
|
||||
|
||||
class ResizeTypedDict(TypedDict):
|
||||
resize_type: ResizeType
|
||||
scale_method: Literal["nearest-exact", "bilinear", "area", "bicubic", "lanczos"]
|
||||
crop: Literal["disabled", "center"]
|
||||
multiplier: float
|
||||
width: int
|
||||
height: int
|
||||
longer_size: int
|
||||
shorter_size: int
|
||||
megapixels: float
|
||||
multiple: int
|
||||
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
template = io.MatchType.Template("input_type", [io.Image, io.Mask])
|
||||
crop_combo = io.Combo.Input(
|
||||
"crop",
|
||||
options=cls.crop_methods,
|
||||
default="center",
|
||||
tooltip="How to handle aspect ratio mismatch: 'disabled' stretches to fit, 'center' crops to maintain aspect ratio.",
|
||||
)
|
||||
return io.Schema(
|
||||
node_id="ResizeImageMaskNode",
|
||||
display_name="Resize Image/Mask",
|
||||
description="Resize an image or mask using various scaling methods.",
|
||||
category="image/transform",
|
||||
search_aliases=["resize", "resize image", "resize mask", "scale", "scale image", "scale mask", "image resize", "change size", "dimensions", "shrink", "enlarge"],
|
||||
inputs=[
|
||||
io.MatchType.Input("input", template=template),
|
||||
io.DynamicCombo.Input(
|
||||
"resize_type",
|
||||
tooltip="Select how to resize: by exact dimensions, scale factor, matching another image, etc.",
|
||||
options=[
|
||||
io.DynamicCombo.Option(ResizeType.SCALE_DIMENSIONS, [
|
||||
io.Int.Input("width", default=512, min=0, max=MAX_RESOLUTION, step=1, tooltip="Target width in pixels. Set to 0 to auto-calculate from height while preserving aspect ratio."),
|
||||
io.Int.Input("height", default=512, min=0, max=MAX_RESOLUTION, step=1, tooltip="Target height in pixels. Set to 0 to auto-calculate from width while preserving aspect ratio."),
|
||||
crop_combo,
|
||||
]),
|
||||
io.DynamicCombo.Option(ResizeType.SCALE_BY, [
|
||||
io.Float.Input("multiplier", default=1.00, min=0.01, max=8.0, step=0.01, tooltip="Scale factor (e.g., 2.0 doubles size, 0.5 halves size)."),
|
||||
]),
|
||||
io.DynamicCombo.Option(ResizeType.SCALE_LONGER_DIMENSION, [
|
||||
io.Int.Input("longer_size", default=512, min=0, max=MAX_RESOLUTION, step=1, tooltip="The longer edge will be resized to this value. Aspect ratio is preserved."),
|
||||
]),
|
||||
io.DynamicCombo.Option(ResizeType.SCALE_SHORTER_DIMENSION, [
|
||||
io.Int.Input("shorter_size", default=512, min=0, max=MAX_RESOLUTION, step=1, tooltip="The shorter edge will be resized to this value. Aspect ratio is preserved."),
|
||||
]),
|
||||
io.DynamicCombo.Option(ResizeType.SCALE_WIDTH, [
|
||||
io.Int.Input("width", default=512, min=0, max=MAX_RESOLUTION, step=1, tooltip="Target width in pixels. Height auto-adjusts to preserve aspect ratio."),
|
||||
]),
|
||||
io.DynamicCombo.Option(ResizeType.SCALE_HEIGHT, [
|
||||
io.Int.Input("height", default=512, min=0, max=MAX_RESOLUTION, step=1, tooltip="Target height in pixels. Width auto-adjusts to preserve aspect ratio."),
|
||||
]),
|
||||
io.DynamicCombo.Option(ResizeType.SCALE_TOTAL_PIXELS, [
|
||||
io.Float.Input("megapixels", default=1.0, min=0.01, max=16.0, step=0.01, tooltip="Target total megapixels (e.g., 1.0 ≈ 1024×1024). Aspect ratio is preserved."),
|
||||
]),
|
||||
io.DynamicCombo.Option(ResizeType.MATCH_SIZE, [
|
||||
io.MultiType.Input("match", [io.Image, io.Mask], tooltip="Resize input to match the dimensions of this reference image or mask."),
|
||||
crop_combo,
|
||||
]),
|
||||
io.DynamicCombo.Option(ResizeType.SCALE_TO_MULTIPLE, [
|
||||
io.Int.Input("multiple", default=8, min=1, max=MAX_RESOLUTION, step=1, tooltip="Resize so width and height are divisible by this number. Useful for latent alignment (e.g., 8 or 64)."),
|
||||
]),
|
||||
],
|
||||
),
|
||||
io.Combo.Input(
|
||||
"scale_method",
|
||||
options=cls.scale_methods,
|
||||
default="area",
|
||||
tooltip="Interpolation algorithm. 'area' is best for downscaling, 'lanczos' for upscaling, 'nearest-exact' for pixel art.",
|
||||
),
|
||||
],
|
||||
outputs=[io.MatchType.Output(template=template, display_name="resized")]
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, input: io.Image.Type | io.Mask.Type, scale_method: io.Combo.Type, resize_type: ResizeTypedDict) -> io.NodeOutput:
|
||||
selected_type = resize_type["resize_type"]
|
||||
if selected_type == ResizeType.SCALE_BY:
|
||||
return io.NodeOutput(scale_by(input, resize_type["multiplier"], scale_method))
|
||||
elif selected_type == ResizeType.SCALE_DIMENSIONS:
|
||||
return io.NodeOutput(scale_dimensions(input, resize_type["width"], resize_type["height"], scale_method, resize_type["crop"]))
|
||||
elif selected_type == ResizeType.SCALE_LONGER_DIMENSION:
|
||||
return io.NodeOutput(scale_longer_dimension(input, resize_type["longer_size"], scale_method))
|
||||
elif selected_type == ResizeType.SCALE_SHORTER_DIMENSION:
|
||||
return io.NodeOutput(scale_shorter_dimension(input, resize_type["shorter_size"], scale_method))
|
||||
elif selected_type == ResizeType.SCALE_WIDTH:
|
||||
return io.NodeOutput(scale_dimensions(input, resize_type["width"], 0, scale_method))
|
||||
elif selected_type == ResizeType.SCALE_HEIGHT:
|
||||
return io.NodeOutput(scale_dimensions(input, 0, resize_type["height"], scale_method))
|
||||
elif selected_type == ResizeType.SCALE_TOTAL_PIXELS:
|
||||
return io.NodeOutput(scale_total_pixels(input, resize_type["megapixels"], scale_method))
|
||||
elif selected_type == ResizeType.MATCH_SIZE:
|
||||
return io.NodeOutput(scale_match_size(input, resize_type["match"], scale_method, resize_type["crop"]))
|
||||
elif selected_type == ResizeType.SCALE_TO_MULTIPLE:
|
||||
return io.NodeOutput(scale_to_multiple_cover(input, resize_type["multiple"], scale_method))
|
||||
raise ValueError(f"Unsupported resize type: {selected_type}")
|
||||
|
||||
def batch_images(images: list[torch.Tensor]) -> torch.Tensor | None:
|
||||
if len(images) == 0:
|
||||
return None
|
||||
# first, get the max channels count
|
||||
max_channels = max(image.shape[-1] for image in images)
|
||||
# then, pad all images to have the same channels count
|
||||
padded_images: list[torch.Tensor] = []
|
||||
for image in images:
|
||||
if image.shape[-1] < max_channels:
|
||||
padded_images.append(torch.nn.functional.pad(image, (0,1), mode='constant', value=1.0))
|
||||
else:
|
||||
padded_images.append(image)
|
||||
# resize all images to be the same size as the first image
|
||||
resized_images: list[torch.Tensor] = []
|
||||
first_image_shape = padded_images[0].shape
|
||||
for image in padded_images:
|
||||
if image.shape[1:] != first_image_shape[1:]:
|
||||
resized_images.append(comfy.utils.common_upscale(image.movedim(-1,1), first_image_shape[2], first_image_shape[1], "bilinear", "center").movedim(1,-1))
|
||||
else:
|
||||
resized_images.append(image)
|
||||
# batch the images in the format [b, h, w, c]
|
||||
return torch.cat(resized_images, dim=0)
|
||||
|
||||
def batch_masks(masks: list[torch.Tensor]) -> torch.Tensor | None:
|
||||
if len(masks) == 0:
|
||||
return None
|
||||
# resize all masks to be the same size as the first mask
|
||||
resized_masks: list[torch.Tensor] = []
|
||||
first_mask_shape = masks[0].shape
|
||||
for mask in masks:
|
||||
if mask.shape[1:] != first_mask_shape[1:]:
|
||||
mask = init_image_mask_input(mask, is_type_image=False)
|
||||
mask = comfy.utils.common_upscale(mask, first_mask_shape[2], first_mask_shape[1], "bilinear", "center")
|
||||
resized_masks.append(finalize_image_mask_input(mask, is_type_image=False))
|
||||
else:
|
||||
resized_masks.append(mask)
|
||||
# batch the masks in the format [b, h, w]
|
||||
return torch.cat(resized_masks, dim=0)
|
||||
|
||||
def batch_latents(latents: list[dict[str, torch.Tensor]]) -> dict[str, torch.Tensor] | None:
|
||||
if len(latents) == 0:
|
||||
return None
|
||||
samples_out = latents[0].copy()
|
||||
samples_out["batch_index"] = []
|
||||
first_samples = latents[0]["samples"]
|
||||
tensors: list[torch.Tensor] = []
|
||||
for latent in latents:
|
||||
# first, deal with latent tensors
|
||||
tensors.append(reshape_latent_to(first_samples.shape, latent["samples"], repeat_batch=False))
|
||||
# next, deal with batch_index
|
||||
samples_out["batch_index"].extend(latent.get("batch_index", [x for x in range(0, latent["samples"].shape[0])]))
|
||||
samples_out["samples"] = torch.cat(tensors, dim=0)
|
||||
return samples_out
|
||||
|
||||
class BatchImagesNode(io.ComfyNode):
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
autogrow_template = io.Autogrow.TemplatePrefix(io.Image.Input("image"), prefix="image", min=1, max=50)
|
||||
return io.Schema(
|
||||
node_id="BatchImagesNode",
|
||||
display_name="Batch Images",
|
||||
category="image/batch",
|
||||
essentials_category="Image Tools",
|
||||
search_aliases=["batch", "image batch", "batch images", "combine images", "merge images", "stack images"],
|
||||
inputs=[
|
||||
io.Autogrow.Input("images", template=autogrow_template)
|
||||
],
|
||||
outputs=[
|
||||
io.Image.Output()
|
||||
]
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, images: io.Autogrow.Type) -> io.NodeOutput:
|
||||
return io.NodeOutput(batch_images(list(images.values())))
|
||||
|
||||
class BatchMasksNode(io.ComfyNode):
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
autogrow_template = io.Autogrow.TemplatePrefix(io.Mask.Input("mask"), prefix="mask", min=1, max=50)
|
||||
return io.Schema(
|
||||
node_id="BatchMasksNode",
|
||||
search_aliases=["combine masks", "stack masks", "merge masks"],
|
||||
display_name="Batch Masks",
|
||||
category="image/mask",
|
||||
inputs=[
|
||||
io.Autogrow.Input("masks", template=autogrow_template)
|
||||
],
|
||||
outputs=[
|
||||
io.Mask.Output()
|
||||
]
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, masks: io.Autogrow.Type) -> io.NodeOutput:
|
||||
return io.NodeOutput(batch_masks(list(masks.values())))
|
||||
|
||||
class BatchLatentsNode(io.ComfyNode):
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
autogrow_template = io.Autogrow.TemplatePrefix(io.Latent.Input("latent"), prefix="latent", min=1, max=50)
|
||||
return io.Schema(
|
||||
node_id="BatchLatentsNode",
|
||||
search_aliases=["combine latents", "stack latents", "merge latents"],
|
||||
display_name="Batch Latents",
|
||||
category="model/latent/batch",
|
||||
inputs=[
|
||||
io.Autogrow.Input("latents", template=autogrow_template)
|
||||
],
|
||||
outputs=[
|
||||
io.Latent.Output()
|
||||
]
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, latents: io.Autogrow.Type) -> io.NodeOutput:
|
||||
return io.NodeOutput(batch_latents(list(latents.values())))
|
||||
|
||||
class BatchImagesMasksLatentsNode(io.ComfyNode):
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
matchtype_template = io.MatchType.Template("input", allowed_types=[io.Image, io.Mask, io.Latent])
|
||||
autogrow_template = io.Autogrow.TemplatePrefix(
|
||||
io.MatchType.Input("input", matchtype_template),
|
||||
prefix="input", min=1, max=50)
|
||||
return io.Schema(
|
||||
node_id="BatchImagesMasksLatentsNode",
|
||||
search_aliases=["combine batch", "merge batch", "stack inputs"],
|
||||
display_name="Batch Images/Masks/Latents",
|
||||
category="util",
|
||||
inputs=[
|
||||
io.Autogrow.Input("inputs", template=autogrow_template)
|
||||
],
|
||||
outputs=[
|
||||
io.MatchType.Output(id=None, template=matchtype_template)
|
||||
]
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, inputs: io.Autogrow.Type) -> io.NodeOutput:
|
||||
batched = None
|
||||
values = list(inputs.values())
|
||||
# latents
|
||||
if isinstance(values[0], dict):
|
||||
batched = batch_latents(values)
|
||||
# images
|
||||
elif is_image(values[0]):
|
||||
batched = batch_images(values)
|
||||
# masks
|
||||
else:
|
||||
batched = batch_masks(values)
|
||||
return io.NodeOutput(batched)
|
||||
|
||||
|
||||
class ColorTransfer(io.ComfyNode):
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
return io.Schema(
|
||||
node_id="ColorTransfer",
|
||||
display_name="Transfer Color",
|
||||
category="image/filters",
|
||||
description="Match the colors of one image to another using various algorithms.",
|
||||
search_aliases=["color match", "color grading", "color correction", "match colors", "color transform", "mkl", "reinhard", "histogram"],
|
||||
inputs=[
|
||||
io.Image.Input("image_target", tooltip="Image(s) to apply the color transform to."),
|
||||
io.Image.Input("image_ref", tooltip="Reference image(s) to match colors to."),
|
||||
io.Combo.Input("method", options=['reinhard_lab', 'mkl_lab', 'histogram'],),
|
||||
io.DynamicCombo.Input("source_stats",
|
||||
tooltip="per_frame: each frame matched to image_ref individually. uniform: pool stats across all source frames as baseline, match to image_ref. target_frame: use one chosen frame as the baseline for the transform to image_ref, applied uniformly to all frames (preserves relative differences)",
|
||||
options=[
|
||||
io.DynamicCombo.Option("per_frame", []),
|
||||
io.DynamicCombo.Option("uniform", []),
|
||||
io.DynamicCombo.Option("target_frame", [
|
||||
io.Int.Input("target_index", default=0, min=0, max=10000,
|
||||
tooltip="Frame index used as the source baseline for computing the transform to image_ref"),
|
||||
]),
|
||||
]),
|
||||
io.Float.Input("strength", default=1.0, min=0.0, max=10.0, step=0.01),
|
||||
],
|
||||
outputs=[
|
||||
io.Image.Output(display_name="image"),
|
||||
],
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _to_lab(images, i, device):
|
||||
return kornia.color.rgb_to_lab(
|
||||
images[i:i+1].to(device, dtype=torch.float32).permute(0, 3, 1, 2))
|
||||
|
||||
@staticmethod
|
||||
def _pool_stats(images, device, is_reinhard, eps):
|
||||
"""Two-pass pooled mean + std/cov across all frames."""
|
||||
N, C = images.shape[0], images.shape[3]
|
||||
HW = images.shape[1] * images.shape[2]
|
||||
mean = torch.zeros(C, 1, device=device, dtype=torch.float32)
|
||||
for i in range(N):
|
||||
mean += ColorTransfer._to_lab(images, i, device).view(C, -1).mean(dim=-1, keepdim=True)
|
||||
mean /= N
|
||||
acc = torch.zeros(C, 1 if is_reinhard else C, device=device, dtype=torch.float32)
|
||||
for i in range(N):
|
||||
centered = ColorTransfer._to_lab(images, i, device).view(C, -1) - mean
|
||||
if is_reinhard:
|
||||
acc += (centered * centered).mean(dim=-1, keepdim=True)
|
||||
else:
|
||||
acc += centered @ centered.T / HW
|
||||
if is_reinhard:
|
||||
return mean, torch.sqrt(acc / N).clamp_min_(eps)
|
||||
return mean, acc / N
|
||||
|
||||
@staticmethod
|
||||
def _frame_stats(lab_flat, hw, is_reinhard, eps):
|
||||
"""Per-frame mean + std/cov."""
|
||||
mean = lab_flat.mean(dim=-1, keepdim=True)
|
||||
if is_reinhard:
|
||||
return mean, lab_flat.std(dim=-1, keepdim=True, unbiased=False).clamp_min_(eps)
|
||||
centered = lab_flat - mean
|
||||
return mean, centered @ centered.T / hw
|
||||
|
||||
@staticmethod
|
||||
def _mkl_matrix(cov_s, cov_r, eps):
|
||||
"""Compute MKL 3x3 transform matrix from source and ref covariances."""
|
||||
eig_val_s, eig_vec_s = torch.linalg.eigh(cov_s)
|
||||
sqrt_val_s = torch.sqrt(eig_val_s.clamp_min(0)).clamp_min_(eps)
|
||||
|
||||
scaled_V = eig_vec_s * sqrt_val_s.unsqueeze(0)
|
||||
mid = scaled_V.T @ cov_r @ scaled_V
|
||||
eig_val_m, eig_vec_m = torch.linalg.eigh(mid)
|
||||
sqrt_m = torch.sqrt(eig_val_m.clamp_min(0))
|
||||
|
||||
inv_sqrt_s = 1.0 / sqrt_val_s
|
||||
inv_scaled_V = eig_vec_s * inv_sqrt_s.unsqueeze(0)
|
||||
M_half = (eig_vec_m * sqrt_m.unsqueeze(0)) @ eig_vec_m.T
|
||||
return inv_scaled_V @ M_half @ inv_scaled_V.T
|
||||
|
||||
@staticmethod
|
||||
def _histogram_lut(src, ref, bins=256):
|
||||
"""Build per-channel LUT from source and ref histograms. src/ref: (C, HW) in [0,1]."""
|
||||
s_bins = (src * (bins - 1)).long().clamp(0, bins - 1)
|
||||
r_bins = (ref * (bins - 1)).long().clamp(0, bins - 1)
|
||||
s_hist = torch.zeros(src.shape[0], bins, device=src.device, dtype=src.dtype)
|
||||
r_hist = torch.zeros(src.shape[0], bins, device=src.device, dtype=src.dtype)
|
||||
ones_s = torch.ones_like(src)
|
||||
ones_r = torch.ones_like(ref)
|
||||
s_hist.scatter_add_(1, s_bins, ones_s)
|
||||
r_hist.scatter_add_(1, r_bins, ones_r)
|
||||
s_cdf = s_hist.cumsum(1)
|
||||
s_cdf = s_cdf / s_cdf[:, -1:]
|
||||
r_cdf = r_hist.cumsum(1)
|
||||
r_cdf = r_cdf / r_cdf[:, -1:]
|
||||
return torch.searchsorted(r_cdf, s_cdf).clamp_max_(bins - 1).float() / (bins - 1)
|
||||
|
||||
@classmethod
|
||||
def _pooled_cdf(cls, images, device, num_bins=256):
|
||||
"""Build pooled CDF across all frames, one frame at a time."""
|
||||
C = images.shape[3]
|
||||
hist = torch.zeros(C, num_bins, device=device, dtype=torch.float32)
|
||||
for i in range(images.shape[0]):
|
||||
frame = images[i].to(device, dtype=torch.float32).permute(2, 0, 1).reshape(C, -1)
|
||||
bins = (frame * (num_bins - 1)).long().clamp(0, num_bins - 1)
|
||||
hist.scatter_add_(1, bins, torch.ones_like(frame))
|
||||
cdf = hist.cumsum(1)
|
||||
return cdf / cdf[:, -1:]
|
||||
|
||||
@classmethod
|
||||
def _build_histogram_transform(cls, image_target, image_ref, device, stats_mode, target_index, B):
|
||||
"""Build per-frame or uniform LUT transform for histogram mode."""
|
||||
if stats_mode == 'per_frame':
|
||||
return None # LUT computed per-frame in the apply loop
|
||||
|
||||
r_cdf = cls._pooled_cdf(image_ref, device)
|
||||
if stats_mode == 'target_frame':
|
||||
ti = min(target_index, B - 1)
|
||||
s_cdf = cls._pooled_cdf(image_target[ti:ti+1], device)
|
||||
else:
|
||||
s_cdf = cls._pooled_cdf(image_target, device)
|
||||
return torch.searchsorted(r_cdf, s_cdf).clamp_max_(255).float() / 255.0
|
||||
|
||||
@classmethod
|
||||
def _build_lab_transform(cls, image_target, image_ref, device, stats_mode, target_index, is_reinhard):
|
||||
"""Build transform parameters for Lab-based methods. Returns a transform function."""
|
||||
eps = 1e-6
|
||||
B, H, W, C = image_target.shape
|
||||
B_ref = image_ref.shape[0]
|
||||
single_ref = B_ref == 1
|
||||
HW = H * W
|
||||
HW_ref = image_ref.shape[1] * image_ref.shape[2]
|
||||
|
||||
# Precompute ref stats
|
||||
if single_ref or stats_mode in ('uniform', 'target_frame'):
|
||||
ref_mean, ref_sc = cls._pool_stats(image_ref, device, is_reinhard, eps)
|
||||
|
||||
# Uniform/target_frame: precompute single affine transform
|
||||
if stats_mode in ('uniform', 'target_frame'):
|
||||
if stats_mode == 'target_frame':
|
||||
ti = min(target_index, B - 1)
|
||||
s_lab = cls._to_lab(image_target, ti, device).view(C, -1)
|
||||
s_mean, s_sc = cls._frame_stats(s_lab, HW, is_reinhard, eps)
|
||||
else:
|
||||
s_mean, s_sc = cls._pool_stats(image_target, device, is_reinhard, eps)
|
||||
|
||||
if is_reinhard:
|
||||
scale = ref_sc / s_sc
|
||||
offset = ref_mean - scale * s_mean
|
||||
return lambda src_flat, **_: src_flat * scale + offset
|
||||
T = cls._mkl_matrix(s_sc, ref_sc, eps)
|
||||
offset = ref_mean - T @ s_mean
|
||||
return lambda src_flat, **_: T @ src_flat + offset
|
||||
|
||||
# per_frame
|
||||
def per_frame_transform(src_flat, frame_idx):
|
||||
s_mean, s_sc = cls._frame_stats(src_flat, HW, is_reinhard, eps)
|
||||
|
||||
if single_ref:
|
||||
r_mean, r_sc = ref_mean, ref_sc
|
||||
else:
|
||||
ri = min(frame_idx, B_ref - 1)
|
||||
r_mean, r_sc = cls._frame_stats(cls._to_lab(image_ref, ri, device).view(C, -1), HW_ref, is_reinhard, eps)
|
||||
|
||||
centered = src_flat - s_mean
|
||||
if is_reinhard:
|
||||
return centered * (r_sc / s_sc) + r_mean
|
||||
T = cls._mkl_matrix(centered @ centered.T / HW, r_sc, eps)
|
||||
return T @ centered + r_mean
|
||||
|
||||
return per_frame_transform
|
||||
|
||||
@classmethod
|
||||
def execute(cls, image_target, image_ref, method, source_stats, strength=1.0) -> io.NodeOutput:
|
||||
stats_mode = source_stats["source_stats"]
|
||||
target_index = source_stats.get("target_index", 0)
|
||||
|
||||
if strength == 0 or image_ref is None:
|
||||
return io.NodeOutput(image_target)
|
||||
|
||||
device = comfy.model_management.get_torch_device()
|
||||
intermediate_device = comfy.model_management.intermediate_device()
|
||||
intermediate_dtype = comfy.model_management.intermediate_dtype()
|
||||
|
||||
B, H, W, C = image_target.shape
|
||||
B_ref = image_ref.shape[0]
|
||||
pbar = comfy.utils.ProgressBar(B)
|
||||
out = torch.empty(B, H, W, C, device=intermediate_device, dtype=intermediate_dtype)
|
||||
|
||||
if method == 'histogram':
|
||||
uniform_lut = cls._build_histogram_transform(
|
||||
image_target, image_ref, device, stats_mode, target_index, B)
|
||||
|
||||
for i in range(B):
|
||||
src = image_target[i].to(device, dtype=torch.float32).permute(2, 0, 1)
|
||||
src_flat = src.reshape(C, -1)
|
||||
if uniform_lut is not None:
|
||||
lut = uniform_lut
|
||||
else:
|
||||
ri = min(i, B_ref - 1)
|
||||
ref = image_ref[ri].to(device, dtype=torch.float32).permute(2, 0, 1).reshape(C, -1)
|
||||
lut = cls._histogram_lut(src_flat, ref)
|
||||
bin_idx = (src_flat * 255).long().clamp(0, 255)
|
||||
matched = lut.gather(1, bin_idx).view(C, H, W)
|
||||
result = matched if strength == 1.0 else torch.lerp(src, matched, strength)
|
||||
out[i] = result.permute(1, 2, 0).clamp_(0, 1).to(device=intermediate_device, dtype=intermediate_dtype)
|
||||
pbar.update(1)
|
||||
else:
|
||||
transform = cls._build_lab_transform(image_target, image_ref, device, stats_mode, target_index, is_reinhard=method == "reinhard_lab")
|
||||
|
||||
for i in range(B):
|
||||
src_frame = cls._to_lab(image_target, i, device)
|
||||
corrected = transform(src_frame.view(C, -1), frame_idx=i)
|
||||
if strength == 1.0:
|
||||
result = kornia.color.lab_to_rgb(corrected.view(1, C, H, W))
|
||||
else:
|
||||
result = kornia.color.lab_to_rgb(torch.lerp(src_frame, corrected.view(1, C, H, W), strength))
|
||||
out[i] = result.squeeze(0).permute(1, 2, 0).clamp_(0, 1).to(device=intermediate_device, dtype=intermediate_dtype)
|
||||
pbar.update(1)
|
||||
|
||||
return io.NodeOutput(out)
|
||||
|
||||
|
||||
class PostProcessingExtension(ComfyExtension):
|
||||
@override
|
||||
async def get_node_list(self) -> list[type[io.ComfyNode]]:
|
||||
return [
|
||||
Blend,
|
||||
Blur,
|
||||
Quantize,
|
||||
Sharpen,
|
||||
ImageScaleToTotalPixels,
|
||||
ResizeImageMaskNode,
|
||||
BatchImagesNode,
|
||||
BatchMasksNode,
|
||||
BatchLatentsNode,
|
||||
ColorTransfer,
|
||||
# BatchImagesMasksLatentsNode,
|
||||
]
|
||||
|
||||
async def comfy_entrypoint() -> PostProcessingExtension:
|
||||
return PostProcessingExtension()
|
||||
@@ -0,0 +1,589 @@
|
||||
import os
|
||||
import time
|
||||
import mimetypes
|
||||
import logging
|
||||
from typing import Literal, List
|
||||
from collections.abc import Collection
|
||||
|
||||
from comfy.cli_args import args
|
||||
|
||||
supported_pt_extensions: set[str] = {'.ckpt', '.pt', '.pt2', '.bin', '.pth', '.safetensors', '.pkl', '.sft'}
|
||||
|
||||
folder_names_and_paths: dict[str, tuple[list[str], set[str]]] = {}
|
||||
|
||||
# --base-directory - Resets all default paths configured in folder_paths with a new base path
|
||||
if args.base_directory:
|
||||
base_path = os.path.abspath(args.base_directory)
|
||||
else:
|
||||
base_path = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
if args.models_directory:
|
||||
models_dir = os.path.abspath(args.models_directory)
|
||||
else:
|
||||
models_dir = os.path.join(base_path, "models")
|
||||
|
||||
folder_names_and_paths["checkpoints"] = ([os.path.join(models_dir, "checkpoints")], supported_pt_extensions)
|
||||
folder_names_and_paths["configs"] = ([os.path.join(models_dir, "configs")], [".yaml"])
|
||||
|
||||
folder_names_and_paths["loras"] = ([os.path.join(models_dir, "loras")], supported_pt_extensions)
|
||||
folder_names_and_paths["vae"] = ([os.path.join(models_dir, "vae")], supported_pt_extensions)
|
||||
folder_names_and_paths["text_encoders"] = ([os.path.join(models_dir, "text_encoders"), os.path.join(models_dir, "clip")], supported_pt_extensions)
|
||||
folder_names_and_paths["diffusion_models"] = ([os.path.join(models_dir, "unet"), os.path.join(models_dir, "diffusion_models")], supported_pt_extensions)
|
||||
folder_names_and_paths["clip_vision"] = ([os.path.join(models_dir, "clip_vision")], supported_pt_extensions)
|
||||
folder_names_and_paths["style_models"] = ([os.path.join(models_dir, "style_models")], supported_pt_extensions)
|
||||
folder_names_and_paths["embeddings"] = ([os.path.join(models_dir, "embeddings")], supported_pt_extensions)
|
||||
folder_names_and_paths["diffusers"] = ([os.path.join(models_dir, "diffusers")], ["folder"])
|
||||
folder_names_and_paths["vae_approx"] = ([os.path.join(models_dir, "vae_approx")], supported_pt_extensions)
|
||||
|
||||
folder_names_and_paths["controlnet"] = ([os.path.join(models_dir, "controlnet"), os.path.join(models_dir, "t2i_adapter")], supported_pt_extensions)
|
||||
folder_names_and_paths["gligen"] = ([os.path.join(models_dir, "gligen")], supported_pt_extensions)
|
||||
|
||||
folder_names_and_paths["upscale_models"] = ([os.path.join(models_dir, "upscale_models")], supported_pt_extensions)
|
||||
|
||||
folder_names_and_paths["latent_upscale_models"] = ([os.path.join(models_dir, "latent_upscale_models")], supported_pt_extensions)
|
||||
|
||||
folder_names_and_paths["custom_nodes"] = ([os.path.join(base_path, "custom_nodes")], set())
|
||||
|
||||
folder_names_and_paths["datasets"] = ([os.path.join(base_path, "datasets")], set())
|
||||
|
||||
folder_names_and_paths["hypernetworks"] = ([os.path.join(models_dir, "hypernetworks")], supported_pt_extensions)
|
||||
|
||||
folder_names_and_paths["photomaker"] = ([os.path.join(models_dir, "photomaker")], supported_pt_extensions)
|
||||
|
||||
folder_names_and_paths["classifiers"] = ([os.path.join(models_dir, "classifiers")], {""})
|
||||
|
||||
folder_names_and_paths["model_patches"] = ([os.path.join(models_dir, "model_patches")], supported_pt_extensions)
|
||||
|
||||
folder_names_and_paths["audio_encoders"] = ([os.path.join(models_dir, "audio_encoders")], supported_pt_extensions)
|
||||
|
||||
folder_names_and_paths["background_removal"] = ([os.path.join(models_dir, "background_removal")], supported_pt_extensions)
|
||||
|
||||
folder_names_and_paths["frame_interpolation"] = ([os.path.join(models_dir, "frame_interpolation")], supported_pt_extensions)
|
||||
|
||||
folder_names_and_paths["geometry_estimation"] = ([os.path.join(models_dir, "geometry_estimation")], supported_pt_extensions)
|
||||
|
||||
folder_names_and_paths["optical_flow"] = ([os.path.join(models_dir, "optical_flow")], supported_pt_extensions)
|
||||
|
||||
folder_names_and_paths["detection"] = ([os.path.join(models_dir, "detection")], supported_pt_extensions)
|
||||
|
||||
output_directory = os.path.join(base_path, "output")
|
||||
temp_directory = os.path.join(base_path, "temp")
|
||||
input_directory = os.path.join(base_path, "input")
|
||||
user_directory = os.path.join(base_path, "user")
|
||||
|
||||
filename_list_cache: dict[str, tuple[list[str], dict[str, float], float]] = {}
|
||||
|
||||
class CacheHelper:
|
||||
"""
|
||||
Helper class for managing file list cache data.
|
||||
"""
|
||||
def __init__(self):
|
||||
self.cache: dict[str, tuple[list[str], dict[str, float], float]] = {}
|
||||
self.active = False
|
||||
|
||||
def get(self, key: str, default=None) -> tuple[list[str], dict[str, float], float]:
|
||||
if not self.active:
|
||||
return default
|
||||
return self.cache.get(key, default)
|
||||
|
||||
def set(self, key: str, value: tuple[list[str], dict[str, float], float]) -> None:
|
||||
if self.active:
|
||||
self.cache[key] = value
|
||||
|
||||
def clear(self):
|
||||
self.cache.clear()
|
||||
|
||||
def __enter__(self):
|
||||
self.active = True
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
self.active = False
|
||||
self.clear()
|
||||
|
||||
cache_helper = CacheHelper()
|
||||
|
||||
extension_mimetypes_cache = {
|
||||
"webp" : "image",
|
||||
"fbx" : "model",
|
||||
}
|
||||
|
||||
def map_legacy(folder_name: str) -> str:
|
||||
legacy = {"unet": "diffusion_models",
|
||||
"clip": "text_encoders"}
|
||||
return legacy.get(folder_name, folder_name)
|
||||
|
||||
if not os.path.exists(input_directory):
|
||||
try:
|
||||
os.makedirs(input_directory)
|
||||
except:
|
||||
logging.error("Failed to create input directory")
|
||||
|
||||
def set_output_directory(output_dir: str) -> None:
|
||||
global output_directory
|
||||
output_directory = output_dir
|
||||
|
||||
def set_temp_directory(temp_dir: str) -> None:
|
||||
global temp_directory
|
||||
temp_directory = temp_dir
|
||||
|
||||
def set_input_directory(input_dir: str) -> None:
|
||||
global input_directory
|
||||
input_directory = input_dir
|
||||
|
||||
def get_output_directory() -> str:
|
||||
global output_directory
|
||||
return output_directory
|
||||
|
||||
def get_temp_directory() -> str:
|
||||
global temp_directory
|
||||
return temp_directory
|
||||
|
||||
def get_input_directory() -> str:
|
||||
global input_directory
|
||||
return input_directory
|
||||
|
||||
def get_user_directory() -> str:
|
||||
return user_directory
|
||||
|
||||
def set_user_directory(user_dir: str) -> None:
|
||||
global user_directory
|
||||
user_directory = user_dir
|
||||
|
||||
|
||||
# System User Protection - Protects system directories from HTTP endpoint access
|
||||
# System Users are internal-only users that cannot be accessed via HTTP endpoints.
|
||||
# They use the '__' prefix convention (similar to Python's private member convention).
|
||||
SYSTEM_USER_PREFIX = "__"
|
||||
|
||||
|
||||
def get_system_user_directory(name: str = "system") -> str:
|
||||
"""
|
||||
Get the path to a System User directory.
|
||||
|
||||
System User directories (prefixed with '__') are only accessible via internal API,
|
||||
not through HTTP endpoints. Use this for storing system-internal data that
|
||||
should not be exposed to users.
|
||||
|
||||
Args:
|
||||
name: System user name (e.g., "system", "cache"). Must be alphanumeric
|
||||
with underscores allowed, but cannot start with underscore.
|
||||
|
||||
Returns:
|
||||
Absolute path to the system user directory.
|
||||
|
||||
Raises:
|
||||
ValueError: If name is empty, invalid, or starts with underscore.
|
||||
|
||||
Example:
|
||||
>>> get_system_user_directory("cache")
|
||||
'/path/to/user/__cache'
|
||||
"""
|
||||
if not name or not isinstance(name, str):
|
||||
raise ValueError("System user name cannot be empty")
|
||||
if not name.replace("_", "").isalnum():
|
||||
raise ValueError(f"Invalid system user name: '{name}'")
|
||||
if name.startswith("_"):
|
||||
raise ValueError("System user name should not start with underscore")
|
||||
return os.path.join(get_user_directory(), f"{SYSTEM_USER_PREFIX}{name}")
|
||||
|
||||
|
||||
def get_public_user_directory(user_id: str) -> str | None:
|
||||
"""
|
||||
Get the path to a Public User directory for HTTP endpoint access.
|
||||
|
||||
This function provides structural security by returning None for any
|
||||
System User (prefixed with '__'). All HTTP endpoints should use this
|
||||
function instead of directly constructing user paths.
|
||||
|
||||
Args:
|
||||
user_id: User identifier from HTTP request.
|
||||
|
||||
Returns:
|
||||
Absolute path to the user directory, or None if user_id is invalid
|
||||
or refers to a System User.
|
||||
|
||||
Example:
|
||||
>>> get_public_user_directory("default")
|
||||
'/path/to/user/default'
|
||||
>>> get_public_user_directory("__system")
|
||||
None
|
||||
"""
|
||||
if not user_id or not isinstance(user_id, str):
|
||||
return None
|
||||
if user_id.startswith(SYSTEM_USER_PREFIX):
|
||||
return None
|
||||
return os.path.join(get_user_directory(), user_id)
|
||||
|
||||
|
||||
#NOTE: used in http server so don't put folders that should not be accessed remotely
|
||||
def get_directory_by_type(type_name: str) -> str | None:
|
||||
if type_name == "output":
|
||||
return get_output_directory()
|
||||
if type_name == "temp":
|
||||
return get_temp_directory()
|
||||
if type_name == "input":
|
||||
return get_input_directory()
|
||||
return None
|
||||
|
||||
def filter_files_content_types(files: list[str], content_types: List[Literal["image", "video", "audio", "model"]]) -> list[str]:
|
||||
"""
|
||||
Example:
|
||||
files = os.listdir(folder_paths.get_input_directory())
|
||||
videos = filter_files_content_types(files, ["video"])
|
||||
|
||||
Note:
|
||||
- 'model' in MIME context refers to 3D models, not files containing trained weights and parameters
|
||||
"""
|
||||
global extension_mimetypes_cache
|
||||
result = []
|
||||
for file in files:
|
||||
extension = file.split('.')[-1]
|
||||
if extension not in extension_mimetypes_cache:
|
||||
mime_type, _ = mimetypes.guess_type(file, strict=False)
|
||||
if not mime_type:
|
||||
continue
|
||||
content_type = mime_type.split('/')[0]
|
||||
extension_mimetypes_cache[extension] = content_type
|
||||
else:
|
||||
content_type = extension_mimetypes_cache[extension]
|
||||
|
||||
if content_type in content_types:
|
||||
result.append(file)
|
||||
return result
|
||||
|
||||
# determine base_dir rely on annotation if name is 'filename.ext [annotation]' format
|
||||
# otherwise use default_path as base_dir
|
||||
def annotated_filepath(name: str) -> tuple[str, str | None]:
|
||||
if name.endswith("[output]"):
|
||||
base_dir = get_output_directory()
|
||||
name = name[:-9]
|
||||
elif name.endswith("[input]"):
|
||||
base_dir = get_input_directory()
|
||||
name = name[:-8]
|
||||
elif name.endswith("[temp]"):
|
||||
base_dir = get_temp_directory()
|
||||
name = name[:-7]
|
||||
else:
|
||||
return name, None
|
||||
|
||||
return name, base_dir
|
||||
|
||||
|
||||
# Content types a browser may execute or render inline. File endpoints that
|
||||
# serve user-controlled content must force these to download (and ideally set
|
||||
# Content-Disposition: attachment) to avoid stored XSS. Centralised here so the
|
||||
# /view and /userdata handlers can't drift apart. mimetypes.guess_type may
|
||||
# return either the text/* or application/* spelling depending on platform, so
|
||||
# both are listed.
|
||||
DANGEROUS_CONTENT_TYPES = {
|
||||
'text/html', 'text/html-sandboxed', 'application/xhtml+xml',
|
||||
'text/javascript', 'application/javascript', 'application/x-javascript',
|
||||
'application/ecmascript', 'text/css',
|
||||
'image/svg+xml', 'application/xml', 'text/xml',
|
||||
# message/rfc822 (.mht/.mhtml) can carry script in some browsers.
|
||||
'message/rfc822',
|
||||
}
|
||||
|
||||
|
||||
def is_dangerous_content_type(content_type: str | None) -> bool:
|
||||
"""Return True if a browser may execute or render `content_type` inline.
|
||||
|
||||
Normalises before matching so the check can't be slipped past with a
|
||||
charset/boundary parameter (``text/html; charset=utf-8``) or casing
|
||||
(``TEXT/HTML``). Any XML dialect (``*+xml`` or ``*/xml``) is treated as
|
||||
dangerous because XML can carry inline script via stylesheet/entity tricks,
|
||||
which also covers the ``application/{xslt,rss,atom,rdf}+xml`` family without
|
||||
enumerating each one. Endpoints serving user-controlled content should route
|
||||
a dangerous type to ``application/octet-stream`` + ``Content-Disposition:
|
||||
attachment`` + ``X-Content-Type-Options: nosniff``.
|
||||
"""
|
||||
if not content_type:
|
||||
return False
|
||||
normalized = content_type.split(';', 1)[0].strip().lower()
|
||||
if normalized in DANGEROUS_CONTENT_TYPES:
|
||||
return True
|
||||
return normalized.endswith('+xml') or normalized.endswith('/xml')
|
||||
|
||||
|
||||
def renders_safely_as_image(content_type: str | None, sec_fetch_dest: str | None) -> bool:
|
||||
"""Return True if a dangerous `content_type` is safe to serve inline anyway.
|
||||
|
||||
An SVG referenced by an ``<img>`` is loaded in secure static mode: scripts
|
||||
and external references are disabled, so the stored XSS that
|
||||
``is_dangerous_content_type`` guards against cannot fire. The attack needs
|
||||
the SVG to become a document, which is a separate ``Sec-Fetch-Dest``.
|
||||
Browsers set that header themselves and script cannot override it (the
|
||||
``Sec-`` prefix makes it a forbidden header name), so it is trustworthy for
|
||||
this decision. Anything else, including a missing header from a non-browser
|
||||
client or a proxy that strips it, fails closed.
|
||||
"""
|
||||
if sec_fetch_dest != 'image':
|
||||
return False
|
||||
return (content_type or '').split(';', 1)[0].strip().lower() == 'image/svg+xml'
|
||||
|
||||
|
||||
def is_within_directory(directory: str, target: str) -> bool:
|
||||
"""Return True if `target` resolves to a path inside `directory`.
|
||||
|
||||
Uses realpath on both operands so that a symlink placed inside `directory`
|
||||
that points elsewhere cannot escape the containment check at open time.
|
||||
"""
|
||||
try:
|
||||
directory = os.path.realpath(directory)
|
||||
target = os.path.realpath(target)
|
||||
return os.path.commonpath((directory, target)) == directory
|
||||
except ValueError:
|
||||
# ValueError is raised by realpath() on a path with an embedded null
|
||||
# byte, and by commonpath() on Windows when the paths are on different
|
||||
# drives. In either case the target is not safely within the directory.
|
||||
return False
|
||||
|
||||
|
||||
def get_annotated_filepath(name: str, default_dir: str | None=None) -> str:
|
||||
name, base_dir = annotated_filepath(name)
|
||||
|
||||
if base_dir is None:
|
||||
if default_dir is not None:
|
||||
base_dir = default_dir
|
||||
else:
|
||||
base_dir = get_input_directory() # fallback path
|
||||
|
||||
filepath = os.path.abspath(os.path.join(base_dir, name))
|
||||
# Prevent path traversal: the resolved path must stay within base_dir.
|
||||
# repr() the name in the message so a crafted value can't inject log lines.
|
||||
if not is_within_directory(base_dir, filepath):
|
||||
raise ValueError("Invalid file path: {!r}".format(name))
|
||||
return filepath
|
||||
|
||||
|
||||
def exists_annotated_filepath(name) -> bool:
|
||||
name, base_dir = annotated_filepath(name)
|
||||
|
||||
if base_dir is None:
|
||||
base_dir = get_input_directory() # fallback path
|
||||
|
||||
filepath = os.path.abspath(os.path.join(base_dir, name))
|
||||
# Treat traversal attempts as non-existent rather than probing the filesystem.
|
||||
if not is_within_directory(base_dir, filepath):
|
||||
return False
|
||||
return os.path.exists(filepath)
|
||||
|
||||
|
||||
def add_model_folder_path(folder_name: str, full_folder_path: str, is_default: bool = False) -> None:
|
||||
global folder_names_and_paths
|
||||
folder_name = map_legacy(folder_name)
|
||||
if folder_name in folder_names_and_paths:
|
||||
paths, _exts = folder_names_and_paths[folder_name]
|
||||
if full_folder_path in paths:
|
||||
if is_default and paths[0] != full_folder_path:
|
||||
# If the path to the folder is not the first in the list, move it to the beginning.
|
||||
paths.remove(full_folder_path)
|
||||
paths.insert(0, full_folder_path)
|
||||
else:
|
||||
if is_default:
|
||||
paths.insert(0, full_folder_path)
|
||||
else:
|
||||
paths.append(full_folder_path)
|
||||
else:
|
||||
folder_names_and_paths[folder_name] = ([full_folder_path], set())
|
||||
|
||||
def get_folder_paths(folder_name: str) -> list[str]:
|
||||
folder_name = map_legacy(folder_name)
|
||||
return folder_names_and_paths[folder_name][0][:]
|
||||
|
||||
def recursive_search(directory: str, excluded_dir_names: list[str] | None=None) -> tuple[list[str], dict[str, float]]:
|
||||
if not os.path.isdir(directory):
|
||||
return [], {}
|
||||
|
||||
if excluded_dir_names is None:
|
||||
excluded_dir_names = []
|
||||
|
||||
result = []
|
||||
dirs = {}
|
||||
|
||||
# Attempt to add the initial directory to dirs with error handling
|
||||
try:
|
||||
dirs[directory] = os.path.getmtime(directory)
|
||||
except FileNotFoundError:
|
||||
logging.warning(f"Warning: Unable to access {directory}. Skipping this path.")
|
||||
|
||||
logging.debug("recursive file list on directory {}".format(directory))
|
||||
dirpath: str
|
||||
subdirs: list[str]
|
||||
filenames: list[str]
|
||||
|
||||
for dirpath, subdirs, filenames in os.walk(directory, followlinks=True, topdown=True):
|
||||
subdirs[:] = [d for d in subdirs if d not in excluded_dir_names]
|
||||
for file_name in filenames:
|
||||
try:
|
||||
relative_path = os.path.relpath(os.path.join(dirpath, file_name), directory)
|
||||
result.append(relative_path)
|
||||
except:
|
||||
logging.warning(f"Warning: Unable to access {file_name}. Skipping this file.")
|
||||
continue
|
||||
|
||||
for d in subdirs:
|
||||
path: str = os.path.join(dirpath, d)
|
||||
try:
|
||||
dirs[path] = os.path.getmtime(path)
|
||||
except FileNotFoundError:
|
||||
logging.warning(f"Warning: Unable to access {path}. Skipping this path.")
|
||||
continue
|
||||
logging.debug("found {} files".format(len(result)))
|
||||
return result, dirs
|
||||
|
||||
def filter_files_extensions(files: Collection[str], extensions: Collection[str]) -> list[str]:
|
||||
return sorted(list(filter(lambda a: os.path.splitext(a)[-1].lower() in extensions or len(extensions) == 0, files)))
|
||||
|
||||
|
||||
|
||||
def get_full_path(folder_name: str, filename: str) -> str | None:
|
||||
"""
|
||||
Get the full path of a file in a folder, has to be a file
|
||||
"""
|
||||
global folder_names_and_paths
|
||||
folder_name = map_legacy(folder_name)
|
||||
if folder_name not in folder_names_and_paths:
|
||||
return None
|
||||
folders = folder_names_and_paths[folder_name]
|
||||
filename = os.path.relpath(os.path.join("/", filename), "/")
|
||||
for x in folders[0]:
|
||||
full_path = os.path.join(x, filename)
|
||||
if os.path.isfile(full_path):
|
||||
return full_path
|
||||
elif os.path.islink(full_path):
|
||||
logging.warning("WARNING path {} exists but doesn't link anywhere, skipping.".format(full_path))
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def get_full_path_or_raise(folder_name: str, filename: str) -> str:
|
||||
"""
|
||||
Get the full path of a file in a folder, has to be a file
|
||||
"""
|
||||
full_path = get_full_path(folder_name, filename)
|
||||
if full_path is None:
|
||||
raise FileNotFoundError(f"Model in folder '{folder_name}' with filename '{filename}' not found.")
|
||||
return full_path
|
||||
|
||||
|
||||
def get_filename_list_(folder_name: str) -> tuple[list[str], dict[str, float], float]:
|
||||
folder_name = map_legacy(folder_name)
|
||||
global folder_names_and_paths
|
||||
output_list = set()
|
||||
folders = folder_names_and_paths[folder_name]
|
||||
output_folders = {}
|
||||
for x in folders[0]:
|
||||
files, folders_all = recursive_search(x, excluded_dir_names=[".git"])
|
||||
output_list.update(filter_files_extensions(files, folders[1]))
|
||||
output_folders = {**output_folders, **folders_all}
|
||||
|
||||
return sorted(list(output_list)), output_folders, time.perf_counter()
|
||||
|
||||
def cached_filename_list_(folder_name: str) -> tuple[list[str], dict[str, float], float] | None:
|
||||
strong_cache = cache_helper.get(folder_name)
|
||||
if strong_cache is not None:
|
||||
return strong_cache
|
||||
|
||||
global filename_list_cache
|
||||
global folder_names_and_paths
|
||||
folder_name = map_legacy(folder_name)
|
||||
if folder_name not in filename_list_cache:
|
||||
return None
|
||||
out = filename_list_cache[folder_name]
|
||||
|
||||
for x in out[1]:
|
||||
time_modified = out[1][x]
|
||||
folder = x
|
||||
if os.path.getmtime(folder) != time_modified:
|
||||
return None
|
||||
|
||||
folders = folder_names_and_paths[folder_name]
|
||||
for x in folders[0]:
|
||||
if os.path.isdir(x):
|
||||
if x not in out[1]:
|
||||
return None
|
||||
|
||||
return out
|
||||
|
||||
def get_filename_list(folder_name: str) -> list[str]:
|
||||
folder_name = map_legacy(folder_name)
|
||||
out = cached_filename_list_(folder_name)
|
||||
if out is None:
|
||||
out = get_filename_list_(folder_name)
|
||||
global filename_list_cache
|
||||
filename_list_cache[folder_name] = out
|
||||
cache_helper.set(folder_name, out)
|
||||
return list(out[0])
|
||||
|
||||
def get_save_image_path(filename_prefix: str, output_dir: str, image_width=0, image_height=0) -> tuple[str, str, int, str, str]:
|
||||
def map_filename(filename: str) -> tuple[int, str]:
|
||||
prefix_len = len(os.path.basename(filename_prefix))
|
||||
prefix = filename[:prefix_len + 1]
|
||||
try:
|
||||
remainder = filename[prefix_len + 1:]
|
||||
base_remainder = remainder.split('.')[0]
|
||||
digits = int(base_remainder.split('_')[0])
|
||||
except:
|
||||
digits = 0
|
||||
return digits, prefix
|
||||
|
||||
def compute_vars(input: str, image_width: int, image_height: int) -> str:
|
||||
input = input.replace("%width%", str(image_width))
|
||||
input = input.replace("%height%", str(image_height))
|
||||
now = time.localtime()
|
||||
input = input.replace("%year%", str(now.tm_year))
|
||||
input = input.replace("%month%", str(now.tm_mon).zfill(2))
|
||||
input = input.replace("%day%", str(now.tm_mday).zfill(2))
|
||||
input = input.replace("%hour%", str(now.tm_hour).zfill(2))
|
||||
input = input.replace("%minute%", str(now.tm_min).zfill(2))
|
||||
input = input.replace("%second%", str(now.tm_sec).zfill(2))
|
||||
return input
|
||||
|
||||
if "%" in filename_prefix:
|
||||
filename_prefix = compute_vars(filename_prefix, image_width, image_height)
|
||||
|
||||
subfolder = os.path.dirname(os.path.normpath(filename_prefix))
|
||||
filename = os.path.basename(os.path.normpath(filename_prefix))
|
||||
|
||||
full_output_folder = os.path.join(output_dir, subfolder)
|
||||
|
||||
if not is_within_directory(output_dir, full_output_folder):
|
||||
err = "**** ERROR: Saving image outside the output folder is not allowed." + \
|
||||
"\n full_output_folder: " + os.path.abspath(full_output_folder) + \
|
||||
"\n output_dir: " + output_dir
|
||||
logging.error(err)
|
||||
raise Exception(err)
|
||||
|
||||
try:
|
||||
counter = max(filter(lambda a: os.path.normcase(a[1][:-1]) == os.path.normcase(filename) and a[1][-1] == "_", map(map_filename, os.listdir(full_output_folder))))[0] + 1
|
||||
except ValueError:
|
||||
counter = 1
|
||||
except FileNotFoundError:
|
||||
os.makedirs(full_output_folder, exist_ok=True)
|
||||
counter = 1
|
||||
return full_output_folder, filename, counter, subfolder, filename_prefix
|
||||
|
||||
def get_input_subfolders() -> list[str]:
|
||||
"""Returns a list of all subfolder paths in the input directory, recursively.
|
||||
|
||||
Returns:
|
||||
List of folder paths relative to the input directory, excluding the root directory
|
||||
"""
|
||||
input_dir = get_input_directory()
|
||||
folders = []
|
||||
|
||||
try:
|
||||
if not os.path.exists(input_dir):
|
||||
return []
|
||||
|
||||
for root, dirs, _ in os.walk(input_dir):
|
||||
rel_path = os.path.relpath(root, input_dir)
|
||||
if rel_path != ".": # Only include non-root directories
|
||||
# Normalize path separators to forward slashes
|
||||
folders.append(rel_path.replace(os.sep, '/'))
|
||||
|
||||
return sorted(folders)
|
||||
except FileNotFoundError:
|
||||
return []
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
||||
tree 8e78753b31d405a4f33293106845998ba121f89c
|
||||
parent 2bc93c7a02c57fd1da10f94aa7331d396962d123
|
||||
author Comfy Org PR Bot <snomiao+comfy-pr@gmail.com> 1788659320 +0900
|
||||
committer GitHub <noreply@github.com> 1788659320 +0900
|
||||
gpgsig -----BEGIN PGP SIGNATURE-----
|
||||
|
||||
wsFcBAABCAAQBQJqnMZ4CRC1aQ7uu5UhlAAAm9gQABUFtBV6SWr2GzsRpGiIdsAS
|
||||
I9a+exaXQI1PY49OkqCMyNRyPm8LdBlND21DlvVpgOeV578pSp9vS7Z0GgLhi0Gv
|
||||
715KHc3aJJtBHtDGarlMhVcNLjvO6nRltKJzpXFASOTnquWsm/deeiEhH4GiY5MO
|
||||
0jf69Wl4CGiyNwznNkHRielUXPvcsyqNlGgS0M8JAkRoRap+Mmj+PPis0gY0doFR
|
||||
vA25sgPMTDmraJ+UP5kKvTlv3w1+trqK1j6Gn/SMfk+B88jrWd1DWmxY3O5uIoxg
|
||||
VBGM5jWZAWDRr1A0AW4AnwhypC+xlg5DN/iCx5E3oRNN3dQb7EYfvMAUsiokiJdH
|
||||
lhRam541TdgsUM8PecLI4e6MYr99l36p8JDhQiWVb18G1tNZPmNe8QK8qoto2VTW
|
||||
XaL9aHKh5RFGRmc9SG0CYEK+ukHDxHz0kA6KeAt0m6/lgaEwjBirUHLVD/zULdv0
|
||||
7+Av7iWO8W21/1s1DQPXMD/urDyIG2pHT9JYWp23dtEQTX5e0J1r6uZ5wFgkP/QC
|
||||
/58em5cdV0KYqSN1D5VB48i1NzNGIcvWT7izl5RRESEbnPSgkCItvZGeB3mGqvLI
|
||||
/dxojv3NCYfR68zn/Ik8mmf5B/h1ll5oddm82t+hHZVjbIZ7MMP/jJbPliwZk2hV
|
||||
yku6oDPdT0NUAcpxchgz
|
||||
=k7Qe
|
||||
-----END PGP SIGNATURE-----
|
||||
|
||||
|
||||
1.52.7 (#17090)
|
||||
|
||||
Patch version increment to 1.52.7
|
||||
|
||||
**Base branch:** `core/1.52`
|
||||
|
||||
---------
|
||||
|
||||
Co-authored-by: comfy-pr-bot <172744619+comfy-pr-bot@users.noreply.github.com>
|
||||
Co-authored-by: github-actions <github-actions@github.com>
|
||||
@@ -0,0 +1 @@
|
||||
1a7a6b82514874545dc5e8203d0bd2188c2d9b18 refs/tags/v1.52.7
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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,630 @@
|
||||
import { remove } from 'es-toolkit'
|
||||
import { shallowReactive } from 'vue'
|
||||
|
||||
import { useChainCallback } from '@/composables/functional/useChainCallback'
|
||||
import type {
|
||||
ISlotType,
|
||||
INodeInputSlot,
|
||||
INodeOutputSlot
|
||||
} from '@/lib/litegraph/src/interfaces'
|
||||
import type { LGraphNode } from '@/lib/litegraph/src/LGraphNode'
|
||||
import { LiteGraph } from '@/lib/litegraph/src/litegraph'
|
||||
import type { LLink } from '@/lib/litegraph/src/LLink'
|
||||
import { commonType } from '@/lib/litegraph/src/utils/type'
|
||||
import { resolveNodeRootGraphId } from '@/lib/litegraph/src/utils/widget'
|
||||
import { transformInputSpecV1ToV2 } from '@/schemas/nodeDef/migration'
|
||||
import type { ComboInputSpec, InputSpec } from '@/schemas/nodeDefSchema'
|
||||
import type { InputSpec as InputSpecV2 } from '@/schemas/nodeDef/nodeDefSchemaV2'
|
||||
import {
|
||||
zAutogrowOptions,
|
||||
zDynamicComboInputSpec,
|
||||
zMatchTypeOptions
|
||||
} from '@/schemas/nodeDefSchema'
|
||||
import { useLitegraphService } from '@/services/litegraphService'
|
||||
import { app } from '@/scripts/app'
|
||||
import type { ComfyApp } from '@/scripts/app'
|
||||
import { useWidgetValueStore } from '@/stores/widgetValueStore'
|
||||
import { widgetId } from '@/types/widgetId'
|
||||
|
||||
const INLINE_INPUTS = false
|
||||
|
||||
type MatchTypeNode = LGraphNode &
|
||||
Pick<Required<LGraphNode>, 'onConnectionsChange'> & {
|
||||
comfyDynamic: { matchType: Record<string, Record<string, string>> }
|
||||
}
|
||||
type AutogrowNode = LGraphNode &
|
||||
Pick<Required<LGraphNode>, 'onConnectionsChange' | 'widgets'> & {
|
||||
comfyDynamic: {
|
||||
autogrow: Record<
|
||||
string,
|
||||
{
|
||||
min: number
|
||||
max: number
|
||||
inputSpecs: InputSpecV2[]
|
||||
prefix?: string
|
||||
names?: string[]
|
||||
}
|
||||
>
|
||||
}
|
||||
}
|
||||
|
||||
function ensureWidgetForInput(node: LGraphNode, input: INodeInputSlot) {
|
||||
node.widgets ??= []
|
||||
const { widget } = input
|
||||
if (widget && node.widgets.some((w) => w.name === widget.name)) return
|
||||
node.widgets.push({
|
||||
draw(ctx, _n, _w, y) {
|
||||
ctx.save()
|
||||
ctx.fillStyle = LiteGraph.NODE_TEXT_COLOR
|
||||
ctx.fillText(input.label ?? input.name, 20, y + 15)
|
||||
ctx.restore()
|
||||
},
|
||||
name: input.name,
|
||||
options: {},
|
||||
serialize: false,
|
||||
type: 'shim',
|
||||
y: 0
|
||||
})
|
||||
input.alwaysVisible = true
|
||||
input.widget = { name: input.name }
|
||||
}
|
||||
|
||||
function dynamicComboWidget(
|
||||
node: LGraphNode,
|
||||
inputName: string,
|
||||
untypedInputData: InputSpec,
|
||||
appArg: ComfyApp,
|
||||
widgetName?: string
|
||||
) {
|
||||
const { addNodeInput } = useLitegraphService()
|
||||
const { deleteWidget } = useWidgetValueStore()
|
||||
const parseResult = zDynamicComboInputSpec.safeParse(untypedInputData)
|
||||
if (!parseResult.success) throw new Error('invalid DynamicCombo spec')
|
||||
const inputData = parseResult.data
|
||||
const options = Object.fromEntries(
|
||||
inputData[1].options.map(({ key, inputs }) => [key, inputs])
|
||||
)
|
||||
const subSpec: ComboInputSpec = [Object.keys(options), {}]
|
||||
const { widget, minWidth, minHeight } = app.widgets['COMBO'](
|
||||
node,
|
||||
inputName,
|
||||
subSpec,
|
||||
appArg,
|
||||
widgetName
|
||||
)
|
||||
function isInGroup(e: { name: string }): boolean {
|
||||
return e.name.startsWith(inputName + '.')
|
||||
}
|
||||
const updateWidgets = (value?: string) => {
|
||||
if (!node.widgets) throw new Error('Not Reachable')
|
||||
const newSpec = value ? options[value] : undefined
|
||||
|
||||
const removedInputs = remove(node.inputs, isInGroup)
|
||||
for (const widget of remove(node.widgets, isInGroup)) {
|
||||
widget.onRemove?.()
|
||||
if (widget.widgetId) deleteWidget(widget.widgetId)
|
||||
}
|
||||
|
||||
if (!newSpec) return
|
||||
|
||||
const insertionPoint = node.widgets.findIndex((w) => w === widget) + 1
|
||||
const startingLength = node.widgets.length
|
||||
const startingInputLength = node.inputs.length
|
||||
|
||||
if (insertionPoint === 0)
|
||||
throw new Error("Dynamic widget doesn't exist on node")
|
||||
const inputTypes: (Record<string, InputSpec> | undefined)[] = [
|
||||
newSpec.required,
|
||||
newSpec.optional
|
||||
]
|
||||
inputTypes.forEach((inputType, idx) => {
|
||||
for (const key in inputType ?? {}) {
|
||||
const name = `${widget.name}.${key}`
|
||||
const specToAdd = transformInputSpecV1ToV2(inputType![key], {
|
||||
name,
|
||||
isOptional: idx !== 0
|
||||
})
|
||||
specToAdd.display_name = key
|
||||
addNodeInput(node, specToAdd)
|
||||
const newInputs = node.inputs
|
||||
.slice(startingInputLength)
|
||||
.filter((inp) => inp.name.startsWith(name))
|
||||
for (const newInput of newInputs) {
|
||||
if (INLINE_INPUTS && !newInput.widget)
|
||||
ensureWidgetForInput(node, newInput)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const inputInsertionPoint =
|
||||
node.inputs.findIndex((i) => i.name === widget.name) + 1
|
||||
const addedWidgets = node.widgets.splice(startingLength)
|
||||
node.widgets.splice(insertionPoint, 0, ...addedWidgets)
|
||||
if (inputInsertionPoint === 0) {
|
||||
if (
|
||||
addedWidgets.length === 0 &&
|
||||
node.inputs.length !== startingInputLength
|
||||
)
|
||||
//input is inputOnly, but lacks an insertion point
|
||||
throw new Error('Failed to find input socket for ' + widget.name)
|
||||
return
|
||||
}
|
||||
const addedInputs = spliceInputs(node, startingInputLength).map(
|
||||
(addedInput) => {
|
||||
const existingInput = node.inputs.findIndex(
|
||||
(existingInput) => addedInput.name === existingInput.name
|
||||
)
|
||||
return existingInput === -1
|
||||
? addedInput
|
||||
: spliceInputs(node, existingInput, 1)[0]
|
||||
}
|
||||
)
|
||||
//assume existing inputs are in correct order
|
||||
spliceInputs(node, inputInsertionPoint, 0, ...addedInputs)
|
||||
|
||||
for (const input of removedInputs) {
|
||||
const inputIndex = node.inputs.findIndex((inp) => inp.name === input.name)
|
||||
if (inputIndex === -1) {
|
||||
node.inputs.push(input)
|
||||
node.removeInput(node.inputs.length - 1)
|
||||
} else {
|
||||
node.inputs[inputIndex].link = input.link
|
||||
if (!input.link) continue
|
||||
const link = node.graph?.links?.[input.link]
|
||||
if (!link) continue
|
||||
link.target_slot = inputIndex
|
||||
node.onConnectionsChange?.(
|
||||
LiteGraph.INPUT,
|
||||
inputIndex,
|
||||
true,
|
||||
link,
|
||||
node.inputs[inputIndex]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
node.size[1] = node.computeSize([...node.size])[1]
|
||||
if (!node.graph) return
|
||||
node._setConcreteSlots()
|
||||
node.arrange()
|
||||
app.canvas?.setDirty(true, true)
|
||||
}
|
||||
//A little hacky, but onConfigure won't work.
|
||||
//It fires too late and is overly disruptive
|
||||
let widgetValue = widget.value
|
||||
const getState = () => {
|
||||
const graphId = resolveNodeRootGraphId(node)
|
||||
if (!graphId) return undefined
|
||||
return useWidgetValueStore().getWidget(
|
||||
widgetId(graphId, node.id, widget.name)
|
||||
)
|
||||
}
|
||||
Object.defineProperty(widget, 'value', {
|
||||
get() {
|
||||
return getState()?.value ?? widgetValue
|
||||
},
|
||||
set(value) {
|
||||
const state = getState()
|
||||
if (state) state.value = value
|
||||
widgetValue = value
|
||||
updateWidgets(value)
|
||||
}
|
||||
})
|
||||
widget.value = widgetValue
|
||||
return { widget, minWidth, minHeight }
|
||||
}
|
||||
|
||||
export const dynamicWidgets = { COMFY_DYNAMICCOMBO_V3: dynamicComboWidget }
|
||||
const dynamicInputs: Record<
|
||||
string,
|
||||
(node: LGraphNode, inputSpec: InputSpecV2) => void
|
||||
> = {
|
||||
COMFY_AUTOGROW_V3: applyAutogrow,
|
||||
COMFY_MATCHTYPE_V3: applyMatchType
|
||||
}
|
||||
|
||||
export function applyDynamicInputs(
|
||||
node: LGraphNode,
|
||||
inputSpec: InputSpecV2
|
||||
): boolean {
|
||||
if (!(inputSpec.type in dynamicInputs)) return false
|
||||
//TODO: move parsing/validation of inputSpec here?
|
||||
dynamicInputs[inputSpec.type](node, inputSpec)
|
||||
return true
|
||||
}
|
||||
|
||||
function spliceInputs(
|
||||
node: LGraphNode,
|
||||
startIndex: number,
|
||||
deleteCount = -1,
|
||||
...toAdd: INodeInputSlot[]
|
||||
): INodeInputSlot[] {
|
||||
if (deleteCount < 0) return node.inputs.splice(startIndex)
|
||||
const ret = node.inputs.splice(startIndex, deleteCount, ...toAdd)
|
||||
node.inputs.slice(startIndex).forEach((input, index) => {
|
||||
const link = input.link && node.graph?.links?.get(input.link)
|
||||
if (link) link.target_slot = startIndex + index
|
||||
})
|
||||
return ret
|
||||
}
|
||||
|
||||
function changeOutputType(
|
||||
node: LGraphNode,
|
||||
output: INodeOutputSlot,
|
||||
combinedType: ISlotType
|
||||
) {
|
||||
if (output.type === combinedType) return
|
||||
output.type = combinedType
|
||||
|
||||
//check and potentially remove links
|
||||
if (!node.graph) return
|
||||
for (const link_id of output.links ?? []) {
|
||||
const link = node.graph.links[link_id]
|
||||
if (!link) continue
|
||||
const { input, inputNode, subgraphOutput } = link.resolve(node.graph)
|
||||
const inputType = (input ?? subgraphOutput)?.type
|
||||
if (!inputType) continue
|
||||
const keep = LiteGraph.isValidConnection(combinedType, inputType)
|
||||
if (!keep && subgraphOutput) subgraphOutput.disconnect()
|
||||
else if (!keep && inputNode) inputNode.disconnectInput(link.target_slot)
|
||||
if (input && inputNode?.onConnectionsChange)
|
||||
inputNode.onConnectionsChange(
|
||||
LiteGraph.INPUT,
|
||||
link.target_slot,
|
||||
keep,
|
||||
link,
|
||||
input
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
function withComfyMatchType(node: LGraphNode): asserts node is MatchTypeNode {
|
||||
if (node.comfyDynamic?.matchType) return
|
||||
node.comfyDynamic ??= {}
|
||||
node.comfyDynamic.matchType = {}
|
||||
|
||||
const outputGroups = node.constructor.nodeData?.output_matchtypes
|
||||
node.onConnectionsChange = useChainCallback(
|
||||
node.onConnectionsChange,
|
||||
function (
|
||||
this: MatchTypeNode,
|
||||
contype: ISlotType,
|
||||
slot: number,
|
||||
iscon: boolean,
|
||||
linf: LLink | null | undefined
|
||||
) {
|
||||
const input = this.inputs[slot]
|
||||
if (contype !== LiteGraph.INPUT || !this.graph || !input) return
|
||||
if (app.configuringGraph) return
|
||||
const [matchKey, matchGroup] = Object.entries(
|
||||
this.comfyDynamic.matchType
|
||||
).find(([, group]) => input.name in group) ?? ['', undefined]
|
||||
if (!matchGroup) return
|
||||
if (iscon && linf) {
|
||||
const { output, subgraphInput } = linf.resolve(this.graph)
|
||||
const connectingType = (output ?? subgraphInput)?.type
|
||||
if (connectingType) linf.type = connectingType
|
||||
}
|
||||
//NOTE: inputs contains input
|
||||
const groupInputs: INodeInputSlot[] = node.inputs.filter(
|
||||
(inp) => inp.name in matchGroup
|
||||
)
|
||||
const connectedTypes = groupInputs.map((inp) => {
|
||||
if (!inp.link) return '*'
|
||||
const link = this.graph!.links[inp.link]
|
||||
if (!link) return '*'
|
||||
const { output, subgraphInput } = link.resolve(this.graph!)
|
||||
return (output ?? subgraphInput)?.type ?? '*'
|
||||
})
|
||||
//An input slot can accept a connection that is
|
||||
// - Compatible with original type
|
||||
// - Compatible with all other input types
|
||||
//An output slot can output
|
||||
// - Only what every input can output
|
||||
groupInputs.forEach((input, idx) => {
|
||||
const otherConnected = [
|
||||
...connectedTypes.slice(0, idx),
|
||||
...connectedTypes.slice(idx + 1)
|
||||
]
|
||||
const combinedType = commonType(
|
||||
...otherConnected,
|
||||
matchGroup[input.name]
|
||||
)
|
||||
if (!combinedType) throw new Error('invalid connection')
|
||||
input.type = combinedType
|
||||
})
|
||||
const outputType = commonType(...connectedTypes)
|
||||
if (!outputType) throw new Error('invalid connection')
|
||||
this.outputs.forEach((output, idx) => {
|
||||
if (!(outputGroups?.[idx] == matchKey)) return
|
||||
this.outputs[idx] = shallowReactive(this.outputs[idx])
|
||||
changeOutputType(this, output, outputType)
|
||||
})
|
||||
app.canvas?.setDirty(true, true)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
function applyMatchType(node: LGraphNode, inputSpec: InputSpecV2) {
|
||||
const { addNodeInput } = useLitegraphService()
|
||||
const name = inputSpec.name
|
||||
const parseResult = zMatchTypeOptions.safeParse(inputSpec)
|
||||
if (!parseResult.success) {
|
||||
console.warn(
|
||||
`Unparseable COMFY_MATCHTYPE_V3 spec for input "${name}"; falling back to a wildcard socket.`,
|
||||
parseResult.error.issues
|
||||
)
|
||||
addNodeInput(node, { ...inputSpec, type: '*' })
|
||||
return
|
||||
}
|
||||
const matchTypeSpec = parseResult.data
|
||||
|
||||
const { allowed_types, template_id } = matchTypeSpec.template
|
||||
const typedSpec = { ...inputSpec, type: allowed_types }
|
||||
addNodeInput(node, typedSpec)
|
||||
withComfyMatchType(node)
|
||||
node.comfyDynamic.matchType[template_id] ??= {}
|
||||
node.comfyDynamic.matchType[template_id][name] = allowed_types
|
||||
|
||||
//TODO: instead apply on output add?
|
||||
//ensure outputs get updated
|
||||
const index = node.inputs.length - 1
|
||||
requestAnimationFrame(() => {
|
||||
const input = node.inputs[index]
|
||||
if (!input) return
|
||||
node.inputs[index] = shallowReactive(input)
|
||||
node.onConnectionsChange?.(
|
||||
LiteGraph.INPUT,
|
||||
index,
|
||||
!!input.link,
|
||||
input.link ? node.graph?.links?.[input.link] : undefined,
|
||||
input
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
function autogrowOrdinalToName(
|
||||
ordinal: number,
|
||||
key: string,
|
||||
groupName: string,
|
||||
node: AutogrowNode
|
||||
) {
|
||||
const {
|
||||
names,
|
||||
prefix = '',
|
||||
inputSpecs
|
||||
} = node.comfyDynamic.autogrow[groupName]
|
||||
const baseName = names
|
||||
? names[ordinal]
|
||||
: (inputSpecs.length == 1 ? prefix : key) + ordinal
|
||||
return { name: `${groupName}.${baseName}`, display_name: baseName }
|
||||
}
|
||||
|
||||
function addAutogrowGroup(
|
||||
ordinal: number,
|
||||
groupName: string,
|
||||
node: AutogrowNode
|
||||
) {
|
||||
const { addNodeInput } = useLitegraphService()
|
||||
const { max, min, inputSpecs } = node.comfyDynamic.autogrow[groupName]
|
||||
if (ordinal >= max) return
|
||||
|
||||
const namedSpecs = inputSpecs.map((input) => ({
|
||||
...input,
|
||||
isOptional: ordinal >= (min ?? 0) || input.isOptional,
|
||||
...autogrowOrdinalToName(ordinal, input.name, groupName, node)
|
||||
}))
|
||||
|
||||
const newInputs = namedSpecs.map((namedSpec) => {
|
||||
addNodeInput(node, namedSpec)
|
||||
const input = spliceInputs(node, node.inputs.length - 1, 1)[0]
|
||||
if (inputSpecs.length !== 1 || (INLINE_INPUTS && !input.widget))
|
||||
ensureWidgetForInput(node, input)
|
||||
return input
|
||||
})
|
||||
|
||||
for (const newInput of newInputs) {
|
||||
for (const existingInput of remove(
|
||||
node.inputs,
|
||||
(inp) => inp.name === newInput.name
|
||||
)) {
|
||||
//NOTE: link.target_slot is updated on spliceInputs call
|
||||
newInput.link ??= existingInput.link
|
||||
}
|
||||
}
|
||||
|
||||
const targetName = autogrowOrdinalToName(
|
||||
ordinal - 1,
|
||||
inputSpecs.at(-1)!.name,
|
||||
groupName,
|
||||
node
|
||||
).name
|
||||
const lastIndex = node.inputs.findLastIndex((inp) =>
|
||||
inp.name.startsWith(targetName)
|
||||
)
|
||||
const insertionIndex = lastIndex === -1 ? node.inputs.length : lastIndex + 1
|
||||
spliceInputs(node, insertionIndex, 0, ...newInputs)
|
||||
app.canvas?.setDirty(true, true)
|
||||
}
|
||||
|
||||
const ORDINAL_REGEX = /\d+$/
|
||||
function resolveAutogrowOrdinal(
|
||||
inputName: string,
|
||||
groupName: string,
|
||||
node: AutogrowNode
|
||||
): number | undefined {
|
||||
//TODO preslice groupname?
|
||||
const name = inputName.slice(groupName.length + 1)
|
||||
const { names } = node.comfyDynamic.autogrow[groupName]
|
||||
if (names) {
|
||||
const ordinal = names.findIndex((s) => s === name)
|
||||
return ordinal === -1 ? undefined : ordinal
|
||||
}
|
||||
const match = name.match(ORDINAL_REGEX)
|
||||
if (!match) return undefined
|
||||
const ordinal = parseInt(match[0])
|
||||
return ordinal !== ordinal ? undefined : ordinal
|
||||
}
|
||||
function autogrowInputConnected(index: number, node: AutogrowNode) {
|
||||
const input = node.inputs[index]
|
||||
const groupName = input.name.slice(0, input.name.lastIndexOf('.'))
|
||||
const lastInput = node.inputs.findLast((inp) =>
|
||||
inp.name.startsWith(groupName + '.')
|
||||
)
|
||||
const ordinal = resolveAutogrowOrdinal(input.name, groupName, node)
|
||||
if (
|
||||
!lastInput ||
|
||||
ordinal == undefined ||
|
||||
(ordinal !== resolveAutogrowOrdinal(lastInput.name, groupName, node) &&
|
||||
!app.configuringGraph)
|
||||
)
|
||||
return
|
||||
addAutogrowGroup(ordinal + 1, groupName, node)
|
||||
}
|
||||
function autogrowInputDisconnected(index: number, node: AutogrowNode) {
|
||||
const input = node.inputs[index]
|
||||
if (!input) return
|
||||
const groupName = input.name.slice(0, input.name.lastIndexOf('.'))
|
||||
const autogrowGroup = node.comfyDynamic.autogrow[groupName]
|
||||
if (!autogrowGroup) return
|
||||
|
||||
const { min = 1, inputSpecs } = autogrowGroup
|
||||
const ordinal = resolveAutogrowOrdinal(input.name, groupName, node)
|
||||
if (ordinal == undefined || ordinal + 1 < min) return
|
||||
|
||||
//resolve all inputs in group
|
||||
const groupInputs = node.inputs.filter(
|
||||
(inp) =>
|
||||
inp.name.startsWith(groupName + '.') &&
|
||||
inp.name.lastIndexOf('.') === groupName.length
|
||||
)
|
||||
const stride = inputSpecs.length
|
||||
if (stride + index >= node.inputs.length) return
|
||||
if (groupInputs.length % stride !== 0) {
|
||||
console.error('Failed to group multi-input autogrow inputs')
|
||||
return
|
||||
}
|
||||
app.canvas?.setDirty(true, true)
|
||||
//groupBy would be nice here, but may not be supported
|
||||
for (let column = 0; column < stride; column++) {
|
||||
for (
|
||||
let bubbleOrdinal = ordinal * stride + column;
|
||||
bubbleOrdinal + stride < groupInputs.length;
|
||||
bubbleOrdinal += stride
|
||||
) {
|
||||
const curInput = groupInputs[bubbleOrdinal]
|
||||
curInput.link = groupInputs[bubbleOrdinal + stride].link
|
||||
if (!curInput.link) continue
|
||||
const link = node.graph?.links[curInput.link]
|
||||
if (!link) continue
|
||||
const curIndex = node.inputs.findIndex((inp) => inp === curInput)
|
||||
if (curIndex === -1) throw new Error('missing input')
|
||||
link.target_slot = curIndex
|
||||
node.onConnectionsChange?.(
|
||||
LiteGraph.INPUT,
|
||||
curIndex,
|
||||
true,
|
||||
link,
|
||||
curInput
|
||||
)
|
||||
}
|
||||
const lastInput = groupInputs.at(column - stride)
|
||||
if (!lastInput) continue
|
||||
lastInput.link = null
|
||||
node.onConnectionsChange?.(
|
||||
LiteGraph.INPUT,
|
||||
node.inputs.length + column - stride,
|
||||
false,
|
||||
null,
|
||||
lastInput
|
||||
)
|
||||
}
|
||||
const removalChecks = groupInputs.slice(min * stride)
|
||||
let i
|
||||
for (i = removalChecks.length - stride; i >= 0; i -= stride) {
|
||||
if (removalChecks.slice(i, i + stride).some((inp) => inp.link)) break
|
||||
}
|
||||
const toRemove = removalChecks.slice(i + stride * 2)
|
||||
remove(node.inputs, (inp) => toRemove.includes(inp))
|
||||
for (const input of toRemove) {
|
||||
const widgetName = input?.widget?.name
|
||||
if (!widgetName) continue
|
||||
for (const widget of remove(node.widgets, (w) => w.name === widgetName))
|
||||
widget.onRemove?.()
|
||||
}
|
||||
node.size[1] = node.computeSize([...node.size])[1]
|
||||
}
|
||||
|
||||
function withComfyAutogrow(node: LGraphNode): asserts node is AutogrowNode {
|
||||
if (node.comfyDynamic?.autogrow) return
|
||||
node.comfyDynamic ??= {}
|
||||
node.comfyDynamic.autogrow = {}
|
||||
|
||||
let pendingConnection: number | undefined
|
||||
let swappingConnection = false
|
||||
|
||||
const originalOnConnectInput = node.onConnectInput
|
||||
node.onConnectInput = function (slot: number, ...args) {
|
||||
pendingConnection = slot
|
||||
requestAnimationFrame(() => (pendingConnection = undefined))
|
||||
return originalOnConnectInput?.apply(this, [slot, ...args]) ?? true
|
||||
}
|
||||
|
||||
node.onConnectionsChange = useChainCallback(
|
||||
node.onConnectionsChange,
|
||||
function (
|
||||
this: AutogrowNode,
|
||||
contype: ISlotType,
|
||||
slot: number,
|
||||
iscon: boolean,
|
||||
linf: LLink | null | undefined
|
||||
) {
|
||||
const input = this.inputs[slot]
|
||||
if (contype !== LiteGraph.INPUT || !input) return
|
||||
//Return if input isn't known autogrow
|
||||
const key = input.name.slice(0, input.name.lastIndexOf('.'))
|
||||
const autogrowGroup = this.comfyDynamic.autogrow[key]
|
||||
if (!autogrowGroup) return
|
||||
if (app.configuringGraph && input.widget)
|
||||
ensureWidgetForInput(node, input)
|
||||
if (iscon) {
|
||||
if (swappingConnection || !linf) return
|
||||
autogrowInputConnected(slot, this)
|
||||
} else {
|
||||
if (pendingConnection === slot) {
|
||||
swappingConnection = true
|
||||
requestAnimationFrame(() => (swappingConnection = false))
|
||||
return
|
||||
}
|
||||
requestAnimationFrame(() => autogrowInputDisconnected(slot, this))
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
function applyAutogrow(node: LGraphNode, inputSpecV2: InputSpecV2) {
|
||||
withComfyAutogrow(node)
|
||||
|
||||
const parseResult = zAutogrowOptions.safeParse(inputSpecV2)
|
||||
if (!parseResult.success) throw new Error('invalid Autogrow spec')
|
||||
const inputSpec = parseResult.data
|
||||
const { input, min = 1, names, prefix, max = 100 } = inputSpec.template
|
||||
|
||||
const inputTypes: (Record<string, InputSpec> | undefined)[] = [
|
||||
input.required,
|
||||
input.optional
|
||||
]
|
||||
const inputsV2 = inputTypes.flatMap((inputType, index) =>
|
||||
Object.entries(inputType ?? {}).map(([name, v]) =>
|
||||
transformInputSpecV1ToV2(v, { name, isOptional: index === 1 })
|
||||
)
|
||||
)
|
||||
node.comfyDynamic.autogrow[inputSpecV2.name] = {
|
||||
names,
|
||||
min,
|
||||
max: names?.length ?? max,
|
||||
prefix,
|
||||
inputSpecs: inputsV2
|
||||
}
|
||||
for (let i = 0; i === 0 || i < min + 1; i++)
|
||||
addAutogrowGroup(i, inputSpecV2.name, node)
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
import { LGraphCanvas, LiteGraph } from '@/lib/litegraph/src/litegraph'
|
||||
import { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||
|
||||
import { app } from '../../scripts/app'
|
||||
import { ComfyWidgets } from '../../scripts/widgets'
|
||||
|
||||
// Node that add notes to your project
|
||||
|
||||
app.registerExtension({
|
||||
name: 'Comfy.NoteNode',
|
||||
registerCustomNodes() {
|
||||
class NoteNode extends LGraphNode {
|
||||
static override category: string
|
||||
static collapsable: boolean
|
||||
static title_mode: number
|
||||
|
||||
groupcolor = LGraphCanvas.node_colors.yellow.groupcolor
|
||||
override isVirtualNode: boolean
|
||||
|
||||
constructor(title: string) {
|
||||
super(title)
|
||||
|
||||
this.color = LGraphCanvas.node_colors.yellow.color
|
||||
this.bgcolor = LGraphCanvas.node_colors.yellow.bgcolor
|
||||
|
||||
if (!this.properties) {
|
||||
this.properties = { text: '' }
|
||||
}
|
||||
ComfyWidgets.STRING(
|
||||
this,
|
||||
'text',
|
||||
['STRING', { default: this.properties.text, multiline: true }],
|
||||
app
|
||||
)
|
||||
|
||||
this.serialize_widgets = true
|
||||
this.isVirtualNode = true
|
||||
}
|
||||
}
|
||||
|
||||
// Load default visibility
|
||||
|
||||
LiteGraph.registerNodeType(
|
||||
'Note',
|
||||
Object.assign(NoteNode, {
|
||||
title_mode: LiteGraph.NORMAL_TITLE,
|
||||
title: 'Note',
|
||||
collapsable: true
|
||||
})
|
||||
)
|
||||
|
||||
NoteNode.category = 'utilities'
|
||||
|
||||
/** Markdown variant of NoteNode */
|
||||
class MarkdownNoteNode extends LGraphNode {
|
||||
static override title = 'Markdown Note'
|
||||
|
||||
groupcolor = LGraphCanvas.node_colors.yellow.groupcolor
|
||||
|
||||
constructor(title: string) {
|
||||
super(title)
|
||||
|
||||
this.color = LGraphCanvas.node_colors.yellow.color
|
||||
this.bgcolor = LGraphCanvas.node_colors.yellow.bgcolor
|
||||
|
||||
if (!this.properties) {
|
||||
this.properties = { text: '' }
|
||||
}
|
||||
ComfyWidgets.MARKDOWN(
|
||||
this,
|
||||
'text',
|
||||
['STRING', { default: this.properties.text }],
|
||||
app
|
||||
)
|
||||
|
||||
this.serialize_widgets = true
|
||||
this.isVirtualNode = true
|
||||
}
|
||||
}
|
||||
|
||||
LiteGraph.registerNodeType('MarkdownNote', MarkdownNoteNode)
|
||||
MarkdownNoteNode.category = 'utilities'
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,40 @@
|
||||
import type { LGraphNode } from '@/lib/litegraph/src/LGraphNode'
|
||||
import {
|
||||
type ComfyNodeDef,
|
||||
type InputSpec,
|
||||
isMediaUploadComboInput
|
||||
} from '@/schemas/nodeDefSchema'
|
||||
|
||||
import { app } from '../../scripts/app'
|
||||
|
||||
// Adds an upload button to the nodes
|
||||
|
||||
const createUploadInput = (
|
||||
imageInputName: string,
|
||||
imageInputOptions: InputSpec
|
||||
): InputSpec => [
|
||||
'IMAGEUPLOAD',
|
||||
{
|
||||
...imageInputOptions[1],
|
||||
imageInputName
|
||||
}
|
||||
]
|
||||
|
||||
app.registerExtension({
|
||||
name: 'Comfy.UploadImage',
|
||||
beforeRegisterNodeDef(_nodeType: typeof LGraphNode, nodeData: ComfyNodeDef) {
|
||||
const { input } = nodeData ?? {}
|
||||
const { required } = input ?? {}
|
||||
if (!required) return
|
||||
|
||||
const found = Object.entries(required).find(([_, input]) =>
|
||||
isMediaUploadComboInput(input)
|
||||
)
|
||||
|
||||
// If media combo input found, attach upload input
|
||||
if (found) {
|
||||
const [inputName, inputSpec] = found
|
||||
required.upload = createUploadInput(inputName, inputSpec)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,19 @@
|
||||
Copyright (C) 2013 by Javi Agenjo
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
File diff suppressed because it is too large
Load Diff
+429
@@ -0,0 +1,429 @@
|
||||
import { toLinkId } from '@/types/linkId'
|
||||
import type { LGraph } from '@/lib/litegraph/src/LGraph'
|
||||
import type { LGraphNode } from '@/lib/litegraph/src/LGraphNode'
|
||||
import type { SerializedNodeId } from '@/types/nodeId'
|
||||
import type { LinkId } from '@/lib/litegraph/src/LLink'
|
||||
import { InvalidLinkError } from '@/lib/litegraph/src/infrastructure/InvalidLinkError'
|
||||
import { useWidgetValueStore } from '@/stores/widgetValueStore'
|
||||
import { NullGraphError } from '@/lib/litegraph/src/infrastructure/NullGraphError'
|
||||
import { RecursionError } from '@/lib/litegraph/src/infrastructure/RecursionError'
|
||||
import { SlotIndexError } from '@/lib/litegraph/src/infrastructure/SlotIndexError'
|
||||
import type { ISlotType } from '@/lib/litegraph/src/interfaces'
|
||||
import { LGraphEventMode, LiteGraph } from '@/lib/litegraph/src/litegraph'
|
||||
|
||||
import type { Subgraph } from './Subgraph'
|
||||
import type { SubgraphNode } from './SubgraphNode'
|
||||
|
||||
export type ExecutionId = string
|
||||
|
||||
/**
|
||||
* Interface describing the data transfer objects used when compiling a graph for execution.
|
||||
*/
|
||||
export type ExecutableLGraphNode = Omit<
|
||||
ExecutableNodeDTO,
|
||||
'graph' | 'node' | 'subgraphNode'
|
||||
>
|
||||
|
||||
/**
|
||||
* The end result of resolving a DTO input.
|
||||
* When a widget value is returned, {@link widgetInfo} is present and {@link origin_slot} is `-1`.
|
||||
*/
|
||||
type ResolvedInput = {
|
||||
/** DTO for the node that the link originates from. */
|
||||
node: ExecutableLGraphNode
|
||||
/** Full unique execution ID of the node that the link originates from. In the case of a widget value, this is the ID of the subgraph node. */
|
||||
origin_id: ExecutionId
|
||||
/** The slot index of the output on the node that the link originates from. `-1` when widget value is set. */
|
||||
origin_slot: number
|
||||
/** Boxed widget value (e.g. for widgets). If this box is `undefined`, then an input link is connected, and widget values from the subgraph node are ignored. */
|
||||
widgetInfo?: { value: unknown }
|
||||
}
|
||||
|
||||
/**
|
||||
* Concrete implementation of {@link ExecutableLGraphNode}.
|
||||
* @remarks This is the class that is used to create the data transfer objects for executable nodes.
|
||||
*/
|
||||
export class ExecutableNodeDTO implements ExecutableLGraphNode {
|
||||
applyToGraph?(
|
||||
...args: Parameters<NonNullable<typeof this.node.applyToGraph>>
|
||||
): ReturnType<NonNullable<typeof this.node.applyToGraph>>
|
||||
|
||||
/** The graph that this node is a part of. */
|
||||
readonly graph: LGraph | Subgraph
|
||||
|
||||
inputs: { linkId: LinkId | null; name: string; type: ISlotType }[]
|
||||
|
||||
/** Backing field for {@link id}. */
|
||||
private _id: ExecutionId
|
||||
|
||||
/**
|
||||
* The path to the actual node through subgraph instances, represented as a list of all subgraph node IDs (instances),
|
||||
* followed by the actual original node ID within the subgraph. Each segment is separated by `:`.
|
||||
*
|
||||
* e.g. `1:2:3`:
|
||||
* - `1` is the node ID of the first subgraph node in the parent workflow
|
||||
* - `2` is the node ID of the second subgraph node in the first subgraph
|
||||
* - `3` is the node ID of the actual node in the subgraph definition
|
||||
*/
|
||||
get id() {
|
||||
return this._id
|
||||
}
|
||||
|
||||
get type() {
|
||||
return this.node.type
|
||||
}
|
||||
|
||||
get title() {
|
||||
return this.node.title
|
||||
}
|
||||
|
||||
get mode() {
|
||||
return this.node.mode
|
||||
}
|
||||
|
||||
get comfyClass() {
|
||||
return this.node.comfyClass
|
||||
}
|
||||
|
||||
get isVirtualNode() {
|
||||
return this.node.isVirtualNode
|
||||
}
|
||||
|
||||
get widgets() {
|
||||
return this.node.widgets
|
||||
}
|
||||
|
||||
get subgraphId() {
|
||||
return this.subgraphNode?.subgraph.id
|
||||
}
|
||||
|
||||
constructor(
|
||||
/** The actual node that this DTO wraps. */
|
||||
readonly node: LGraphNode | SubgraphNode,
|
||||
/** A list of subgraph instance node IDs from the root graph to the containing instance. @see {@link id} */
|
||||
readonly subgraphNodePath: readonly SerializedNodeId[],
|
||||
/** A flattened map of all DTOs in this node network. Subgraph instances have been expanded into their inner nodes. */
|
||||
readonly nodesByExecutionId: Map<ExecutionId, ExecutableLGraphNode>,
|
||||
/** The actual subgraph instance that contains this node, otherwise undefined. */
|
||||
readonly subgraphNode?: SubgraphNode
|
||||
) {
|
||||
if (!node.graph) throw new NullGraphError()
|
||||
|
||||
// Set the internal ID of the DTO
|
||||
this._id = [...this.subgraphNodePath, this.node.id].join(':')
|
||||
this.graph = node.graph
|
||||
this.inputs = this.node.inputs.map((x) => ({
|
||||
linkId: x.link == null ? null : toLinkId(x.link),
|
||||
name: x.name,
|
||||
type: x.type
|
||||
}))
|
||||
|
||||
// Only create a wrapper if the node has an applyToGraph method
|
||||
if (this.node.applyToGraph) {
|
||||
this.applyToGraph = (...args) => this.node.applyToGraph?.(...args)
|
||||
}
|
||||
}
|
||||
|
||||
/** Returns either the DTO itself, or the DTOs of the inner nodes of the subgraph. */
|
||||
getInnerNodes(): ExecutableLGraphNode[] {
|
||||
return this.node.isSubgraphNode()
|
||||
? this.node.getInnerNodes(this.nodesByExecutionId, this.subgraphNodePath)
|
||||
: [this]
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the executable node & link IDs for a given input slot.
|
||||
* @param slot The slot index of the input.
|
||||
* @param visited Leave empty unless overriding this method.
|
||||
* A set of unique IDs, used to guard against infinite recursion.
|
||||
* If overriding, ensure that the set is passed on all recursive calls.
|
||||
* @returns The node and the origin ID / slot index of the output.
|
||||
*/
|
||||
resolveInput(
|
||||
slot: number,
|
||||
visited = new Set<string>(),
|
||||
type?: ISlotType
|
||||
): ResolvedInput | undefined {
|
||||
const uniqueId = `${this.subgraphNode?.subgraph.id}:${this.node.id}[I]${slot}`
|
||||
if (visited.has(uniqueId)) {
|
||||
const nodeInfo = `${this.node.id}${this.node.title ? ` (${this.node.title})` : ''}`
|
||||
const pathInfo =
|
||||
this.subgraphNodePath.length > 0
|
||||
? ` at path ${this.subgraphNodePath.join(':')}`
|
||||
: ''
|
||||
throw new RecursionError(
|
||||
`Circular reference detected while resolving input ${slot} of node ${nodeInfo}${pathInfo}. ` +
|
||||
`This creates an infinite loop in link resolution. UniqueID: [${uniqueId}]`
|
||||
)
|
||||
}
|
||||
visited.add(uniqueId)
|
||||
|
||||
const input = this.inputs.at(slot)
|
||||
if (!input)
|
||||
throw new SlotIndexError(
|
||||
`No input found for flattened id [${this.id}] slot [${slot}]`
|
||||
)
|
||||
|
||||
// Nothing connected
|
||||
if (input.linkId == null) return
|
||||
|
||||
const link = this.graph.getLink(input.linkId)
|
||||
if (!link)
|
||||
throw new InvalidLinkError(
|
||||
`No link found in parent graph for id [${this.id}] slot [${slot}] ${input.name}`
|
||||
)
|
||||
|
||||
const { subgraphNode } = this
|
||||
|
||||
// Link goes up and out of this subgraph
|
||||
if (subgraphNode && link.originIsIoNode) {
|
||||
const subgraphNodeInput = subgraphNode.inputs.at(link.origin_slot)
|
||||
if (!subgraphNodeInput)
|
||||
throw new SlotIndexError(
|
||||
`No input found for slot [${link.origin_slot}] ${input.name}`
|
||||
)
|
||||
|
||||
// Nothing connected
|
||||
const linkId = subgraphNodeInput.link
|
||||
if (linkId == null) {
|
||||
const id = subgraphNodeInput.widgetId
|
||||
if (!id) return
|
||||
|
||||
return {
|
||||
node: this,
|
||||
origin_id: this.id,
|
||||
origin_slot: -1,
|
||||
widgetInfo: { value: useWidgetValueStore().getWidget(id)?.value }
|
||||
}
|
||||
}
|
||||
|
||||
if (!subgraphNode.graph)
|
||||
throw new NullGraphError(
|
||||
`SubgraphNode ${subgraphNode.id} has no graph during input resolution`
|
||||
)
|
||||
const outerLink = subgraphNode.graph.getLink(linkId)
|
||||
if (!outerLink)
|
||||
throw new InvalidLinkError(
|
||||
`No outer link found for slot [${link.origin_slot}] ${input.name}`
|
||||
)
|
||||
|
||||
const subgraphNodeExecutionId: ExecutionId =
|
||||
this.subgraphNodePath.join(':')
|
||||
const subgraphNodeDto = this.nodesByExecutionId.get(
|
||||
subgraphNodeExecutionId
|
||||
)
|
||||
if (!subgraphNodeDto)
|
||||
throw new Error(
|
||||
`No subgraph node DTO found for id [${subgraphNodeExecutionId}]`
|
||||
)
|
||||
|
||||
return subgraphNodeDto.resolveInput(outerLink.target_slot, visited)
|
||||
}
|
||||
|
||||
// Not part of a subgraph; use the original link
|
||||
const outputNode = this.graph.getNodeById(link.origin_id)
|
||||
if (!outputNode)
|
||||
throw new InvalidLinkError(
|
||||
`No input node found for id [${this.id}] slot [${slot}] ${input.name}`
|
||||
)
|
||||
|
||||
const outputNodeExecutionId: ExecutionId = [
|
||||
...this.subgraphNodePath,
|
||||
outputNode.id
|
||||
].join(':')
|
||||
const outputNodeDto = this.nodesByExecutionId.get(outputNodeExecutionId)
|
||||
if (!outputNodeDto)
|
||||
throw new Error(
|
||||
`No output node DTO found for id [${outputNodeExecutionId}]`
|
||||
)
|
||||
|
||||
return outputNodeDto.resolveOutput(
|
||||
link.origin_slot,
|
||||
type ?? input.type,
|
||||
visited
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether this output is a valid endpoint for a link (non-virtual, non-bypass).
|
||||
* @param slot The slot index of the output.
|
||||
* @param type The type of the input
|
||||
* @param visited A set of unique IDs to guard against infinite recursion. See {@link resolveInput}.
|
||||
* @returns The node and the origin ID / slot index of the output.
|
||||
*/
|
||||
resolveOutput(
|
||||
slot: number,
|
||||
type: ISlotType,
|
||||
visited: Set<string>
|
||||
): ResolvedInput | undefined {
|
||||
const uniqueId = `${this.subgraphNode?.subgraph.id}:${this.node.id}[O]${slot}`
|
||||
if (visited.has(uniqueId)) {
|
||||
const nodeInfo = `${this.node.id}${this.node.title ? ` (${this.node.title})` : ''}`
|
||||
const pathInfo =
|
||||
this.subgraphNodePath.length > 0
|
||||
? ` at path ${this.subgraphNodePath.join(':')}`
|
||||
: ''
|
||||
throw new RecursionError(
|
||||
`Circular reference detected while resolving output ${slot} of node ${nodeInfo}${pathInfo}. ` +
|
||||
`This creates an infinite loop in link resolution. UniqueID: [${uniqueId}]`
|
||||
)
|
||||
}
|
||||
visited.add(uniqueId)
|
||||
|
||||
// Muted nodes produce no output
|
||||
if (this.mode === LGraphEventMode.NEVER) return
|
||||
|
||||
// Upstreamed: Bypass nodes are bypassed using the first input with matching type
|
||||
if (this.mode === LGraphEventMode.BYPASS) {
|
||||
// Bypass nodes by finding first input with matching type
|
||||
const matchingIndex = this._getBypassSlotIndex(slot, type)
|
||||
|
||||
// No input types match - bypass not possible
|
||||
if (matchingIndex === -1) {
|
||||
console.warn(
|
||||
`[ExecutableNodeDTO.resolveOutput] No input types match type [${type}] for id [${this.id}] slot [${slot}]`,
|
||||
this
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
return this.resolveInput(matchingIndex, visited)
|
||||
}
|
||||
|
||||
const { node } = this
|
||||
if (node.isSubgraphNode())
|
||||
return this._resolveSubgraphOutput(slot, type, visited)
|
||||
|
||||
if (node.isVirtualNode) {
|
||||
// Cross-graph virtual nodes (e.g. Set/Get) resolve their source directly.
|
||||
const virtualSource = this.node.resolveVirtualOutput?.(slot)
|
||||
if (virtualSource) {
|
||||
const inputNodeDto = [...this.nodesByExecutionId.values()].find(
|
||||
(dto) =>
|
||||
dto instanceof ExecutableNodeDTO && dto.node === virtualSource.node
|
||||
)
|
||||
if (!inputNodeDto)
|
||||
throw new Error(
|
||||
`No DTO found for virtual source node [${virtualSource.node.id}]`
|
||||
)
|
||||
|
||||
return inputNodeDto.resolveOutput(virtualSource.slot, type, visited)
|
||||
}
|
||||
const virtualLink = this.node.getInputLink(slot)
|
||||
if (virtualLink) {
|
||||
const { inputNode } = virtualLink.resolve(this.graph)
|
||||
if (!inputNode)
|
||||
throw new InvalidLinkError(
|
||||
`Virtual node failed to resolve parent [${this.id}] slot [${slot}]`
|
||||
)
|
||||
|
||||
const inputNodeExecutionId: ExecutionId = [
|
||||
...this.subgraphNodePath,
|
||||
inputNode.id
|
||||
].join(':')
|
||||
const inputNodeDto = this.nodesByExecutionId.get(inputNodeExecutionId)
|
||||
if (!inputNodeDto)
|
||||
throw new Error(`No input node DTO found for id [${inputNode.id}]`)
|
||||
|
||||
return inputNodeDto.resolveInput(virtualLink.target_slot, visited, type)
|
||||
}
|
||||
|
||||
// Virtual nodes without a matching input should be discarded.
|
||||
return
|
||||
}
|
||||
|
||||
return {
|
||||
node: this,
|
||||
origin_id: this.id,
|
||||
origin_slot: slot
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the index of the input slot on this node that matches the given output {@link slot} index.
|
||||
* Used when bypassing nodes.
|
||||
* @param slot The output slot index on this node
|
||||
* @param type The type of the final target input (so type list matches are accurate)
|
||||
* @returns The index of the input slot on this node, otherwise `-1`.
|
||||
*/
|
||||
private _getBypassSlotIndex(slot: number, type: ISlotType) {
|
||||
const { inputs } = this
|
||||
const oppositeInput = inputs[slot]
|
||||
const outputType = this.node.outputs[slot].type
|
||||
|
||||
// Any type short circuit - match slot ID, fallback to first slot
|
||||
if (type === '*' || type === '') {
|
||||
return inputs.length > slot ? slot : 0
|
||||
}
|
||||
|
||||
// Prefer input with the same slot ID
|
||||
if (
|
||||
oppositeInput &&
|
||||
LiteGraph.isValidConnection(oppositeInput.type, outputType) &&
|
||||
LiteGraph.isValidConnection(oppositeInput.type, type)
|
||||
) {
|
||||
return slot
|
||||
}
|
||||
|
||||
// Preserve legacy behaviour; use exact match first.
|
||||
const exactMatch = inputs.findIndex((input) => input.type === type)
|
||||
if (exactMatch !== -1) return exactMatch
|
||||
|
||||
// Find first matching slot - prefer exact type
|
||||
return inputs.findIndex(
|
||||
(input) =>
|
||||
LiteGraph.isValidConnection(input.type, outputType) &&
|
||||
LiteGraph.isValidConnection(input.type, type)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the link inside a subgraph node, from the subgraph IO node to the node inside the subgraph.
|
||||
* @param slot The slot index of the output on the subgraph node.
|
||||
* @param visited A set of unique IDs to guard against infinite recursion. See {@link resolveInput}.
|
||||
* @returns A DTO for the node, and the origin ID / slot index of the output.
|
||||
*/
|
||||
private _resolveSubgraphOutput(
|
||||
slot: number,
|
||||
type: ISlotType,
|
||||
visited: Set<string>
|
||||
): ResolvedInput | undefined {
|
||||
const { node } = this
|
||||
const output = node.outputs.at(slot)
|
||||
|
||||
if (!output)
|
||||
throw new SlotIndexError(
|
||||
`No output found for flattened id [${this.id}] slot [${slot}]`
|
||||
)
|
||||
if (!node.isSubgraphNode())
|
||||
throw new TypeError(`Node is not a subgraph node: ${node.id}`)
|
||||
|
||||
// Link inside the subgraph
|
||||
const innerResolved = node.resolveSubgraphOutputLink(slot)
|
||||
if (!innerResolved) return
|
||||
|
||||
const innerNode = innerResolved.outputNode
|
||||
if (!innerNode)
|
||||
throw new Error(
|
||||
`No output node found for id [${this.id}] slot [${slot}] ${output.name}`
|
||||
)
|
||||
|
||||
// Recurse into the subgraph
|
||||
const innerNodeExecutionId: ExecutionId = [
|
||||
...this.subgraphNodePath,
|
||||
node.id,
|
||||
innerNode.id
|
||||
].join(':')
|
||||
const innerNodeDto = this.nodesByExecutionId.get(innerNodeExecutionId)
|
||||
if (!innerNodeDto)
|
||||
throw new Error(
|
||||
`No inner node DTO found for id [${innerNodeExecutionId}]`
|
||||
)
|
||||
|
||||
return innerNodeDto.resolveOutput(
|
||||
innerResolved.link.origin_slot,
|
||||
type,
|
||||
visited
|
||||
)
|
||||
}
|
||||
}
|
||||
+980
@@ -0,0 +1,980 @@
|
||||
import cloneDeep from 'es-toolkit/compat/cloneDeep'
|
||||
import type { BaseLGraph, LGraph, SubgraphId } from '@/lib/litegraph/src/LGraph'
|
||||
import type { LGraphButton } from '@/lib/litegraph/src/LGraphButton'
|
||||
import type { LGraphCanvas } from '@/lib/litegraph/src/LGraphCanvas'
|
||||
import { LGraphNode } from '@/lib/litegraph/src/LGraphNode'
|
||||
import type { DrawTitleBoxOptions } from '@/lib/litegraph/src/LGraphNode'
|
||||
import { LLink } from '@/lib/litegraph/src/LLink'
|
||||
import type { ResolvedConnection } from '@/lib/litegraph/src/LLink'
|
||||
import { NullGraphError } from '@/lib/litegraph/src/infrastructure/NullGraphError'
|
||||
import { RecursionError } from '@/lib/litegraph/src/infrastructure/RecursionError'
|
||||
import type {
|
||||
ISubgraphInput,
|
||||
IWidgetLocator
|
||||
} from '@/lib/litegraph/src/interfaces'
|
||||
import { LiteGraph } from '@/lib/litegraph/src/litegraph'
|
||||
import type { INodeInputSlot, ISlotType } from '@/lib/litegraph/src/litegraph'
|
||||
import { NodeInputSlot } from '@/lib/litegraph/src/node/NodeInputSlot'
|
||||
import { NodeOutputSlot } from '@/lib/litegraph/src/node/NodeOutputSlot'
|
||||
import { UNASSIGNED_NODE_ID, toNodeId } from '@/types/nodeId'
|
||||
import type { SerializedNodeId } from '@/types/nodeId'
|
||||
import type {
|
||||
GraphOrSubgraph,
|
||||
Subgraph
|
||||
} from '@/lib/litegraph/src/subgraph/Subgraph'
|
||||
import type {
|
||||
ExportedSubgraphInstance,
|
||||
ISerialisedNode
|
||||
} from '@/lib/litegraph/src/types/serialisation'
|
||||
import { NodeSlotType } from '@/lib/litegraph/src/types/globalEnums'
|
||||
import type {
|
||||
IBaseWidget,
|
||||
TWidgetValue
|
||||
} from '@/lib/litegraph/src/types/widgets'
|
||||
import { isWidgetValue } from '@/lib/litegraph/src/types/widgets'
|
||||
import { isNodeBindable } from '@/lib/litegraph/src/utils/type'
|
||||
import { toConcreteWidget } from '@/lib/litegraph/src/widgets/widgetMap'
|
||||
import type { WidgetTypeMap } from '@/lib/litegraph/src/widgets/widgetMap'
|
||||
import { resolveConcretePromotedWidget } from '@/core/graph/subgraph/resolveConcretePromotedWidget'
|
||||
import { resolveSubgraphInputTarget } from '@/core/graph/subgraph/resolveSubgraphInputTarget'
|
||||
import { parsePreviewExposures } from '@/core/schemas/previewExposureSchema'
|
||||
import { parseProxyWidgetErrorQuarantine } from '@/core/schemas/proxyWidgetQuarantineSchema'
|
||||
import { usePreviewExposureStore } from '@/stores/previewExposureStore'
|
||||
import { useWidgetValueStore } from '@/stores/widgetValueStore'
|
||||
import { createNodeLocatorId } from '@/types/nodeIdentification'
|
||||
import type { WidgetId } from '@/types/widgetId'
|
||||
import { widgetId } from '@/types/widgetId'
|
||||
|
||||
import { ExecutableNodeDTO } from './ExecutableNodeDTO'
|
||||
import type { ExecutableLGraphNode, ExecutionId } from './ExecutableNodeDTO'
|
||||
import type { SubgraphInput } from './SubgraphInput'
|
||||
import { createBitmapCache } from './svgBitmapCache'
|
||||
|
||||
const workflowSvg = new Image()
|
||||
workflowSvg.src =
|
||||
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='white' stroke-linecap='round' stroke-width='1.3' d='M9.18613 3.09999H6.81377M9.18613 12.9H7.55288c-3.08678 0-5.35171-2.99581-4.60305-6.08843l.3054-1.26158M14.7486 2.1721l-.5931 2.45c-.132.54533-.6065.92789-1.1508.92789h-2.2993c-.77173 0-1.33797-.74895-1.1508-1.5221l.5931-2.45c.132-.54533.6065-.9279 1.1508-.9279h2.2993c.7717 0 1.3379.74896 1.1508 1.52211Zm-8.3033 0-.59309 2.45c-.13201.54533-.60646.92789-1.15076.92789H2.4021c-.7717 0-1.33793-.74895-1.15077-1.5221l.59309-2.45c.13201-.54533.60647-.9279 1.15077-.9279h2.29935c.77169 0 1.33792.74896 1.15076 1.52211Zm8.3033 9.8-.5931 2.45c-.132.5453-.6065.9279-1.1508.9279h-2.2993c-.77173 0-1.33797-.749-1.1508-1.5221l.5931-2.45c.132-.5453.6065-.9279 1.1508-.9279h2.2993c.7717 0 1.3379.7489 1.1508 1.5221Z'/%3E%3C/svg%3E %3C/svg%3E"
|
||||
|
||||
const workflowBitmapCache = createBitmapCache(workflowSvg, 32)
|
||||
|
||||
export class SubgraphNode extends LGraphNode implements BaseLGraph {
|
||||
declare inputs: (INodeInputSlot & Partial<ISubgraphInput>)[]
|
||||
|
||||
override readonly type: SubgraphId
|
||||
override readonly isVirtualNode = true as const
|
||||
override graph: GraphOrSubgraph | null
|
||||
|
||||
get rootGraph(): LGraph {
|
||||
if (!this.graph)
|
||||
throw new NullGraphError(`SubgraphNode ${this.id} has no graph`)
|
||||
return this.graph.rootGraph
|
||||
}
|
||||
|
||||
get isDetached(): boolean {
|
||||
return !this.graph
|
||||
}
|
||||
|
||||
override get displayType(): string {
|
||||
return 'Subgraph node'
|
||||
}
|
||||
|
||||
override isSubgraphNode(): this is SubgraphNode {
|
||||
return true
|
||||
}
|
||||
|
||||
declare widgets: IBaseWidget[]
|
||||
|
||||
/** Widgets added programmatically (e.g. addDOMWidget) outside the promotion system. */
|
||||
private readonly _extraWidgets: IBaseWidget[] = []
|
||||
|
||||
/**
|
||||
* Retained as a no-op for extension compatibility: promoted host widgets are
|
||||
* now store-backed and addressed by widgetId, so there is no view cache to
|
||||
* invalidate.
|
||||
*/
|
||||
invalidatePromotedViews(): void {}
|
||||
|
||||
private _eventAbortController = new AbortController()
|
||||
|
||||
constructor(
|
||||
graph: GraphOrSubgraph,
|
||||
readonly subgraph: Subgraph,
|
||||
instanceData: ExportedSubgraphInstance
|
||||
) {
|
||||
super(subgraph.name, subgraph.id)
|
||||
this.graph = graph
|
||||
|
||||
Object.defineProperty(this, 'widgets', {
|
||||
get: () => [
|
||||
...this.inputs.flatMap((input) => {
|
||||
const widget = this._projectPromotedWidget(input)
|
||||
return widget ? [widget] : []
|
||||
}),
|
||||
...this._extraWidgets
|
||||
],
|
||||
set: () => {
|
||||
if (import.meta.env.DEV)
|
||||
console.warn(
|
||||
'Cannot manually set widgets on SubgraphNode; use the promotion system.'
|
||||
)
|
||||
},
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
})
|
||||
|
||||
const subgraphEvents = this.subgraph.events
|
||||
const { signal } = this._eventAbortController
|
||||
|
||||
subgraphEvents.addEventListener(
|
||||
'input-added',
|
||||
(e) => {
|
||||
const subgraphInput = e.detail.input
|
||||
const { name, type } = subgraphInput
|
||||
const existingInput = this.inputs.find(
|
||||
(input) =>
|
||||
input._subgraphSlot === subgraphInput ||
|
||||
(input._subgraphSlot && input._subgraphSlot.id === subgraphInput.id)
|
||||
)
|
||||
if (existingInput) {
|
||||
this._addSubgraphInputListeners(subgraphInput, existingInput)
|
||||
const linkId = subgraphInput.linkIds[0]
|
||||
if (linkId === undefined) return
|
||||
|
||||
const link = this.subgraph.getLink(linkId)
|
||||
if (!link) return
|
||||
|
||||
const { inputNode, input } = link.resolve(subgraph)
|
||||
if (!inputNode || !input) return
|
||||
|
||||
const widget = inputNode.getWidgetFromSlot(input)
|
||||
if (widget)
|
||||
this._setWidget(subgraphInput, existingInput, widget, input.widget)
|
||||
return
|
||||
}
|
||||
const input = this.addInput(name, type, {
|
||||
_subgraphSlot: subgraphInput
|
||||
})
|
||||
this.invalidatePromotedViews()
|
||||
|
||||
this._addSubgraphInputListeners(subgraphInput, input)
|
||||
},
|
||||
{ signal }
|
||||
)
|
||||
|
||||
subgraphEvents.addEventListener(
|
||||
'removing-input',
|
||||
(e) => {
|
||||
const widget = e.detail.input._widget
|
||||
if (widget) this.ensureWidgetRemoved(widget)
|
||||
|
||||
this.removeInput(e.detail.index)
|
||||
this.invalidatePromotedViews()
|
||||
this.setDirtyCanvas(true, true)
|
||||
},
|
||||
{ signal }
|
||||
)
|
||||
|
||||
subgraphEvents.addEventListener(
|
||||
'output-added',
|
||||
(e) => {
|
||||
const { name, type } = e.detail.output
|
||||
this.addOutput(name, type)
|
||||
},
|
||||
{ signal }
|
||||
)
|
||||
|
||||
subgraphEvents.addEventListener(
|
||||
'removing-output',
|
||||
(e) => {
|
||||
this.removeOutput(e.detail.index)
|
||||
this.setDirtyCanvas(true, true)
|
||||
},
|
||||
{ signal }
|
||||
)
|
||||
|
||||
subgraphEvents.addEventListener(
|
||||
'renaming-input',
|
||||
(e) => {
|
||||
const { index, newName } = e.detail
|
||||
const input = this.inputs.at(index)
|
||||
if (!input) throw new Error('Subgraph input not found')
|
||||
|
||||
input.label = newName
|
||||
// Do NOT change input.widget.name — it is the stable internal
|
||||
// identifier used by onGraphConfigured (widgetInputs.ts) to match
|
||||
// inputs to widgets. Changing it to the display label would cause
|
||||
// collisions when two promoted inputs share the same label.
|
||||
if (input._widget) input._widget.label = newName
|
||||
if (input.widgetId) {
|
||||
const state = useWidgetValueStore().getWidget(input.widgetId)
|
||||
if (state) state.label = newName
|
||||
}
|
||||
this.invalidatePromotedViews()
|
||||
this.graph?.trigger('node:slot-label:changed', {
|
||||
nodeId: this.id,
|
||||
slotType: NodeSlotType.INPUT
|
||||
})
|
||||
},
|
||||
{ signal }
|
||||
)
|
||||
|
||||
subgraphEvents.addEventListener(
|
||||
'renaming-output',
|
||||
(e) => {
|
||||
const { index, newName } = e.detail
|
||||
const output = this.outputs.at(index)
|
||||
if (!output) throw new Error('Subgraph output not found')
|
||||
|
||||
output.label = newName
|
||||
this.graph?.trigger('node:slot-label:changed', {
|
||||
nodeId: this.id,
|
||||
slotType: NodeSlotType.OUTPUT
|
||||
})
|
||||
},
|
||||
{ signal }
|
||||
)
|
||||
|
||||
this.type = subgraph.id
|
||||
this.configure(instanceData)
|
||||
|
||||
this.addTitleButton({
|
||||
name: 'enter_subgraph',
|
||||
text: '\uE93B', // Unicode for pi-window-maximize
|
||||
yOffset: 0, // No vertical offset needed, button is centered
|
||||
xOffset: -10,
|
||||
fontSize: 16
|
||||
})
|
||||
}
|
||||
|
||||
override onTitleButtonClick(
|
||||
button: LGraphButton,
|
||||
canvas: LGraphCanvas
|
||||
): void {
|
||||
if (button.name === 'enter_subgraph') {
|
||||
canvas.openSubgraph(this.subgraph, this)
|
||||
} else {
|
||||
super.onTitleButtonClick(button, canvas)
|
||||
}
|
||||
}
|
||||
|
||||
private _projectPromotedWidget(
|
||||
input: INodeInputSlot
|
||||
): IBaseWidget | undefined {
|
||||
if (input._widget) return input._widget
|
||||
|
||||
const id = input.widgetId
|
||||
if (!id) return
|
||||
|
||||
const store = useWidgetValueStore()
|
||||
const widget: IBaseWidget = {
|
||||
get name() {
|
||||
return store.getWidget(id)?.name ?? input.name
|
||||
},
|
||||
get label() {
|
||||
return store.getWidget(id)?.label ?? input.label ?? input.name
|
||||
},
|
||||
set label(next) {
|
||||
const state = store.getWidget(id)
|
||||
if (state) state.label = next
|
||||
},
|
||||
get y() {
|
||||
return store.getWidget(id)?.y ?? 0
|
||||
},
|
||||
set y(next) {
|
||||
const state = store.getWidget(id)
|
||||
if (state) state.y = next
|
||||
},
|
||||
get type() {
|
||||
return store.getWidget(id)?.type ?? 'text'
|
||||
},
|
||||
get options() {
|
||||
return store.getWidget(id)?.options ?? {}
|
||||
},
|
||||
get value() {
|
||||
const value = store.getWidget(id)?.value
|
||||
return isWidgetValue(value) ? value : undefined
|
||||
},
|
||||
set value(next) {
|
||||
store.setValue(id, next)
|
||||
},
|
||||
// Canvas edits operate on a transient concrete widget (toConcreteWidget),
|
||||
// so the value setter above is never invoked; BaseWidget.setValue writes
|
||||
// its own local state and then calls this callback, which is the only
|
||||
// bridge back to the store.
|
||||
callback(next) {
|
||||
store.setValue(id, next)
|
||||
}
|
||||
}
|
||||
Object.defineProperty(widget, 'widgetId', {
|
||||
value: id,
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
})
|
||||
input._widget = widget
|
||||
return input._widget
|
||||
}
|
||||
|
||||
private _addSubgraphInputListeners(
|
||||
subgraphInput: SubgraphInput,
|
||||
input: INodeInputSlot & Partial<ISubgraphInput>
|
||||
) {
|
||||
input._subgraphSlot = subgraphInput
|
||||
|
||||
if (
|
||||
input._listenerController &&
|
||||
typeof input._listenerController.abort === 'function'
|
||||
) {
|
||||
input._listenerController.abort()
|
||||
}
|
||||
input._listenerController = new AbortController()
|
||||
const { signal } = input._listenerController
|
||||
|
||||
subgraphInput.events.addEventListener(
|
||||
'input-connected',
|
||||
(e) => {
|
||||
input.shape = this.getSlotShape(subgraphInput, e.detail.input)
|
||||
if (!e.detail.widget || !e.detail.node) return
|
||||
|
||||
this._setWidget(
|
||||
subgraphInput,
|
||||
input,
|
||||
e.detail.widget,
|
||||
e.detail.input.widget
|
||||
)
|
||||
},
|
||||
{ signal }
|
||||
)
|
||||
|
||||
subgraphInput.events.addEventListener(
|
||||
'input-disconnected',
|
||||
() => {
|
||||
this.invalidatePromotedViews()
|
||||
input.shape = this.getSlotShape(subgraphInput)
|
||||
|
||||
const connectedWidgets = subgraphInput.getConnectedWidgets()
|
||||
if (connectedWidgets.length > 0) {
|
||||
this._resolveInputWidget(subgraphInput, input)
|
||||
this.invalidatePromotedViews()
|
||||
return
|
||||
}
|
||||
|
||||
if (input._widget) this.ensureWidgetRemoved(input._widget)
|
||||
if (input.widgetId) {
|
||||
const id = input.widgetId
|
||||
queueMicrotask(() => {
|
||||
if (this.inputs.some((input) => input.widgetId === id)) return
|
||||
useWidgetValueStore().deleteWidget(id)
|
||||
})
|
||||
}
|
||||
|
||||
delete input.pos
|
||||
delete input.widget
|
||||
delete input.widgetId
|
||||
input._widget = undefined
|
||||
this.invalidatePromotedViews()
|
||||
},
|
||||
{ signal }
|
||||
)
|
||||
}
|
||||
|
||||
private _rebindInputSubgraphSlots(): void {
|
||||
this.invalidatePromotedViews()
|
||||
|
||||
const subgraphSlots = [...this.subgraph.inputNode.slots]
|
||||
const slotsBySignature = new Map<string, SubgraphInput[]>()
|
||||
const slotsByName = new Map<string, SubgraphInput[]>()
|
||||
|
||||
for (const slot of subgraphSlots) {
|
||||
const signature = `${slot.name}:${String(slot.type)}`
|
||||
const signatureSlots = slotsBySignature.get(signature)
|
||||
if (signatureSlots) {
|
||||
signatureSlots.push(slot)
|
||||
} else {
|
||||
slotsBySignature.set(signature, [slot])
|
||||
}
|
||||
|
||||
const nameSlots = slotsByName.get(slot.name)
|
||||
if (nameSlots) {
|
||||
nameSlots.push(slot)
|
||||
} else {
|
||||
slotsByName.set(slot.name, [slot])
|
||||
}
|
||||
}
|
||||
|
||||
const assignedSlotIds = new Set<string>()
|
||||
const takeUnassignedSlot = (
|
||||
slots: SubgraphInput[] | undefined
|
||||
): SubgraphInput | undefined => {
|
||||
if (!slots) return undefined
|
||||
return slots.find((slot) => !assignedSlotIds.has(String(slot.id)))
|
||||
}
|
||||
|
||||
for (const input of this.inputs) {
|
||||
const existingSlot = input._subgraphSlot
|
||||
if (
|
||||
existingSlot &&
|
||||
this.subgraph.inputNode.slots.some((slot) => slot === existingSlot)
|
||||
) {
|
||||
assignedSlotIds.add(String(existingSlot.id))
|
||||
continue
|
||||
}
|
||||
|
||||
const signature = `${input.name}:${String(input.type)}`
|
||||
const matchedSlot =
|
||||
takeUnassignedSlot(slotsBySignature.get(signature)) ??
|
||||
takeUnassignedSlot(slotsByName.get(input.name))
|
||||
|
||||
if (matchedSlot) {
|
||||
input._subgraphSlot = matchedSlot
|
||||
assignedSlotIds.add(String(matchedSlot.id))
|
||||
} else {
|
||||
delete input._subgraphSlot
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override configure(info: ExportedSubgraphInstance): void {
|
||||
for (const input of this.inputs) {
|
||||
if (
|
||||
input._listenerController &&
|
||||
typeof input._listenerController.abort === 'function'
|
||||
) {
|
||||
input._listenerController.abort()
|
||||
}
|
||||
}
|
||||
|
||||
this.inputs.length = 0
|
||||
this.inputs.push(
|
||||
...this.subgraph.inputNode.slots.map((slot) =>
|
||||
Object.assign(
|
||||
new NodeInputSlot(
|
||||
{
|
||||
name: slot.name,
|
||||
localized_name: slot.localized_name,
|
||||
label: slot.label,
|
||||
shape: this.getSlotShape(slot),
|
||||
type: slot.type,
|
||||
link: null
|
||||
},
|
||||
this
|
||||
),
|
||||
{
|
||||
_subgraphSlot: slot
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
this.invalidatePromotedViews()
|
||||
|
||||
this.outputs.length = 0
|
||||
this.outputs.push(
|
||||
...this.subgraph.outputNode.slots.map(
|
||||
(slot) =>
|
||||
new NodeOutputSlot(
|
||||
{
|
||||
name: slot.name,
|
||||
localized_name: slot.localized_name,
|
||||
label: slot.label,
|
||||
type: slot.type,
|
||||
links: null
|
||||
},
|
||||
this
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
super.configure(info)
|
||||
if (!info.widgets_values_named || !LiteGraph.namedValuesRestore)
|
||||
this._applyPromotedWidgetValues(info.widgets_values)
|
||||
}
|
||||
|
||||
private _applyPromotedWidgetValues(
|
||||
widgetValues: ExportedSubgraphInstance['widgets_values']
|
||||
): void {
|
||||
const quarantineValuesByInputName = this._readQuarantineHostValuesByName()
|
||||
|
||||
let valueIndex = 0
|
||||
for (const input of this.inputs) {
|
||||
if (!input.widgetId) continue
|
||||
const value =
|
||||
quarantineValuesByInputName.get(input.name) ??
|
||||
widgetValues?.[valueIndex]
|
||||
if (value !== undefined) {
|
||||
useWidgetValueStore().setValue(input.widgetId, value)
|
||||
}
|
||||
valueIndex += 1
|
||||
}
|
||||
}
|
||||
|
||||
private _readQuarantineHostValuesByName(): Map<string, TWidgetValue> {
|
||||
return new Map(
|
||||
parseProxyWidgetErrorQuarantine(
|
||||
this.properties.proxyWidgetErrorQuarantine
|
||||
)
|
||||
.toReversed()
|
||||
.flatMap(({ originalEntry: [sourceNodeId, name], hostValue }) =>
|
||||
sourceNodeId === '-1' &&
|
||||
hostValue !== undefined &&
|
||||
isWidgetValue(hostValue)
|
||||
? [[name, hostValue] as const]
|
||||
: []
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override _internalConfigureAfterSlots() {
|
||||
this._rebindInputSubgraphSlots()
|
||||
|
||||
this.inputs = this.inputs.filter((input) => input._subgraphSlot)
|
||||
this.invalidatePromotedViews()
|
||||
|
||||
this._hydratePreviewExposures()
|
||||
|
||||
for (const input of this.inputs) {
|
||||
const subgraphInput = input._subgraphSlot
|
||||
if (!subgraphInput) {
|
||||
console.warn(
|
||||
`[SubgraphNode.configure] No subgraph input found for input ${input.name}, skipping`
|
||||
)
|
||||
continue
|
||||
}
|
||||
|
||||
this._addSubgraphInputListeners(subgraphInput, input)
|
||||
this._resolveInputWidget(subgraphInput, input)
|
||||
}
|
||||
}
|
||||
|
||||
private _hydratePreviewExposures() {
|
||||
const store = usePreviewExposureStore()
|
||||
const rootGraphId = this.rootGraph.id
|
||||
const hostLocator = String(this.id)
|
||||
const rawProperty = this.properties.previewExposures
|
||||
const hasExplicitProperty = Array.isArray(rawProperty)
|
||||
const fromProperty = parsePreviewExposures(rawProperty)
|
||||
if (fromProperty.length) {
|
||||
store.setExposures(rootGraphId, hostLocator, fromProperty)
|
||||
return
|
||||
}
|
||||
if (hasExplicitProperty) {
|
||||
store.setExposures(rootGraphId, hostLocator, [])
|
||||
return
|
||||
}
|
||||
const legacyKey = createNodeLocatorId(null, this.id)
|
||||
const legacy = store.getExposures(rootGraphId, legacyKey)
|
||||
if (legacy.length) {
|
||||
store.setExposures(rootGraphId, hostLocator, [...legacy])
|
||||
return
|
||||
}
|
||||
store.setExposures(rootGraphId, hostLocator, [])
|
||||
}
|
||||
|
||||
rebuildInputWidgetBindings(): void {
|
||||
this.invalidatePromotedViews()
|
||||
|
||||
for (const input of this.inputs) {
|
||||
delete input.widget
|
||||
delete input.pos
|
||||
delete input.widgetId
|
||||
this._clearPromotedWidget(input)
|
||||
const subgraphInput = input._subgraphSlot
|
||||
if (!subgraphInput) continue
|
||||
this._resolveInputWidget(subgraphInput, input)
|
||||
}
|
||||
|
||||
this.invalidatePromotedViews()
|
||||
}
|
||||
|
||||
private _resolveInputWidget(
|
||||
subgraphInput: SubgraphInput,
|
||||
input: INodeInputSlot
|
||||
) {
|
||||
for (const linkId of subgraphInput.linkIds) {
|
||||
const link = this.subgraph.getLink(linkId)
|
||||
if (!link) {
|
||||
console.warn(
|
||||
`[SubgraphNode.configure] No link found for link ID ${linkId}`,
|
||||
this
|
||||
)
|
||||
continue
|
||||
}
|
||||
|
||||
const { inputNode } = link.resolve(this.subgraph)
|
||||
if (!inputNode) {
|
||||
console.warn('Failed to resolve inputNode', link, this)
|
||||
continue
|
||||
}
|
||||
|
||||
const targetInput = inputNode.inputs.find((inp) => inp.link === linkId)
|
||||
if (!targetInput) {
|
||||
console.warn('Failed to find corresponding input', link, inputNode)
|
||||
continue
|
||||
}
|
||||
|
||||
const widget = inputNode.getWidgetFromSlot(targetInput)
|
||||
if (widget) {
|
||||
this._setWidget(subgraphInput, input, widget, targetInput.widget)
|
||||
break
|
||||
}
|
||||
|
||||
// Nested promotion: the source is itself a promoted subgraph input with
|
||||
// no concrete widget. Resolve the deepest interior widget so this input
|
||||
// still receives widget state and a widgetId.
|
||||
const nested = this._resolveNestedPromotedSource(inputNode, targetInput)
|
||||
if (nested) {
|
||||
this._setWidget(subgraphInput, input, nested.widget, targetInput.widget)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private _resolveNestedPromotedSource(
|
||||
inputNode: LGraphNode,
|
||||
targetInput: INodeInputSlot
|
||||
): { node: LGraphNode; widget: IBaseWidget } | undefined {
|
||||
if (!inputNode.isSubgraphNode()) return undefined
|
||||
|
||||
const target = resolveSubgraphInputTarget(inputNode, targetInput.name)
|
||||
if (!target) return undefined
|
||||
|
||||
const resolved = resolveConcretePromotedWidget(
|
||||
inputNode,
|
||||
target.nodeId,
|
||||
target.widgetName
|
||||
)
|
||||
return resolved.status === 'resolved' ? resolved.resolved : undefined
|
||||
}
|
||||
|
||||
private _setWidget(
|
||||
subgraphInput: Readonly<SubgraphInput>,
|
||||
input: INodeInputSlot,
|
||||
interiorWidget: Readonly<IBaseWidget>,
|
||||
inputWidget: IWidgetLocator | undefined
|
||||
) {
|
||||
this.invalidatePromotedViews()
|
||||
|
||||
this._clearPromotedWidget(input)
|
||||
|
||||
input.widget ??= { name: subgraphInput.name }
|
||||
input.widget.name = subgraphInput.name
|
||||
if (inputWidget) Object.setPrototypeOf(input.widget, inputWidget)
|
||||
|
||||
const id = widgetId(this.rootGraph.id, this.id, subgraphInput.name)
|
||||
input.widgetId = id
|
||||
useWidgetValueStore().registerWidget(id, {
|
||||
type: interiorWidget.type,
|
||||
value: interiorWidget.value,
|
||||
options: cloneDeep(interiorWidget.options ?? {}),
|
||||
label: input.label ?? subgraphInput.name,
|
||||
serialize: interiorWidget.serialize,
|
||||
disabled: interiorWidget.disabled,
|
||||
isDOMWidget:
|
||||
'isDOMWidget' in interiorWidget &&
|
||||
typeof interiorWidget.isDOMWidget === 'boolean'
|
||||
? interiorWidget.isDOMWidget
|
||||
: undefined
|
||||
})
|
||||
input._widget =
|
||||
this.createPromotedHostWidget(input, id, interiorWidget) ??
|
||||
this._projectPromotedWidget(input)
|
||||
this._setConcreteSlots()
|
||||
|
||||
this.subgraph.events.dispatch('widget-promoted', {
|
||||
widget: interiorWidget,
|
||||
subgraphNode: this
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* App-layer hook to build a promoted DOM widget; the default falls back to the
|
||||
* store-backed projection. Litegraph core stays free of Vue/Pinia/DOM.
|
||||
*/
|
||||
protected createPromotedHostWidget(
|
||||
_input: INodeInputSlot,
|
||||
_id: WidgetId,
|
||||
_sourceWidget: Readonly<IBaseWidget>
|
||||
): IBaseWidget | undefined {
|
||||
return undefined
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the host widget's `onRemove` (unregistering DOM widgets) and clears it.
|
||||
* Unlike {@link ensureWidgetRemoved}, dispatches no demotion event, so it is
|
||||
* safe on re-resolution.
|
||||
*/
|
||||
private _clearPromotedWidget(input: INodeInputSlot): void {
|
||||
input._widget?.onRemove?.()
|
||||
input._widget = undefined
|
||||
}
|
||||
|
||||
override onAdded(_graph: LGraph): void {
|
||||
this.invalidatePromotedViews()
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name The name of the input slot.
|
||||
* @param type The type of the input slot.
|
||||
* @param inputProperties Properties that are directly assigned to the created input. Default: a new, empty object.
|
||||
* @returns The new input slot.
|
||||
*/
|
||||
override addInput<TInput extends Partial<ISubgraphInput>>(
|
||||
name: string,
|
||||
type: ISlotType,
|
||||
inputProperties: TInput = {} as TInput
|
||||
): INodeInputSlot & TInput {
|
||||
return super.addInput(name, type, inputProperties)
|
||||
}
|
||||
|
||||
override getSlotFromWidget(
|
||||
widget: IBaseWidget | undefined
|
||||
): INodeInputSlot | undefined {
|
||||
if (widget?.widgetId) {
|
||||
const promotedInput = this.inputs.find(
|
||||
(input) => input.widgetId === widget.widgetId
|
||||
)
|
||||
if (promotedInput) return promotedInput
|
||||
}
|
||||
return super.getSlotFromWidget(widget)
|
||||
}
|
||||
|
||||
override getWidgetFromSlot(slot: INodeInputSlot): IBaseWidget | undefined {
|
||||
if (slot._widget) return slot._widget
|
||||
return super.getWidgetFromSlot(slot)
|
||||
}
|
||||
|
||||
override getInputLink(slot: number): LLink | null {
|
||||
const innerLink = this.subgraph.outputNode.slots[slot].getLinks().at(0)
|
||||
if (!innerLink) {
|
||||
console.warn(
|
||||
`SubgraphNode.getInputLink: no inner link found for slot ${slot}`
|
||||
)
|
||||
return null
|
||||
}
|
||||
|
||||
const newLink = LLink.create(innerLink)
|
||||
newLink.origin_id = toNodeId(`${this.id}:${innerLink.origin_id}`)
|
||||
newLink.origin_slot = innerLink.origin_slot
|
||||
|
||||
return newLink
|
||||
}
|
||||
|
||||
/**
|
||||
* @param slot The slot index
|
||||
* @returns The resolved connections, or undefined if no input node is found.
|
||||
*/
|
||||
resolveSubgraphInputLinks(slot: number): ResolvedConnection[] {
|
||||
const inputSlot = this.subgraph.inputNode.slots[slot]
|
||||
const innerLinks = inputSlot.getLinks()
|
||||
if (innerLinks.length === 0) {
|
||||
console.warn(
|
||||
`[SubgraphNode.resolveSubgraphInputLinks] No inner links found for input slot [${slot}] ${inputSlot.name}`,
|
||||
this
|
||||
)
|
||||
return []
|
||||
}
|
||||
return innerLinks.map((link) => link.resolve(this.subgraph))
|
||||
}
|
||||
|
||||
/**
|
||||
* @param slot The slot index
|
||||
* @returns The output node if found, otherwise undefined.
|
||||
*/
|
||||
resolveSubgraphOutputLink(slot: number): ResolvedConnection | undefined {
|
||||
const outputSlot = this.subgraph.outputNode.slots[slot]
|
||||
const innerLink = outputSlot.getLinks().at(0)
|
||||
if (innerLink) {
|
||||
return innerLink.resolve(this.subgraph)
|
||||
}
|
||||
console.warn(
|
||||
`[SubgraphNode.resolveSubgraphOutputLink] No inner link found for output slot [${slot}] ${outputSlot.name}`,
|
||||
this
|
||||
)
|
||||
}
|
||||
|
||||
override getInnerNodes(
|
||||
executableNodes: Map<ExecutionId, ExecutableLGraphNode>,
|
||||
subgraphNodePath: readonly SerializedNodeId[] = [],
|
||||
nodes: ExecutableLGraphNode[] = [],
|
||||
visited = new Set<SubgraphNode>()
|
||||
): ExecutableLGraphNode[] {
|
||||
if (visited.has(this)) {
|
||||
const nodeInfo = `${this.id}${this.title ? ` (${this.title})` : ''}`
|
||||
const subgraphInfo = `'${this.subgraph.name || 'Unnamed Subgraph'}'`
|
||||
const depth = subgraphNodePath.length
|
||||
throw new RecursionError(
|
||||
`Circular reference detected at depth ${depth} in node ${nodeInfo} of subgraph ${subgraphInfo}. ` +
|
||||
`This creates an infinite loop in the subgraph hierarchy.`
|
||||
)
|
||||
}
|
||||
visited.add(this)
|
||||
|
||||
const subgraphInstanceIdPath = [...subgraphNodePath, this.id]
|
||||
|
||||
const parentSubgraphNode = this.rootGraph
|
||||
.resolveSubgraphIdPath(subgraphNodePath.map(toNodeId))
|
||||
.at(-1)
|
||||
const subgraphNodeDto = new ExecutableNodeDTO(
|
||||
this,
|
||||
subgraphNodePath,
|
||||
executableNodes,
|
||||
parentSubgraphNode
|
||||
)
|
||||
executableNodes.set(subgraphNodeDto.id, subgraphNodeDto)
|
||||
|
||||
for (const node of this.subgraph.nodes) {
|
||||
if ('getInnerNodes' in node && node.getInnerNodes) {
|
||||
node.getInnerNodes(
|
||||
executableNodes,
|
||||
subgraphInstanceIdPath,
|
||||
nodes,
|
||||
new Set(visited)
|
||||
)
|
||||
} else {
|
||||
const aVeryRealNode = new ExecutableNodeDTO(
|
||||
node,
|
||||
subgraphInstanceIdPath,
|
||||
executableNodes,
|
||||
this
|
||||
)
|
||||
executableNodes.set(aVeryRealNode.id, aVeryRealNode)
|
||||
nodes.push(aVeryRealNode)
|
||||
}
|
||||
}
|
||||
return nodes
|
||||
}
|
||||
|
||||
override addCustomWidget<TPlainWidget extends IBaseWidget>(
|
||||
customWidget: TPlainWidget
|
||||
): TPlainWidget | WidgetTypeMap[TPlainWidget['type']] {
|
||||
const widget = toConcreteWidget(customWidget, this, false) ?? customWidget
|
||||
this._extraWidgets.push(widget)
|
||||
this._widgetSlotsDirty = true
|
||||
|
||||
if (this.id !== UNASSIGNED_NODE_ID && isNodeBindable(widget)) {
|
||||
widget.setNodeId(this.id)
|
||||
}
|
||||
|
||||
return widget
|
||||
}
|
||||
|
||||
override removeWidget(widget: IBaseWidget): void {
|
||||
this.ensureWidgetRemoved(widget)
|
||||
}
|
||||
|
||||
override ensureWidgetRemoved(widget: IBaseWidget): void {
|
||||
widget.onRemove?.()
|
||||
|
||||
const index = this._extraWidgets.indexOf(widget)
|
||||
if (index !== -1) {
|
||||
this._extraWidgets.splice(index, 1)
|
||||
this._widgetSlotsDirty = true
|
||||
return
|
||||
}
|
||||
|
||||
this.subgraph.events.dispatch('widget-demoted', {
|
||||
widget,
|
||||
subgraphNode: this
|
||||
})
|
||||
}
|
||||
|
||||
override onRemoved(): void {
|
||||
this._eventAbortController.abort()
|
||||
|
||||
for (const input of this.inputs) {
|
||||
if (
|
||||
input._listenerController &&
|
||||
typeof input._listenerController.abort === 'function'
|
||||
) {
|
||||
input._listenerController.abort()
|
||||
}
|
||||
this._clearPromotedWidget(input)
|
||||
}
|
||||
for (const widget of this._extraWidgets) widget.onRemove?.()
|
||||
}
|
||||
override drawTitleBox(
|
||||
ctx: CanvasRenderingContext2D,
|
||||
{
|
||||
scale,
|
||||
low_quality = false,
|
||||
title_height = LiteGraph.NODE_TITLE_HEIGHT,
|
||||
box_size = 10
|
||||
}: DrawTitleBoxOptions
|
||||
): void {
|
||||
if (this.onDrawTitleBox) {
|
||||
this.onDrawTitleBox(ctx, title_height, this.renderingSize, scale)
|
||||
return
|
||||
}
|
||||
ctx.save()
|
||||
ctx.fillStyle = '#3b82f6'
|
||||
ctx.beginPath()
|
||||
ctx.roundRect(6, -24.5, 22, 20, 5)
|
||||
ctx.fill()
|
||||
if (!low_quality) {
|
||||
ctx.translate(25, 23)
|
||||
ctx.scale(-1.5, 1.5)
|
||||
ctx.drawImage(
|
||||
workflowBitmapCache.get(),
|
||||
0,
|
||||
-title_height,
|
||||
box_size,
|
||||
box_size
|
||||
)
|
||||
}
|
||||
ctx.restore()
|
||||
}
|
||||
|
||||
override serialize(): ISerialisedNode {
|
||||
const serialized = super.serialize()
|
||||
const serializedProperties = { ...(serialized.properties ?? {}) }
|
||||
const rootGraphId = this.rootGraph.id
|
||||
const hostLocator = String(this.id)
|
||||
|
||||
const previewExposures = usePreviewExposureStore().getExposures(
|
||||
rootGraphId,
|
||||
hostLocator
|
||||
)
|
||||
serializedProperties.previewExposures = previewExposures.map((entry) => ({
|
||||
...entry
|
||||
}))
|
||||
|
||||
const quarantine = parseProxyWidgetErrorQuarantine(
|
||||
this.properties.proxyWidgetErrorQuarantine
|
||||
)
|
||||
if (quarantine.length === 0) {
|
||||
delete serializedProperties.proxyWidgetErrorQuarantine
|
||||
} else {
|
||||
serializedProperties.proxyWidgetErrorQuarantine = quarantine.map(
|
||||
(entry) => ({ ...entry })
|
||||
)
|
||||
}
|
||||
|
||||
serialized.properties = serializedProperties
|
||||
|
||||
const widgetValues = this.inputs.flatMap((input) => {
|
||||
if (!input.widgetId) return []
|
||||
const value = useWidgetValueStore().getWidget(input.widgetId)?.value
|
||||
return [isWidgetValue(value) ? value : undefined]
|
||||
})
|
||||
|
||||
if (widgetValues.some((value) => value !== undefined)) {
|
||||
serialized.widgets_values = widgetValues
|
||||
} else {
|
||||
delete serialized.widgets_values
|
||||
}
|
||||
|
||||
return serialized
|
||||
}
|
||||
|
||||
override clone() {
|
||||
const clone = super.clone()
|
||||
|
||||
// TODO: Consider deep cloning subgraphs here.
|
||||
|
||||
return clone
|
||||
}
|
||||
getSlotShape(slot: SubgraphInput, extraInput?: INodeInputSlot) {
|
||||
const shapes = slot.linkIds.map(
|
||||
(id) => this.subgraph.links[id]?.resolve(this.subgraph)?.input?.shape
|
||||
)
|
||||
if (extraInput) shapes.push(extraInput.shape)
|
||||
return shapes.every((shape) => shape === shapes[0]) ? shapes[0] : undefined
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
import { t } from '@/i18n'
|
||||
import { type LGraphNode, isComboWidget } from '@/lib/litegraph/src/litegraph'
|
||||
import type {
|
||||
IBaseWidget,
|
||||
IComboWidget,
|
||||
IStringWidget
|
||||
} from '@/lib/litegraph/src/types/widgets'
|
||||
import { nextValueForLinkedTarget } from './valueControl'
|
||||
import { useSettingStore } from '@/platform/settings/settingStore'
|
||||
import { dynamicWidgets } from '@/core/graph/widgets/dynamicWidgets'
|
||||
import { useBooleanWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useBooleanWidget'
|
||||
import { useBoundingBoxWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useBoundingBoxWidget'
|
||||
import { useCurveWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useCurveWidget'
|
||||
import { useChartWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useChartWidget'
|
||||
import { useColorWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useColorWidget'
|
||||
import { useComboWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useComboWidget'
|
||||
import { useCompositorWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useCompositorWidget'
|
||||
import { useFloatWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useFloatWidget'
|
||||
import { useGalleriaWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useGalleriaWidget'
|
||||
import { useBoundingBoxesWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useBoundingBoxesWidget'
|
||||
import { useColorsWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useColorsWidget'
|
||||
import { useImageCompareWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useImageCompareWidget'
|
||||
import { useImageUploadWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useImageUploadWidget'
|
||||
import { useIntWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useIntWidget'
|
||||
import { useMarkdownWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useMarkdownWidget'
|
||||
import { usePainterWidget } from '@/renderer/extensions/vueNodes/widgets/composables/usePainterWidget'
|
||||
import { useRangeWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useRangeWidget'
|
||||
import { useResolutionPreviewWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useResolutionPreviewWidget'
|
||||
import { useStringWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useStringWidget'
|
||||
import { useTextareaWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useTextareaWidget'
|
||||
import { useVideoEditWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useVideoEditWidget'
|
||||
import { transformInputSpecV1ToV2 } from '@/schemas/nodeDef/migration'
|
||||
import type { InputSpec as InputSpecV2 } from '@/schemas/nodeDef/nodeDefSchemaV2'
|
||||
import type { InputSpec } from '@/schemas/nodeDefSchema'
|
||||
|
||||
import type { ComfyApp } from './app'
|
||||
import { IS_CONTROL_WIDGET } from './controlWidgetMarker'
|
||||
import './domWidget'
|
||||
import './errorNodeWidgets'
|
||||
|
||||
export { IS_CONTROL_WIDGET }
|
||||
|
||||
export type ComfyWidgetConstructorV2 = (
|
||||
node: LGraphNode,
|
||||
inputSpec: InputSpecV2
|
||||
) => IBaseWidget
|
||||
|
||||
export type ComfyWidgetConstructor = (
|
||||
node: LGraphNode,
|
||||
inputName: string,
|
||||
inputData: InputSpec,
|
||||
app: ComfyApp,
|
||||
widgetName?: string
|
||||
) => { widget: IBaseWidget; minWidth?: number; minHeight?: number }
|
||||
|
||||
/**
|
||||
* Transforms a V2 widget constructor to a V1 widget constructor.
|
||||
* @param widgetConstructorV2 The V2 widget constructor to transform.
|
||||
* @returns The transformed V1 widget constructor.
|
||||
*/
|
||||
const transformWidgetConstructorV2ToV1 = (
|
||||
widgetConstructorV2: ComfyWidgetConstructorV2
|
||||
): ComfyWidgetConstructor => {
|
||||
return (node, inputName, inputData) => {
|
||||
const inputSpec = transformInputSpecV1ToV2(inputData, {
|
||||
name: inputName
|
||||
})
|
||||
const widget = widgetConstructorV2(node, inputSpec)
|
||||
return {
|
||||
widget,
|
||||
minWidth: widget.options.minNodeSize?.[0],
|
||||
minHeight: widget.options.minNodeSize?.[1]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function controlValueRunBefore() {
|
||||
return useSettingStore().get('Comfy.WidgetControlMode') === 'before'
|
||||
}
|
||||
|
||||
export function updateControlWidgetLabel(widget: IBaseWidget) {
|
||||
if (controlValueRunBefore()) {
|
||||
widget.label = t('g.control_before_generate')
|
||||
} else {
|
||||
widget.label = t('g.control_after_generate')
|
||||
}
|
||||
}
|
||||
|
||||
const HAS_EXECUTED = Symbol()
|
||||
|
||||
export function addValueControlWidget(
|
||||
node: LGraphNode,
|
||||
targetWidget: IBaseWidget,
|
||||
defaultValue?: string,
|
||||
_values?: unknown,
|
||||
widgetName?: string,
|
||||
inputData?: InputSpec
|
||||
): IComboWidget {
|
||||
let name = inputData?.[1]?.control_after_generate
|
||||
if (typeof name !== 'string') {
|
||||
name = widgetName
|
||||
}
|
||||
const widgets = addValueControlWidgets(
|
||||
node,
|
||||
targetWidget,
|
||||
defaultValue ?? 'randomize',
|
||||
{
|
||||
addFilterList: false,
|
||||
controlAfterGenerateName: name
|
||||
},
|
||||
inputData
|
||||
)
|
||||
return widgets[0]
|
||||
}
|
||||
|
||||
export function addValueControlWidgets(
|
||||
node: LGraphNode,
|
||||
targetWidget: IBaseWidget,
|
||||
defaultValue?: string,
|
||||
options?: Record<string, any>,
|
||||
inputData?: InputSpec
|
||||
): [IComboWidget, ...IStringWidget[]] {
|
||||
if (!defaultValue) defaultValue = 'randomize'
|
||||
if (!options) options = {}
|
||||
|
||||
const getName = (defaultName: string, optionName: string) => {
|
||||
let name = defaultName
|
||||
if (options[optionName]) {
|
||||
name = options[optionName]
|
||||
} else if (typeof inputData?.[1]?.[defaultName] === 'string') {
|
||||
name = inputData?.[1]?.[defaultName]
|
||||
} else if (inputData?.[1]?.control_prefix) {
|
||||
name = inputData?.[1]?.control_prefix + ' ' + name
|
||||
}
|
||||
return name
|
||||
}
|
||||
|
||||
const valueControl = node.addWidget(
|
||||
'combo',
|
||||
getName('control_after_generate', 'controlAfterGenerateName'),
|
||||
defaultValue,
|
||||
function () {},
|
||||
{
|
||||
values: ['fixed', 'increment', 'decrement', 'randomize'],
|
||||
serialize: false, // Don't include this in prompt.
|
||||
canvasOnly: true
|
||||
}
|
||||
) as IComboWidget
|
||||
|
||||
valueControl.tooltip =
|
||||
'Allows the linked widget to be changed automatically, for example randomizing the noise seed.'
|
||||
valueControl[IS_CONTROL_WIDGET] = true
|
||||
updateControlWidgetLabel(valueControl)
|
||||
Object.defineProperty(valueControl, 'disabled', {
|
||||
get: () => targetWidget.computedDisabled
|
||||
})
|
||||
const widgets: [IComboWidget, ...IStringWidget[]] = [valueControl]
|
||||
|
||||
const isCombo = isComboWidget(targetWidget)
|
||||
let comboFilter: IStringWidget
|
||||
if (isCombo && valueControl.options.values) {
|
||||
// @ts-expect-error Combo widget values may be a dictionary or legacy function type
|
||||
valueControl.options.values.push('increment-wrap')
|
||||
}
|
||||
if (isCombo && options.addFilterList !== false) {
|
||||
comboFilter = node.addWidget(
|
||||
'string',
|
||||
getName('control_filter_list', 'controlFilterListName'),
|
||||
'',
|
||||
function () {},
|
||||
{
|
||||
serialize: false // Don't include this in prompt.
|
||||
}
|
||||
) as IStringWidget
|
||||
updateControlWidgetLabel(comboFilter)
|
||||
comboFilter.tooltip =
|
||||
"Allows for filtering the list of values when changing the value via the control generate mode. Allows for RegEx matches in the format /abc/ to only filter to values containing 'abc'."
|
||||
Object.defineProperty(comboFilter, 'disabled', {
|
||||
get: () => targetWidget.computedDisabled
|
||||
})
|
||||
|
||||
widgets.push(comboFilter)
|
||||
}
|
||||
|
||||
function applyWidgetControl(isPartialExecution: boolean | undefined) {
|
||||
if (
|
||||
node.inputs?.some(
|
||||
(input) =>
|
||||
input.widget?.name === targetWidget.name && input.link != null
|
||||
)
|
||||
)
|
||||
return
|
||||
|
||||
const next = nextValueForLinkedTarget({
|
||||
target: targetWidget,
|
||||
linkedWidgets: targetWidget.linkedWidgets,
|
||||
nodeId: node.id,
|
||||
isPartialExecution
|
||||
})
|
||||
if (next === undefined) return
|
||||
|
||||
targetWidget.value = next
|
||||
targetWidget.callback?.(next)
|
||||
}
|
||||
|
||||
valueControl.beforeQueued = ({ isPartialExecution } = {}) => {
|
||||
if (controlValueRunBefore()) {
|
||||
// Don't run on first execution
|
||||
if (valueControl[HAS_EXECUTED]) {
|
||||
applyWidgetControl(isPartialExecution)
|
||||
}
|
||||
}
|
||||
valueControl[HAS_EXECUTED] = true
|
||||
}
|
||||
|
||||
valueControl.afterQueued = ({ isPartialExecution } = {}) => {
|
||||
if (!controlValueRunBefore()) {
|
||||
applyWidgetControl(isPartialExecution)
|
||||
}
|
||||
}
|
||||
|
||||
return widgets
|
||||
}
|
||||
|
||||
export const ComfyWidgets = {
|
||||
INT: transformWidgetConstructorV2ToV1(useIntWidget()),
|
||||
FLOAT: transformWidgetConstructorV2ToV1(useFloatWidget()),
|
||||
BOOLEAN: transformWidgetConstructorV2ToV1(useBooleanWidget()),
|
||||
STRING: transformWidgetConstructorV2ToV1(useStringWidget()),
|
||||
MARKDOWN: transformWidgetConstructorV2ToV1(useMarkdownWidget()),
|
||||
COMBO: transformWidgetConstructorV2ToV1(useComboWidget()),
|
||||
IMAGEUPLOAD: useImageUploadWidget(),
|
||||
COLOR: transformWidgetConstructorV2ToV1(useColorWidget()),
|
||||
IMAGECOMPARE: transformWidgetConstructorV2ToV1(useImageCompareWidget()),
|
||||
BOUNDING_BOX: transformWidgetConstructorV2ToV1(useBoundingBoxWidget()),
|
||||
CHART: transformWidgetConstructorV2ToV1(useChartWidget()),
|
||||
GALLERIA: transformWidgetConstructorV2ToV1(useGalleriaWidget()),
|
||||
PAINTER: transformWidgetConstructorV2ToV1(usePainterWidget()),
|
||||
COMPOSITOR: transformWidgetConstructorV2ToV1(useCompositorWidget()),
|
||||
TEXTAREA: transformWidgetConstructorV2ToV1(useTextareaWidget()),
|
||||
CURVE: transformWidgetConstructorV2ToV1(useCurveWidget()),
|
||||
RANGE: transformWidgetConstructorV2ToV1(useRangeWidget()),
|
||||
VIDEO_EDIT: transformWidgetConstructorV2ToV1(useVideoEditWidget()),
|
||||
RESOLUTION_PREVIEW: transformWidgetConstructorV2ToV1(
|
||||
useResolutionPreviewWidget()
|
||||
),
|
||||
BOUNDING_BOXES: transformWidgetConstructorV2ToV1(useBoundingBoxesWidget()),
|
||||
COLORS: transformWidgetConstructorV2ToV1(useColorsWidget()),
|
||||
...dynamicWidgets
|
||||
} as const
|
||||
|
||||
export function isValidWidgetType(
|
||||
key: unknown
|
||||
): key is keyof typeof ComfyWidgets {
|
||||
return ComfyWidgets[key as keyof typeof ComfyWidgets] !== undefined
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
import type {
|
||||
ExecutableLGraphNode,
|
||||
ExecutionId,
|
||||
LGraph
|
||||
} from '@/lib/litegraph/src/litegraph'
|
||||
import {
|
||||
ExecutableNodeDTO,
|
||||
LGraphEventMode
|
||||
} from '@/lib/litegraph/src/litegraph'
|
||||
import type {
|
||||
ComfyApiWorkflow,
|
||||
ComfyWorkflowJSON
|
||||
} from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||
|
||||
import { compressWidgetInputSlots } from './litegraphUtil'
|
||||
|
||||
/**
|
||||
* Converts the current graph workflow for sending to the API.
|
||||
* @note Node widgets are updated before serialization to prepare queueing.
|
||||
*
|
||||
* @param graph The graph to convert.
|
||||
* @param options The options for the conversion.
|
||||
* - `sortNodes`: Whether to sort the nodes by execution order.
|
||||
* @returns The workflow and node links
|
||||
*/
|
||||
export const graphToPrompt = async (
|
||||
graph: LGraph,
|
||||
options: { sortNodes?: boolean } = {}
|
||||
): Promise<{ workflow: ComfyWorkflowJSON; output: ComfyApiWorkflow }> => {
|
||||
const { sortNodes = false } = options
|
||||
|
||||
for (const node of graph.computeExecutionOrder(false)) {
|
||||
const innerNodes = node.getInnerNodes
|
||||
? node.getInnerNodes(new Map())
|
||||
: [node]
|
||||
for (const innerNode of innerNodes) {
|
||||
if (innerNode.isVirtualNode) {
|
||||
innerNode.applyToGraph?.()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const workflow = graph.serialize({ sortNodes })
|
||||
|
||||
// Remove localized_name from the workflow
|
||||
for (const node of workflow.nodes) {
|
||||
for (const slot of node.inputs ?? []) {
|
||||
delete slot.localized_name
|
||||
}
|
||||
for (const slot of node.outputs ?? []) {
|
||||
delete slot.localized_name
|
||||
}
|
||||
}
|
||||
|
||||
compressWidgetInputSlots(workflow)
|
||||
workflow.extra ??= {}
|
||||
workflow.extra.frontendVersion = __COMFYUI_FRONTEND_VERSION__
|
||||
|
||||
const nodeDtoMap = new Map<ExecutionId, ExecutableLGraphNode>()
|
||||
for (const node of graph.computeExecutionOrder(false)) {
|
||||
const dto: ExecutableLGraphNode = new ExecutableNodeDTO(
|
||||
node,
|
||||
[],
|
||||
nodeDtoMap
|
||||
)
|
||||
|
||||
nodeDtoMap.set(dto.id, dto)
|
||||
|
||||
if (
|
||||
node.mode === LGraphEventMode.NEVER ||
|
||||
node.mode === LGraphEventMode.BYPASS
|
||||
) {
|
||||
continue
|
||||
}
|
||||
|
||||
for (const innerNode of dto.getInnerNodes()) {
|
||||
nodeDtoMap.set(innerNode.id, innerNode)
|
||||
}
|
||||
}
|
||||
|
||||
const output: ComfyApiWorkflow = {}
|
||||
// Process nodes in order of execution
|
||||
for (const node of nodeDtoMap.values()) {
|
||||
// Don't serialize muted nodes
|
||||
if (
|
||||
node.isVirtualNode ||
|
||||
node.mode === LGraphEventMode.NEVER ||
|
||||
node.mode === LGraphEventMode.BYPASS
|
||||
) {
|
||||
continue
|
||||
}
|
||||
|
||||
const inputs: ComfyApiWorkflow[string]['inputs'] = {}
|
||||
const { widgets } = node
|
||||
|
||||
// Store all widget values in the API prompt.
|
||||
// Note: widget.options.serialize controls prompt inclusion (checked here).
|
||||
// widget.serialize controls workflow persistence (checked by LGraphNode).
|
||||
if (widgets) {
|
||||
for (const [i, widget] of widgets.entries()) {
|
||||
if (!widget.name || widget.options?.serialize === false) continue
|
||||
|
||||
const widgetValue = widget.serializeValue
|
||||
? await widget.serializeValue(node, i)
|
||||
: widget.value
|
||||
// By default, Array values are reserved to represent node connections.
|
||||
// We need to wrap the array as an object to avoid the misinterpretation
|
||||
// of the array as a node connection.
|
||||
// The backend automatically unwraps the object to an array during
|
||||
// execution.
|
||||
inputs[widget.name] =
|
||||
widget.type === 'curve' && widgetValue != null
|
||||
? { __type__: 'CURVE', __value__: widgetValue }
|
||||
: Array.isArray(widgetValue)
|
||||
? { __value__: widgetValue }
|
||||
: widgetValue
|
||||
}
|
||||
}
|
||||
|
||||
// Store all node links
|
||||
for (const [i, input] of node.inputs.entries()) {
|
||||
const resolvedInput = node.resolveInput(i)
|
||||
if (!resolvedInput) continue
|
||||
|
||||
// Resolved to an actual widget value rather than a node connection
|
||||
if (resolvedInput.widgetInfo) {
|
||||
const { value } = resolvedInput.widgetInfo
|
||||
inputs[input.name] = Array.isArray(value) ? { __value__: value } : value
|
||||
continue
|
||||
}
|
||||
|
||||
inputs[input.name] = [
|
||||
String(resolvedInput.origin_id),
|
||||
// @ts-expect-error link.origin_slot is already number.
|
||||
parseInt(resolvedInput.origin_slot)
|
||||
]
|
||||
}
|
||||
|
||||
output[String(node.id)] = {
|
||||
inputs,
|
||||
// TODO(huchenlei): Filter out all nodes that cannot be mapped to a
|
||||
// comfyClass.
|
||||
class_type: node.comfyClass!,
|
||||
// Ignored by the backend.
|
||||
_meta: {
|
||||
title: node.title
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove inputs connected to removed nodes
|
||||
for (const { inputs } of Object.values(output)) {
|
||||
for (const [i, input] of Object.entries(inputs)) {
|
||||
if (Array.isArray(input) && input.length === 2 && !output[input[0]]) {
|
||||
delete inputs[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return { workflow: workflow as ComfyWorkflowJSON, output }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"id": "core",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"tag": "v0.36.0",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tree": "07d05b1df1e6c1ddebf15abad147fa90276f2621"
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"tag": "v1.52.7",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tree": "8e78753b31d405a4f33293106845998ba121f89c"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,256 @@
|
||||
{
|
||||
"sources": [
|
||||
{
|
||||
"id": "core",
|
||||
"file": "LICENSE",
|
||||
"local_file": "core__LICENSE",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/LICENSE",
|
||||
"sha256": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986",
|
||||
"git_blob_sha1": "f288702d2fa16d3cdf0035b15a9fcbc552cd88e7",
|
||||
"fetched_at": "2026-10-30T19:05:03.007854+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "core",
|
||||
"file": "nodes.py",
|
||||
"local_file": "core__nodes.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/nodes.py",
|
||||
"sha256": "34a483b59eed6bc407e74cd860cba7cae542f494fdff29bb15138369f78387a7",
|
||||
"git_blob_sha1": "1728899fef8c04ea580b2d3189e2225b3c28d85e",
|
||||
"fetched_at": "2026-10-30T19:05:03.012203+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "core",
|
||||
"file": "comfy_extras/nodes_moge.py",
|
||||
"local_file": "core__comfy_extras__nodes_moge.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/comfy_extras/nodes_moge.py",
|
||||
"sha256": "08a4a51f5e6b0dd307ec575bb12f4d29c82c10f338199230bfad8d4eb601e1f3",
|
||||
"git_blob_sha1": "819421534dbb73e632028ce50579f9d7c8409d14",
|
||||
"fetched_at": "2026-10-30T19:05:03.013942+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "core",
|
||||
"file": "comfy_extras/nodes_images.py",
|
||||
"local_file": "core__comfy_extras__nodes_images.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/comfy_extras/nodes_images.py",
|
||||
"sha256": "5bc0a44ee22469506d5c86fccde5f4973d156b2356e0ced6a779d1299b0f1acf",
|
||||
"git_blob_sha1": "9949fd1bd23ba26f721e5c5c9d235186d60eb573",
|
||||
"fetched_at": "2026-10-30T19:05:03.016422+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "core",
|
||||
"file": "comfy_extras/nodes_post_processing.py",
|
||||
"local_file": "core__comfy_extras__nodes_post_processing.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/comfy_extras/nodes_post_processing.py",
|
||||
"sha256": "4ee06e8e5911c844ba49d97e54c90081c539d57e6dc53f1185900e3a79ce4c98",
|
||||
"git_blob_sha1": "27f51c44fd4bdb74e9d5f0eef82be8b29e1c20c0",
|
||||
"fetched_at": "2026-10-30T19:05:03.017942+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "core",
|
||||
"file": "comfy_api/latest/_io.py",
|
||||
"local_file": "core__comfy_api__latest___io.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/comfy_api/latest/_io.py",
|
||||
"sha256": "e697ed00732deffb46d7a017d82dae48ee2504a8d356f911a1447ec6146294f7",
|
||||
"git_blob_sha1": "cdaaba99853e772451209a4253b88872e6e3f65b",
|
||||
"fetched_at": "2026-10-30T19:05:03.022525+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "core",
|
||||
"file": "comfy/ldm/moge/model.py",
|
||||
"local_file": "core__comfy__ldm__moge__model.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/comfy/ldm/moge/model.py",
|
||||
"sha256": "e35f08e8b42b8b8d2d4860b4f1d1f7ca9da5a67b211005bead9f62d2cff9b492",
|
||||
"git_blob_sha1": "8dd280c630afa821ce01452e476fb2d0539611e8",
|
||||
"fetched_at": "2026-10-30T19:05:03.729897+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "core",
|
||||
"file": "folder_paths.py",
|
||||
"local_file": "core__folder_paths.py",
|
||||
"commit": "ee71d5c4993f29086b27fde1629a945ae48425bf",
|
||||
"tag": "v0.36.0",
|
||||
"repo": "Comfy-Org/ComfyUI",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/ee71d5c4993f29086b27fde1629a945ae48425bf/folder_paths.py",
|
||||
"sha256": "b748be5d1e068ad673f6c4de069fb6b7b723405c40ae3c3c44465d416f7df2db",
|
||||
"git_blob_sha1": "6723e52c867c57003e9ba4ed53ae58f8d79a7752",
|
||||
"fetched_at": "2026-10-30T19:05:04.459292+00:00",
|
||||
"license_file": "core__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"file": "LICENSE",
|
||||
"local_file": "frontend__LICENSE",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/LICENSE",
|
||||
"sha256": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986",
|
||||
"git_blob_sha1": "f288702d2fa16d3cdf0035b15a9fcbc552cd88e7",
|
||||
"fetched_at": "2026-10-30T19:05:04.490203+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"file": "src/lib/litegraph/LICENSE",
|
||||
"local_file": "frontend__src__lib__litegraph__LICENSE",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/src/lib/litegraph/LICENSE",
|
||||
"sha256": "1b38cc30fe774bcc77538ab99eb460f4e1c8a47c4fddc6e991ee3b5cc2a96bb9",
|
||||
"git_blob_sha1": "1b52aa11c186c25f8d66f1de74c0d378851bfcff",
|
||||
"fetched_at": "2026-10-30T19:05:04.491668+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"file": "src/lib/litegraph/src/LGraphNode.ts",
|
||||
"local_file": "frontend__src__lib__litegraph__src__LGraphNode.ts",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/src/lib/litegraph/src/LGraphNode.ts",
|
||||
"sha256": "d6263d56f28a5e6c5a95a3a263fe0d6ffe4083a981c01a14ec4ebfca43487e50",
|
||||
"git_blob_sha1": "38723cce556962cb80456239df383d49469134d9",
|
||||
"fetched_at": "2026-10-30T19:05:04.497705+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"file": "src/lib/litegraph/src/subgraph/SubgraphNode.ts",
|
||||
"local_file": "frontend__src__lib__litegraph__src__subgraph__SubgraphNode.ts",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/src/lib/litegraph/src/subgraph/SubgraphNode.ts",
|
||||
"sha256": "e204cd7be49ad0d48b16395dc26f6a086ca5be25a3bc0817831139255578219a",
|
||||
"git_blob_sha1": "3b9efa1b4fca5c6f30f0cd7009223b60f635e9cc",
|
||||
"fetched_at": "2026-10-30T19:05:04.501456+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"file": "src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts",
|
||||
"local_file": "frontend__src__lib__litegraph__src__subgraph__ExecutableNodeDTO.ts",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts",
|
||||
"sha256": "64baa71b46bd67440b032e18e4d9aebb67a6cc135fe7c4509ae1b5bc25acc2a3",
|
||||
"git_blob_sha1": "35220e8b093297bd6d3185b343d67d512309ccc5",
|
||||
"fetched_at": "2026-10-30T19:05:04.503759+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"file": "src/scripts/widgets.ts",
|
||||
"local_file": "frontend__src__scripts__widgets.ts",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/src/scripts/widgets.ts",
|
||||
"sha256": "07e91bf2d16056938f7ce50a1ac90c8f5be9faa27d6bec3d2060e529da139257",
|
||||
"git_blob_sha1": "0100f21b03e3aa0cb551ca48f4886ca1d66c3bc2",
|
||||
"fetched_at": "2026-10-30T19:05:04.506870+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"file": "src/extensions/core/uploadImage.ts",
|
||||
"local_file": "frontend__src__extensions__core__uploadImage.ts",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/src/extensions/core/uploadImage.ts",
|
||||
"sha256": "48d062c2ee95bd77c537c539e6c8f8bc03bd71dcec94c5b82487c014ea3e9c06",
|
||||
"git_blob_sha1": "58e43bb218171534c4713bdced29171ecb96d903",
|
||||
"fetched_at": "2026-10-30T19:05:04.508444+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"file": "src/extensions/core/noteNode.ts",
|
||||
"local_file": "frontend__src__extensions__core__noteNode.ts",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/src/extensions/core/noteNode.ts",
|
||||
"sha256": "c70540cab6b4fa8ba8864946ede1ee576c1f6d39ed74be1810690a989d4c9481",
|
||||
"git_blob_sha1": "d26e1e317c200bc93086778ef694af87fdf79529",
|
||||
"fetched_at": "2026-10-30T19:05:04.511005+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"file": "src/core/graph/widgets/dynamicWidgets.ts",
|
||||
"local_file": "frontend__src__core__graph__widgets__dynamicWidgets.ts",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/src/core/graph/widgets/dynamicWidgets.ts",
|
||||
"sha256": "9c4e7d9abfe9de813d11c2ac58a79d4068f91fbe07a634d674aa3c227a19633f",
|
||||
"git_blob_sha1": "55541765c4e6a75e68f3ac9f9a223133f284059e",
|
||||
"fetched_at": "2026-10-30T19:05:04.512587+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
},
|
||||
{
|
||||
"id": "frontend",
|
||||
"file": "src/utils/executionUtil.ts",
|
||||
"local_file": "frontend__src__utils__executionUtil.ts",
|
||||
"commit": "1a7a6b82514874545dc5e8203d0bd2188c2d9b18",
|
||||
"tag": "v1.52.7",
|
||||
"repo": "Comfy-Org/ComfyUI_frontend",
|
||||
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/1a7a6b82514874545dc5e8203d0bd2188c2d9b18/src/utils/executionUtil.ts",
|
||||
"sha256": "9ba4e7ceadda90f54389cc6c81331cbc590c79a24073356ef8f87643a13a134a",
|
||||
"git_blob_sha1": "be2b26e09191a7ee1e66f638d9f64427c018ac72",
|
||||
"fetched_at": "2026-10-30T19:05:04.514158+00:00",
|
||||
"license_file": "frontend__LICENSE",
|
||||
"transport": "git show exact tag; no checkout"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
// Local GET-only: 89 saved positions, three complete Notes, 35 frozen summaries.
|
||||
import fs from 'node:fs';
|
||||
import assert from 'node:assert/strict';
|
||||
const { chromium } = await import(process.env.PLAYWRIGHT_MODULE || 'playwright');
|
||||
const out='.local-evidence/moge3-document/browser';fs.mkdirSync(out,{recursive:true});
|
||||
const checks=[],requests=[],errors=[],blockedFonts=[],assertionGroups={},interceptions=[];let group='aggregate';
|
||||
function check(condition,label){assert.ok(condition,label);checks.push(label);assertionGroups[group]=(assertionGroups[group]||0)+1;console.log('PASS '+label);}
|
||||
const browser=await chromium.launch({headless:true,executablePath:process.env.BROWSER_EXECUTABLE});
|
||||
try {
|
||||
const page=await browser.newPage({viewport:{width:1440,height:1000}});
|
||||
await page.route('**/*',route=>{
|
||||
const u=new URL(route.request().url());
|
||||
if(u.hostname==='fonts.googleapis.com'){blockedFonts.push(String(u));return route.fulfill({contentType:'text/css',body:''});}
|
||||
if(route.request().method()!=='GET'||u.hostname!=='127.0.0.1'||u.pathname==='/api/view'||(/\.(mp4|png|wav|mp3|webm)$/i.test(u.pathname)&&u.pathname!=='/favicon.png')){errors.push('Forbidden request '+u);return route.abort();}
|
||||
return route.continue();
|
||||
});
|
||||
page.on('request',r=>{if(r.url().includes('/api/'))requests.push({method:r.method(),url:r.url()});});
|
||||
page.on('pageerror',e=>errors.push(e.message));
|
||||
requests.push({method:'GET',url:'http://127.0.0.1:8247/api/workflows'});
|
||||
const records=await(await fetch('http://127.0.0.1:8247/api/workflows')).json();
|
||||
const names=['moge3_深度图_几何图_线稿图','Seedvr2_视频放大FOR循环长视频','VOSR2_视频放大_分批循环长视频','视频模型放大插帧(简单快速版)','图像放大比较','VOSR2_图像超分放大','Seedvr2_3b_int8_视频放大','Seedvr2_3b_int8_图像放大','RTX_video_upscale','RTX_image_upscale','手动按分镜视频截取','sam3_图像视频-提示词遮罩分割','多视频合成分屏展示','图像4种添加水印节点','birefnet_图像移除背景','加载本地latent解码','截取视频每一帧','双图像或视频合并显示','视频转gif动图图片','加载图片合成视频','视频倒放','NLF_视频人物动作骨架获取','openpose-video-姿态检测','sdpose_视频人物姿势骨架提取','gemma4_提示词反推(图像视频音频)','图像合并成四宫格','图像分割-多宫格分割','Qwen_image2.1_图像编辑_背景移除','Qwen_image2.1_图像编辑_提示词增强','Qwen_image2.1_文生图_提示词增强','ControlNet_aux_常用样例','Qwen3-ASR-语音转文字','Qwen3-ASR-Subtitle语音转字幕','Minimax-H3提示词增强','音频转MP3格式','音频人声分离','视频-音频分离','图像嵌入文字描述'];
|
||||
const details=[];
|
||||
for(const name of names){const r=records.find(r=>r.name===name);assert.ok(r);const url=`http://127.0.0.1:8247/api/workflows/${r.id}`;requests.push({method:'GET',url});details.push(await(await fetch(url)).json());}
|
||||
check(details.length===38&&details.reduce((n,d)=>n+d.doc_json.fixed_version.fields.length,0)===1348,'38图1348保存位置');
|
||||
check(details.reduce((n,d)=>n+(d.doc_json.source_notes?.length||0),0)===41,'38图41源注释');
|
||||
await page.goto('http://127.0.0.1:5173/connections',{waitUntil:'networkidle'});
|
||||
const dialog=page.getByRole('dialog',{name:'工作流说明'});
|
||||
const fixedCard=dialog.locator('.card').filter({has:page.getByText('固定版本参数说明',{exact:true})});
|
||||
async function begin(name){const row=page.locator('.wf-row').filter({has:page.locator('.wf-name').filter({hasText:name})}).first();const button=row.getByRole('button',{name:'说明',exact:true});await button.focus();await page.keyboard.press('Enter');return button;}
|
||||
async function loaded(){await dialog.getByText('用途与来源',{exact:true}).waitFor();await dialog.evaluate(el=>Promise.all(el.getAnimations().map(a=>a.finished)));}
|
||||
for(const width of [1440,390]){
|
||||
await page.setViewportSize({width,height:width===390?844:1000});
|
||||
for(const d of details){
|
||||
group=details.indexOf(d)<1?'new_moge3':'old_thirty_seven';const b=d.doc_json.fixed_version,button=await begin(d.name);await loaded();
|
||||
const overview=dialog.locator('.card').filter({has:page.getByText('用途与来源',{exact:true})});
|
||||
check((await overview.innerText()).includes(b.user_overview),`${width} ${d.name}默认中文用途`);
|
||||
check(!(await dialog.getByText('源图与审校记录',{exact:true}).locator('..').evaluate(el=>el.open)),`${width} ${d.name}源审校默认折叠`);
|
||||
check(!(await dialog.getByText('核对范围与来源依据',{exact:true}).locator('..').evaluate(el=>el.open)),`${width} ${d.name}技术范围默认折叠`);
|
||||
const visible=await fixedCard.innerText();
|
||||
check(!visible.includes('执行标量')&&!visible.includes('widgetId')&&!visible.includes(b.source_sha256)&&!visible.includes('UUID'),`${width} ${d.name}默认无执行计数/实现标识`);
|
||||
check(visible.includes('依据固定版本整理,目标环境与实际效果未核对。'),`${width} ${d.name}默认依据限制可见`);
|
||||
for(const t of ['说明未定稿','未验证实跑','未检查'])check((await dialog.innerText()).includes(t),`${width} ${d.name} ${t}`);
|
||||
check(!d.is_enabled&&!d.doc_completed_at&&!d.exec_verified_at,`${width} ${d.name}停用/时间戳空`);
|
||||
check(await fixedCard.locator('summary').filter({hasText:/^节点 [\d:]+ · /}).count()===b.fields.length,`${width} ${d.name}参数全保留`);
|
||||
check(await dialog.locator('.drawer-body').evaluate(el=>el.scrollWidth<=el.clientWidth),`${width} ${d.name}默认无溢出`);
|
||||
await dialog.locator('.drawer-body').evaluate(el=>el.scrollTop=0);
|
||||
if(details.indexOf(d)<1)await page.screenshot({path:`${out}/${width}-${d.id}-default.png`});
|
||||
if(details.indexOf(d)>0){await page.keyboard.press('Escape');await dialog.waitFor({state:'hidden'});check(await button.evaluate(el=>el===document.activeElement),`${width} ${d.name}旧图归还焦点`);continue;}
|
||||
await dialog.getByText('源图与审校记录',{exact:true}).click();
|
||||
check((await overview.innerText()).includes(d.doc_json.purpose)&&(await overview.innerText()).includes(d.source_repo_path),`${width} ${d.name}原用途/源路径展开保留`);
|
||||
await dialog.getByText('核对范围与来源依据',{exact:true}).click();
|
||||
const flowText=await fixedCard.innerText();check(flowText.includes('被连线覆盖 16 项')&&flowText.includes('仅前端控制 0 项'),`${width}准确覆盖与前端位置计数`);
|
||||
for(const line of b.flow)check(flowText.includes(line),`${width} ${d.name}展开流程 ${b.flow.indexOf(line)}`);
|
||||
if(width===1440){await fixedCard.getByText(b.flow[2],{exact:true}).evaluate(el=>el.scrollIntoView({block:'center'}));await page.screenshot({path:`${out}/${width}-${d.id}-branch-flow.png`});}
|
||||
await dialog.getByText('版本、源图与连线依据',{exact:true}).click();
|
||||
check((await fixedCard.innerText()).includes(b.source_sha256)&&b.versions.every(v=>(v&&true)),`${width} ${d.name}原件摘要可展开`);
|
||||
const versionText=await fixedCard.innerText();
|
||||
for(const v of b.versions)check(versionText.includes(v),`${width} ${d.name}版本 ${b.versions.indexOf(v)}`);
|
||||
if(details.indexOf(d)<1){
|
||||
for(const f of b.fields){
|
||||
const summary=fixedCard.locator(`details[data-fixed-field="${f.pointer}"] > summary`);await summary.focus();await page.keyboard.press('Enter');const box=summary.locator('..');
|
||||
check(await box.evaluate(el=>el.open),`${width} ${f.node_id}.${f.field}键盘展开`);
|
||||
let text=await box.innerText();check(text.includes(f.effect)&&text.includes(f.limits)&&text.includes(f.schema_default)&&text.includes(f.execution_note)&&text.includes(f.unit),`${width} ${f.node_id}.${f.field}用途/单位/范围/来源条件`);
|
||||
check(await box.locator(':scope > pre').textContent()===(typeof f.value==='string'?f.value:JSON.stringify(f.value,null,2)),`${width} ${f.node_id}.${f.field}精确保留现值`);
|
||||
check(!text.includes(f.pointer),`${width} ${f.node_id}.${f.field}指针默认折叠`);
|
||||
await box.getByText('来源依据',{exact:true}).click();text=await box.innerText();
|
||||
check(text.includes(f.pointer)&&text.includes(f.named_pointer)&&text.includes(f.class_type)&&text.includes(f.json_type)&&f.evidence.every(i=>{const e=b.sources[i];return text.includes(e.commit)&&text.includes(e.sha256)&&text.includes(e.lines.join('~'));}),`${width} ${f.node_id}.${f.field}精确源码/类型/指针`);
|
||||
check(await dialog.locator('.drawer-body').evaluate(el=>el.scrollWidth<=el.clientWidth),`${width} ${f.node_id}.${f.field}展开无溢出`);
|
||||
if(f.node_id==='7:2'&&f.field==='refine_steps')await page.screenshot({path:`${out}/${width}-${d.id}-fixed-sources-corrected.png`});
|
||||
if((width===1440&&f.field==='output'&&f.node_id==='7')||(width===390&&f.field==='resize_type.width'&&f.node_id==='111:110'))await page.screenshot({path:`${out}/${width}-${d.id}-${f.node_id}-${f.field}.png`});
|
||||
await summary.click();
|
||||
}
|
||||
for(const n of b.comments){const summary=dialog.getByText(`节点 ${n.node_id}`,{exact:true});await summary.click();const expected=d.doc_json.source_notes.find(x=>String(x.node_id)===n.node_id);check(await summary.locator('..').locator('pre').textContent()===JSON.stringify(expected.content,null,2),`${width}注释${n.node_id}全文`);check(await dialog.locator('.drawer-body').evaluate(el=>el.scrollWidth<=el.clientWidth),`${width}注释${n.node_id}无溢出`);if(width===390){await summary.evaluate(el=>el.scrollIntoView({block:'start'}));await page.screenshot({path:`${out}/${width}-${d.id}-${n.node_id}-note.png`});}await summary.click();}
|
||||
await dialog.getByRole('button',{name:'关闭',exact:true}).focus();await page.keyboard.press('Tab');check(await dialog.evaluate(el=>el.contains(document.activeElement)),`${width}Tab焦点保留`);await page.keyboard.press('Shift+Tab');check(await dialog.evaluate(el=>el.contains(document.activeElement)),`${width}ShiftTab焦点保留`);
|
||||
}
|
||||
await page.keyboard.press('Escape');await dialog.waitFor({state:'hidden'});check(await button.evaluate(el=>el===document.activeElement),`${width} ${d.name}关闭归还焦点`);
|
||||
}
|
||||
}
|
||||
group='shared_regressions';
|
||||
for(const name of ['旧工作流回退(隔离测试夹具)','空说明回退(隔离测试夹具)']){await begin(name);await loaded();check((await dialog.innerText()).includes('隔离库旧条目回退测试'),'旧/空说明回退 '+name);await page.keyboard.press('Escape');}
|
||||
// Missing summary and mismatched bindings are tested with local GET fixtures, without writes.
|
||||
for(const variant of ['missing-overview','mismatched','html-summary']){
|
||||
const d=structuredClone(details[0]);
|
||||
if(variant==='missing-overview')delete d.doc_json.fixed_version.user_overview;
|
||||
if(variant==='mismatched')d.doc_json.fixed_version={matched:false,notice:'固定版本参数说明待核对:源文件、声明版本或说明依据未匹配,未采用旧定义。'};
|
||||
if(variant==='html-summary')d.doc_json.fixed_version.user_overview='<img src="https://example.invalid/forbidden">仅纯文本';
|
||||
await page.route(`**/api/workflows/${d.id}`,route=>{interceptions.push({variant,url:route.request().url()});return route.fulfill({json:d});});await begin(d.name);await loaded();
|
||||
if(variant==='missing-overview')check((await dialog.innerText()).includes('这张图的用途和操作重点可在下方使用步骤中查看;目标环境与实际效果仍待核对。'),'缺摘要自然中文回退');
|
||||
if(variant==='mismatched')check((await dialog.innerText()).includes(d.doc_json.fixed_version.notice)&&!await dialog.getByText('核对范围与来源依据',{exact:true}).count(),'错绑定提示明确且不展示旧字段');
|
||||
if(variant==='html-summary')check((await dialog.innerText()).includes(d.doc_json.fixed_version.user_overview)&&await dialog.locator('img').count()===0,'摘要HTML仅纯文本不创建图像或请求');
|
||||
check(!(await dialog.innerText()).includes('undefined'),'回退不暴露undefined');await page.keyboard.press('Escape');await page.unroute(`**/api/workflows/${d.id}`);
|
||||
}
|
||||
let release,entered,delivered;const hold=new Promise(r=>release=r),intercept=new Promise(r=>entered=r),done=new Promise(r=>delivered=r);
|
||||
await page.route(`**/api/workflows/${details[0].id}`,async route=>{interceptions.push({variant:"late",url:route.request().url()});entered();await hold;await route.fulfill({json:details[0]});delivered();});
|
||||
await begin(details[0].name);await intercept;await page.keyboard.press('Escape');await begin(details[1].name);await loaded();release();await done;
|
||||
check((await dialog.innerText()).includes(details[1].doc_json.fixed_version.user_overview)&&await fixedCard.locator('summary').filter({hasText:/^节点 [\d:]+ · /}).count()===details[1].doc_json.fixed_version.fields.length,'迟到MoGe响应不覆盖旧SeedVR摘要/86字段');await page.keyboard.press('Escape');await page.unroute(`**/api/workflows/${details[0].id}`);
|
||||
await page.route(`**/api/workflows/${details[0].id}`,route=>{interceptions.push({variant:'failure',url:route.request().url()});return route.fulfill({status:500,json:{detail:'隔离失败夹具'}});});await begin(details[0].name);await dialog.getByRole('alert').waitFor({timeout:20000});check(await dialog.getByRole('button',{name:'重试',exact:true}).isVisible(),'GET失败显示重试');check(await dialog.getByText('用途与来源',{exact:true}).count()===0,'读取失败隐藏旧摘要');await page.unroute(`**/api/workflows/${details[0].id}`);await dialog.getByRole('button',{name:'重试',exact:true}).click();await loaded();check((await dialog.innerText()).includes(details[0].doc_json.fixed_version.user_overview),'重试恢复摘要');await page.keyboard.press('Escape');
|
||||
check(errors.length===0,'无脚本错误或禁止请求 '+JSON.stringify(errors));check(requests.every(r=>r.method==='GET'&&new URL(r.url).hostname==='127.0.0.1'&&!r.url.includes('/api/view')),'全程本地GET无写/生成/目标/历史预览请求');
|
||||
const polling=requests.filter(r=>['/api/jobs','/api/events'].includes(new URL(r.url).pathname));
|
||||
const fixed=requests.filter(r=>!polling.includes(r));
|
||||
const frequencies=rs=>Object.fromEntries([...new Set(rs.map(r=>new URL(r.url).pathname))].sort().map(p=>[p,rs.filter(r=>new URL(r.url).pathname===p).length]));
|
||||
fs.writeFileSync(`${out}/browser-results.json`,JSON.stringify({request_accounting:{fixed_count:fixed.length,fixed_paths:frequencies(fixed),polling_count:polling.length,polling_paths:frequencies(polling),polling_tolerance:1,reason:'定时轮询可因浏览耗时与计时器边界相差±1;固定请求逐条保存,不忽略真实新请求,禁止请求零容忍。'},assertion_count:checks.length,assertionGroups,interceptions,checks,requests,errors,blockedFonts,viewports:[1440,390]},null,2));
|
||||
} finally {await browser.close();}
|
||||
@@ -0,0 +1,95 @@
|
||||
"""Foreground local browser check; stop every owned service before returning."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import signal
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
OUT = ROOT / ".local-evidence/moge3-document/browser"
|
||||
|
||||
|
||||
def main():
|
||||
OUT.mkdir(parents=True, exist_ok=True)
|
||||
# Refuse to reuse another operator's service or port.
|
||||
import socket
|
||||
|
||||
for port in (8247, 5173):
|
||||
with socket.socket() as sock:
|
||||
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
sock.bind(("127.0.0.1", port))
|
||||
processes = []
|
||||
logs = []
|
||||
try:
|
||||
commands = [
|
||||
([sys.executable, str(ROOT / "e2e/workflow-document-server.py")], ROOT),
|
||||
(
|
||||
["node", "node_modules/vite/bin/vite.js", "--host", "127.0.0.1"],
|
||||
ROOT / "calliope-web",
|
||||
),
|
||||
]
|
||||
for i, (command, cwd) in enumerate(commands):
|
||||
log = (OUT / f"service-{i}.log").open("w")
|
||||
logs.append(log)
|
||||
processes.append(
|
||||
subprocess.Popen(command, cwd=cwd, stdout=log, stderr=log, start_new_session=True)
|
||||
)
|
||||
for url in (
|
||||
"http://127.0.0.1:8247/api/workflows",
|
||||
"http://127.0.0.1:5173/connections",
|
||||
):
|
||||
deadline = time.monotonic() + 30
|
||||
while True:
|
||||
if any(p.poll() is not None for p in processes):
|
||||
raise RuntimeError("Local service exited; inspect service logs")
|
||||
try:
|
||||
with urllib.request.urlopen(url, timeout=1) as response:
|
||||
if response.status == 200:
|
||||
break
|
||||
except (urllib.error.URLError, TimeoutError):
|
||||
pass
|
||||
if time.monotonic() > deadline:
|
||||
raise TimeoutError(url)
|
||||
time.sleep(0.2)
|
||||
names = ["moge3"]
|
||||
for name in names:
|
||||
subprocess.run(["node", f"e2e/{name}-document.mjs"], cwd=ROOT, check=True)
|
||||
finally:
|
||||
for p in processes:
|
||||
if p.poll() is None:
|
||||
os.killpg(p.pid, signal.SIGTERM)
|
||||
try:
|
||||
p.wait(timeout=10)
|
||||
except subprocess.TimeoutExpired:
|
||||
os.killpg(p.pid, signal.SIGKILL)
|
||||
p.wait(timeout=5)
|
||||
for log in logs:
|
||||
log.close()
|
||||
import json
|
||||
|
||||
released = []
|
||||
for port in (8247, 5173):
|
||||
with socket.socket() as sock:
|
||||
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
sock.bind(("127.0.0.1", port))
|
||||
released.append(port)
|
||||
(OUT / "service-stop.json").write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"ports_released": released,
|
||||
"child_exit_codes": [p.returncode for p in processes],
|
||||
}
|
||||
)
|
||||
+ "\n"
|
||||
)
|
||||
print("All owned browser services stopped; ports released.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user