HEL-892: bind supplied API companions with provenance and fail-closed import

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
leefer
2026-10-29 22:00:41 +08:00
co-authored by multica-agent
parent d9f3328958
commit ddf56714ad
33 changed files with 89504 additions and 8 deletions
@@ -58,8 +58,18 @@ def audit(repo: Path, directory: Path) -> dict:
visit(source)
assert doc["source_links"] == source_links
assert {n["node_id"]: n["source_values"] for n in doc["source_nodes"]} == nodes
source_params = [
p for p in doc["params"] if p.get("value_origin") != "supplied_api_companion"
]
for param in doc["params"]:
assert param["default"] == nodes[param["node_id"]][param["field"]]
if param.get("value_origin") == "supplied_api_companion":
companion = doc["api_companion"]
assert companion["adopted"]
api = {n["api_id"]: n["api_node"] for n in companion["comparison"]["nodes"]}
value = api[param["api_node_id"]]["inputs"][param["field"]]
assert type(param["default"]) is type(value) and param["default"] == value
else:
assert param["default"] == nodes[param["node_id"]][param["field"]]
assert param["unit"] is None
assert param["min"] is None and param["max"] is None
for note in doc["source_notes"]:
@@ -72,7 +82,7 @@ def audit(repo: Path, directory: Path) -> dict:
if fourth:
assert fourth["operation_check"] in doc["steps"]
assert {(f["node_id"], f["field"]) for f in checked_fields} == {
(p["node_id"], p["field"]) for p in doc["params"]
(p["node_id"], p["field"]) for p in source_params
}
semantic = doc["source_review"].get("semantic_review")
if semantic:
@@ -80,14 +90,14 @@ def audit(repo: Path, directory: Path) -> dict:
assert semantic["operation_check"] in doc["steps"]
assert semantic["conclusions"] and semantic["unknowns"]
assert {(f["node_id"], f["field"]) for f in checked_fields} == {
(p["node_id"], p["field"]) for p in doc["params"]
(p["node_id"], p["field"]) for p in source_params
}
for kind in ("nodes", "notes"):
for ref in semantic["evidence_refs"][kind]:
key, index = ref["pointer"].strip("/").split("/")
assert doc[key][int(index)]["node_id"] == ref["node_id"]
assert semantic["mechanical_inventory"] == {
"named_value_count": len(doc["params"]),
"named_value_count": len(source_params),
"note_count": len(doc["source_notes"]),
"link_count": len(doc["source_links"]),
"position_widget_node_count": len(
@@ -247,12 +257,14 @@ def audit_fourth(repo: Path, report: dict, partition_path: Path) -> dict:
else:
assert f["class_type"] == source[nid]["class_type"]
assert f["connections"]["incoming"] == [
{"field": k, "link": v} for k, v in source[nid]["inputs"].items()
{"field": k, "link": v}
for k, v in source[nid]["inputs"].items()
if isinstance(v, list)
]
assert f["connections"]["outgoing"] == [
{"node_id": target, "field": k, "link": v}
for target, n in source.items() for k, v in n["inputs"].items()
for target, n in source.items()
for k, v in n["inputs"].items()
if isinstance(v, list) and len(v) == 2 and v[0] == nid
]
assert f["category"] in {
@@ -0,0 +1,107 @@
"""Audit received API companions against source bytes and an isolated imported DB."""
from __future__ import annotations
import argparse
import hashlib
import json
from collections import Counter
from pathlib import Path
from calliope.comfyui.companions import load_companions, resolve_companion
from calliope.comfyui.library import _json
from calliope.db import get_db
def audit(repo: Path, manifest: Path, db: Path, output: Path):
records = load_companions(manifest)
conn = get_db(db)
rows = []
output.mkdir(parents=True, exist_ok=True)
try:
for path, record in records.items():
raw = (repo / path).read_bytes()
prompt, evidence, issues = resolve_companion(record, path, raw, json.loads(raw))
row = conn.execute(
"SELECT * FROM workflows WHERE source_repo_path=?", (path,)
).fetchone()
assert row is not None and not row["is_enabled"]
assert row["doc_completed_at"] is row["exec_verified_at"] is None
assert row["source_sha"] == hashlib.sha1(raw).hexdigest()
assert json.loads(row["raw_source_json"]) == json.loads(raw)
assert json.loads(row["workflow_json"]) == (prompt or {})
doc = json.loads(row["doc_json"])
assert doc["api_companion"] == evidence
params = [p for p in doc["params"] if p.get("value_origin") == "supplied_api_companion"]
assert len(params) == sum(
not isinstance(value, list)
for node in (prompt or {}).values()
for value in node["inputs"].values()
)
for param in params:
assert _json(param["default"]) == _json(
prompt[param["api_node_id"]]["inputs"][param["field"]]
)
assert param["unit"] is param["min"] is param["max"] is None
details = evidence["comparison"]
fields = [f for n in details["nodes"] for f in n["fields"]]
api = json.loads(record["raw"].lstrip("\ufeff"))
assert len(fields) == sum(len(n.get("inputs", {})) for n in api.values())
case = {
"id": evidence["binding"]["id"],
"source_path": path,
"state": row["import_state"],
"adopted": evidence["adopted"],
"api_nodes": len(api),
"api_inputs": len(fields),
"new_api_literal_params": len(params),
"field_comparison": dict(Counter(f["status"] for f in fields)),
"source_only_ids": [n["source_id"] for n in details["source_only_nodes"]],
"api_only_ids": [
n["api_id"] for n in details["nodes"] if n["status"].startswith("api_only")
],
"named_evidence_differences": [
{"node_id": n["api_id"], **f}
for n in details["nodes"]
for f in n["fields"]
if f.get("named_evidence", {}).get("status") == "different"
],
"output_map": json.loads(row["output_map"]),
"kind": row["kind"],
"issues": issues,
"general_conversion_verified": False,
"execution_verified": False,
"evidence_file": evidence["binding"]["id"] + ".json",
}
(output / case["evidence_file"]).write_text(
json.dumps(evidence, ensure_ascii=False, indent=2) + "\n", encoding="utf-8"
)
rows.append(case)
finally:
conn.close()
report = {
"cases": rows,
"adopted": sum(r["adopted"] for r in rows),
"general_conversion_verified": 0,
"execution_verified": 0,
"new_api_literal_params": sum(r["new_api_literal_params"] for r in rows),
}
(output / "summary.json").write_text(
json.dumps(report, ensure_ascii=False, indent=2) + "\n", encoding="utf-8"
)
return report
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--repo", type=Path, required=True)
parser.add_argument("--manifest", type=Path, required=True)
parser.add_argument("--db", type=Path, required=True)
parser.add_argument("--output", type=Path, required=True)
args = parser.parse_args()
report = audit(args.repo, args.manifest, args.db, args.output)
print(json.dumps({k: v for k, v in report.items() if k != "cases"}, ensure_ascii=False))
if __name__ == "__main__":
main()
@@ -0,0 +1,222 @@
"""Explicit source-bound supplied API companions; never evidence of general conversion.
Hashes bind the reviewed pair, not the historical export environment. Source/API
comparisons retain positional values as unnamed rather than guessing widget order.
"""
from __future__ import annotations
import hashlib
import json
from pathlib import Path
from calliope.comfyui.ui2api import convert
def load_companions(path: Path) -> dict:
data = json.loads(path.read_text(encoding="utf-8"))
if data.get("schema_version") != 1 or not isinstance(data.get("cases"), list):
raise ValueError("配套清单格式错误")
records = {}
for entry in data["cases"]:
key = entry["source_path"]
if not all(
isinstance(entry.get(k), str) and entry[k].strip()
for k in (
"source_path",
"source_sha",
"source_sha256",
"export_sha256",
"provider",
"attachment_id",
"received_at",
"provenance",
"instruction",
)
):
raise ValueError("配套清单缺少来源、哈希或说明;未知导出版本应明确记为null")
if not all(k in entry for k in ("exported_at", "frontend_version", "node_versions")):
raise ValueError("必须明确记录导出时间/版本的未知状态")
if key in records:
raise ValueError("配套源路径重复")
# Store bytes, not a live path: the same bytes are hashed and imported.
relative = Path(entry["export_file"])
if relative.is_absolute() or ".." in relative.parts:
raise ValueError("配套文件必须在清单目录内")
raw = (path.parent / relative).read_bytes()
json.loads(raw.decode("utf-8-sig")) # Reject malformed JSON before any database write.
records[key] = {"binding": entry, "raw": raw.decode("utf-8")}
if hashlib.sha256(raw).hexdigest() != entry["export_sha256"]:
raise ValueError("配套API文件哈希不符")
return records
def _same(left, right):
# bool/int and int/float distinctions matter, including nested values.
return type(left) is type(right) and (
left.keys() == right.keys() and all(_same(left[k], right[k]) for k in left)
if isinstance(left, dict)
else len(left) == len(right) and all(_same(a, b) for a, b in zip(left, right))
if isinstance(left, list)
else left == right
)
def source_comparison(source: dict, api: dict) -> dict:
"""Compare every exported field with explicit source evidence, never equal-by-default."""
definitions = {s["id"]: s for s in (source.get("definitions") or {}).get("subgraphs", [])}
indexed = {}
def walk(graph, prefix="", ancestry=()):
for node in graph.get("nodes", []):
nid = prefix + str(node["id"])
indexed[nid] = (node, graph, prefix)
sub = definitions.get(node.get("type"))
if sub and sub["id"] not in ancestry:
walk(sub, nid + ":", (*ancestry, sub["id"]))
walk(source)
nodes = []
for nid, exported in api.items():
item = {"api_id": nid, "api_node": exported, "fields": []}
inputs = exported.get("inputs")
inputs = inputs if isinstance(inputs, dict) else {}
found = indexed.get(nid)
if not found:
item["status"] = "api_only_source_changed_or_expansion_unresolved"
item["fields"] = [
{
"field": field,
"api_value": value,
"api_type": type(value).__name__,
"status": "source_node_unresolved",
}
for field, value in inputs.items()
]
nodes.append(item)
continue
original, graph, prefix = found
item.update(
source_node=original,
status="type_match"
if original.get("type") == exported.get("class_type")
else "type_difference",
metadata={
"source_title": original.get("title", original.get("type")),
"api_meta": exported.get("_meta"),
"title_equal": _same(
original.get("title", original.get("type")),
(
exported["_meta"].get("title")
if isinstance(exported.get("_meta"), dict)
else None
),
),
},
)
links = {}
for link in graph.get("links", []):
if isinstance(link, dict):
link = [
link.get(k)
for k in ("id", "origin_id", "origin_slot", "target_id", "target_slot", "type")
]
if isinstance(link, list) and len(link) >= 6:
links[str(link[0])] = link
sockets = {s["name"]: s for s in original.get("inputs", []) if "name" in s}
widgets = original.get("widgets_values_named", original.get("widgets_values", []))
for field, value in inputs.items():
row = {"field": field, "api_value": value, "api_type": type(value).__name__}
if isinstance(widgets, dict) and field in widgets:
row["named_evidence"] = {
"source_value": widgets[field],
"source_type": type(widgets[field]).__name__,
"status": "equal" if _same(widgets[field], value) else "different",
}
socket = sockets.get(field, {})
link = links.get(str(socket.get("link")))
if link and len(link) >= 6:
expected = [prefix + str(link[1]), link[2]]
row.update(
source_link=link,
source_expected=expected,
status="link_equal" if _same(expected, value) else "link_difference",
)
elif isinstance(widgets, dict) and field in widgets:
row.update(
source_value=widgets[field],
status="named_equal" if _same(widgets[field], value) else "named_difference",
)
else:
row["status"] = "unnamed_or_virtual_boundary_unverified"
item["fields"].append(row)
nodes.append(item)
return {
"equivalent": False,
"scope": "逐节点/字段保留API值和类型;直接连线比较ID及槽;位置控件不按顺序猜名",
"nodes": nodes,
"source_only_nodes": [
{"source_id": nid, "node": node}
for nid, (node, _, _) in indexed.items()
if nid not in api
],
"unconfirmed": [
"虚拟节点、子图边界、开关与循环展开语义需独立核查",
"未有可信节点定义;单位、范围、环境和实际产物未验证",
],
}
def resolve_companion(record: dict, source_path: str, raw: bytes, source: dict):
binding = record["binding"]
problem = None
if (
binding.get("source_path") != source_path
or binding.get("source_sha") != hashlib.sha1(raw).hexdigest()
or binding.get("source_sha256") != hashlib.sha256(raw).hexdigest()
):
problem = "源文件路径或哈希变化,配套API失效"
text = record["raw"]
if hashlib.sha256(text.encode()).hexdigest() != binding.get("export_sha256"):
problem = "配套API哈希变化"
api = json.loads(text.lstrip("\ufeff"))
invalid = (
[
nid
for nid, node in api.items()
if not isinstance(node, dict)
or not isinstance(node.get("class_type"), str)
or not node["class_type"].strip()
or not isinstance(node.get("inputs"), dict)
or ("_meta" in node and not isinstance(node["_meta"], dict))
]
if isinstance(api, dict)
else ["*"]
)
if invalid:
problem = "API缺少节点类型或inputs:" + ",".join(invalid)
checked = convert(api)
if checked.prompt is None:
problem = problem or "API连线或结构不合法"
audit = {
"binding": binding,
"adopted": not problem,
"method": "supplied_api_companion",
"general_conversion_verified": False,
"execution_verified": False,
}
if isinstance(api, dict) and all(isinstance(n, dict) for n in api.values()):
audit["comparison"] = source_comparison(source, api)
if problem:
return None, audit, [{"code": "companion_invalid", "message": problem}, *checked.issues]
# Always a blocker: no snapshot or output heuristic may promote this pair to executable.
return (
api,
audit,
[
{
"code": "companion_unverified",
"message": "采用提供的配套API;源图差异、导出版本与真实执行尚未核验,保持停用",
}
],
)
@@ -11,6 +11,7 @@ from datetime import datetime, timezone
from pathlib import Path
from typing import Any
from calliope.comfyui.companions import resolve_companion
from calliope.comfyui.lint import workflow_warnings
from calliope.comfyui.output_map import auto_output_map, needs_user_output_map
from calliope.comfyui.parser import classify_usage, parse_dynamic_inputs, parse_dynamic_outputs
@@ -300,7 +301,12 @@ def build_document(
def import_library(
conn: sqlite3.Connection, root: Path, *, source_commit: str, snapshot: dict | None = None
conn: sqlite3.Connection,
root: Path,
*,
source_commit: str,
snapshot: dict | None = None,
companions: dict | None = None,
) -> dict:
"""Caller supplies a migrated local DB. Single transaction; no network or jobs."""
batch = str(uuid.uuid4())
@@ -319,6 +325,11 @@ def import_library(
"SELECT * FROM workflows WHERE source_repo_path=?", (relative,)
).fetchone()
record = {"path": relative, "source_sha": sha}
companion = (companions or {}).get(relative)
# Version companion documentation separately from the immutable received bytes.
companion_sha = hashlib.sha256(
_json({"record": companion, "doc_version": 1} if companion else None).encode()
).hexdigest()
if existing and fingerprint(dict(existing)) != existing["library_fingerprint"]:
report["files"].append(
{
@@ -345,6 +356,8 @@ def import_library(
if (
old_doc.get("snapshot_sha") == snapshot_sha
and old_doc.get("source_review_sha") == review_sha
and old_doc.get("companion_sha", hashlib.sha256(b"null").hexdigest())
== companion_sha
):
report["files"].append(
{
@@ -357,11 +370,16 @@ def import_library(
)
continue
source = None
companion_audit = None
try:
text = raw.decode("utf-8-sig")
source = json.loads(text)
result = convert(source, info)
prompt, issues = result.prompt, result.issues
if companion:
prompt, companion_audit, issues = resolve_companion(
companion, relative, raw, source
)
except (UnicodeDecodeError, json.JSONDecodeError) as exc:
text = raw.hex()
prompt, issues = (
@@ -388,6 +406,37 @@ def import_library(
else "pending_test"
)
doc = build_document(relative, source, prompt, snapshot, issues, review)
doc["companion_sha"] = companion_sha
if companion_audit:
doc["api_companion"] = companion_audit
if prompt:
api_doc = build_document(relative, prompt, prompt, None, [], None)
# Retain source inventory/reviews separately from supplied API evidence.
doc["params"].extend(
{
**p,
"node_id": "配套API:" + p["node_id"],
"api_node_id": p["node_id"],
"value_origin": "supplied_api_companion",
"default_source": "supplied_api_companion",
"effect": (
f"配套API节点{p['node_id']}("
f"{prompt[p['node_id']]['class_type']})的具名输入{p['field']};"
"现值由导出保留,含义/单位/范围仍待定义。"
),
}
for p in api_doc["params"]
)
doc["dependencies"]["models"] = sorted(
set(doc["dependencies"]["models"] + api_doc["dependencies"]["models"])
)
doc["dependencies"]["node_types"] = sorted(
set(
doc["dependencies"]["node_types"]
+ api_doc["dependencies"]["node_types"]
)
)
doc["steps"].insert(0, companion_audit["binding"]["instruction"])
doc["snapshot_sha"] = snapshot_sha
doc["source_review_sha"] = review_sha
judgment = classify_usage(prompt or {})
@@ -11,6 +11,7 @@ from pathlib import Path
import httpx
from calliope.comfyui.companions import load_companions
from calliope.comfyui.library import import_library, load_snapshot, rollback_batch
from calliope.db import get_db, migrate_db
@@ -36,6 +37,7 @@ def main() -> None:
sub.add_argument("--root", type=Path, required=True)
sub.add_argument("--source-commit", required=True)
sub.add_argument("--snapshot", type=Path)
sub.add_argument("--companions", type=Path)
else:
sub.add_argument("--batch-id", required=True)
args = parser.parse_args()
@@ -61,12 +63,19 @@ def main() -> None:
if args.command == "import" and not args.root.is_dir():
parser.error("--root 必须为存在的目录,避免误报空库成功")
snapshot = load_snapshot(args.snapshot) if args.command == "import" else None
companions = (
load_companions(args.companions) if args.command == "import" and args.companions else None
)
asyncio.run(migrate_db(args.db))
conn = get_db(args.db)
try:
if args.command == "import":
report = import_library(
conn, args.root, source_commit=args.source_commit, snapshot=snapshot
conn,
args.root,
source_commit=args.source_commit,
snapshot=snapshot,
companions=companions,
)
documents = []
for row in conn.execute(
@@ -0,0 +1,229 @@
"""Supplied real exports are disabled companions, never general conversion proof."""
from __future__ import annotations
import copy
import hashlib
import json
from pathlib import Path
import pytest
from calliope.comfyui.companions import load_companions, resolve_companion, source_comparison
from calliope.comfyui.library import import_library, rollback_batch
from calliope.db import get_db, migrate_db
REPO = Path(__file__).resolve().parents[2]
MANIFEST = REPO / "docs/hel-892/supplied-api/manifest.json"
ROOT = REPO / "example_ComfyUI_workflows"
def test_real_exports_preserved_and_case06_closed():
records = load_companions(MANIFEST)
assert len(records) == 7
for path, record in records.items():
raw = (REPO / path).read_bytes()
prompt, audit, issues = resolve_companion(record, path, raw, json.loads(raw))
assert not audit["general_conversion_verified"]
assert not audit["execution_verified"]
assert audit["binding"]["exported_at"] is None
if audit["binding"]["id"] == "06":
assert prompt is None and issues[0]["code"] == "companion_invalid"
assert "120" in issues[0]["message"] and "350" in issues[0]["message"]
else:
assert prompt == json.loads(record["raw"])
assert audit["adopted"] and issues[0]["code"] == "companion_unverified"
# Every input, including API-only nodes, must be retained in the audit graph.
assert {n["api_id"]: n["api_node"] for n in audit["comparison"]["nodes"]} == prompt
@pytest.mark.parametrize("change", ["source", "path", "api", "missing_node", "negative_slot"])
def test_mismatch_and_bad_links_fail_closed(change):
records = load_companions(MANIFEST)
path, record = next(iter(records.items()))
record = copy.deepcopy(record)
raw = (REPO / path).read_bytes()
source = json.loads(raw)
if change == "source":
raw += b" "
elif change == "path":
path += ".wrong"
elif change == "api":
record["raw"] += " "
else:
api = json.loads(record["raw"])
api["1"]["inputs"]["image"] = ["missing", 0] if change == "missing_node" else ["2", -1]
record["raw"] = json.dumps(api)
record["binding"]["export_sha256"] = hashlib.sha256(record["raw"].encode()).hexdigest()
prompt, audit, issues = resolve_companion(record, path, raw, source)
assert prompt is None and not audit["adopted"] and issues
def test_slot_and_typed_named_values_and_subgraph_links():
source = {
"nodes": [{"id": 3, "type": "group"}],
"definitions": {
"subgraphs": [
{
"id": "group",
"nodes": [
{"id": 1, "type": "Origin"},
{
"id": 2,
"type": "Sink",
"widgets_values_named": {"count": 1, "seed": 42},
"inputs": [{"name": "input", "link": 9}],
},
],
"links": [
{
"id": 9,
"origin_id": 1,
"origin_slot": 2,
"target_id": 2,
"target_slot": 0,
"type": "X",
}
],
}
]
},
}
api = {
"3:1": {"class_type": "Origin", "inputs": {}},
"3:2": {
"class_type": "Sink",
"inputs": {"input": ["3:1", 1], "count": True, "seed": 43},
"_meta": {"title": "changed"},
},
}
node = source_comparison(source, api)["nodes"][1]
fields = {r["field"]: r for r in node["fields"]}
assert fields["input"]["status"] == "link_difference"
assert fields["input"]["source_expected"] == ["3:1", 2]
assert fields["count"]["status"] == "named_difference"
assert fields["seed"]["named_evidence"]["status"] == "different"
assert not node["metadata"]["title_equal"]
async def test_pair_import_repeat_upgrade_user_protection_and_rollback(tmp_path):
await migrate_db(tmp_path / "local.db")
conn = get_db(tmp_path / "local.db")
records = load_companions(MANIFEST)
original = import_library(conn, ROOT, source_commit="fixture")
before = {r["source_repo_path"]: dict(r) for r in conn.execute("SELECT * FROM workflows")}
paired = import_library(conn, ROOT, source_commit="fixture", companions=records)
assert paired["counts"] == {"updated": 7, "skipped": 149}
assert paired["states"] == {"pending_check": 16, "needs_conversion": 140}
for path, record in records.items():
row = conn.execute("SELECT * FROM workflows WHERE source_repo_path=?", (path,)).fetchone()
doc = json.loads(row["doc_json"])
assert row["is_enabled"] == 0
assert row["doc_completed_at"] is row["exec_verified_at"] is None
assert row["raw_source_json"] == before[path]["raw_source_json"]
assert doc["source_review"] == json.loads(before[path]["doc_json"])["source_review"]
if record["binding"]["id"] != "06":
assert json.loads(row["workflow_json"]) == json.loads(record["raw"])
assert any(p["value_origin"] == "supplied_api_companion" for p in doc["params"])
if record["binding"]["id"] == "02":
assert row["kind"] == "unknown" and json.loads(row["output_map"]) == []
assert import_library(conn, ROOT, source_commit="fixture", companions=records)["counts"] == {
"skipped": 156
}
assert len(rollback_batch(conn, paired["batch_id"])["files"]) == 7
assert {
r["source_repo_path"]: dict(r) for r in conn.execute("SELECT * FROM workflows")
} == before
import_library(conn, ROOT, source_commit="fixture", companions=records)
changed = copy.deepcopy(records)
path = next(iter(changed))
changed[path]["binding"]["instruction"] += "更新说明"
assert import_library(conn, ROOT, source_commit="fixture", companions=changed)["counts"] == {
"updated": 1,
"skipped": 155,
}
conn.execute("UPDATE workflows SET description='用户修改' WHERE source_repo_path=?", (path,))
conn.commit()
assert import_library(conn, ROOT, source_commit="fixture", companions=records)["counts"] == {
"conflict": 1,
"skipped": 155,
}
assert (
conn.execute(
"SELECT description FROM workflows WHERE source_repo_path=?", (path,)
).fetchone()[0]
== "用户修改"
)
# Removing supplied companions downgrades only managed rows, preserving the user row.
removed = import_library(conn, ROOT, source_commit="fixture")
assert removed["counts"] == {"conflict": 1, "updated": 6, "skipped": 149}
assert original["total"] == 156
conn.close()
def test_file_mismatch_rejected_before_db_write(tmp_path):
data = json.loads(MANIFEST.read_text())
case = data["cases"][0]
(tmp_path / case["export_file"]).write_text("{}")
data["cases"] = [case]
manifest = tmp_path / "manifest.json"
manifest.write_text(json.dumps(data))
with pytest.raises(ValueError, match="哈希"):
load_companions(manifest)
def test_companion_routes_cannot_enable_or_test(client):
from calliope.config import settings
conn = get_db(settings.db_path)
report = import_library(
conn, ROOT, source_commit="fixture", companions=load_companions(MANIFEST)
)
conn.close()
case = next(r for r in report["files"] if r["path"].endswith("ControlNet_aux_常用样例.json"))
wid = case["workflow_id"]
body = client.get(f"/api/workflows/{wid}").json()
assert body["doc_json"]["api_companion"]["adopted"]
assert client.patch(f"/api/workflows/{wid}", json={"is_enabled": True}).status_code == 400
assert client.post(f"/api/workflows/{wid}/reanalyze").json()["is_enabled"] is False
previous = settings.dry_run
settings.dry_run = False
try:
assert (
client.post(f"/api/workflows/{wid}/test", json={"input_values": {}}).status_code == 400
)
finally:
settings.dry_run = previous
async def test_source_revision_invalidates_existing_companion(tmp_path):
root = tmp_path / "sources"
root.mkdir()
path = root / "a.json"
path.write_text(json.dumps({"nodes": [{"id": 1, "type": "Example"}]}))
raw = path.read_bytes()
api_text = json.dumps({"1": {"class_type": "Example", "inputs": {"seed": 123}}})
record = {
"raw": api_text,
"binding": {
"source_path": "sources/a.json",
"source_sha": hashlib.sha1(raw).hexdigest(),
"source_sha256": hashlib.sha256(raw).hexdigest(),
"export_sha256": hashlib.sha256(api_text.encode()).hexdigest(),
"instruction": "夹具",
},
}
await migrate_db(tmp_path / "local.db")
conn = get_db(tmp_path / "local.db")
records = {"sources/a.json": record}
first = import_library(conn, root, source_commit="fixture", companions=records)
assert first["states"] == {"pending_check": 1}
path.write_bytes(raw + b" ")
second = import_library(conn, root, source_commit="fixture2", companions=records)
assert second["counts"] == {"updated": 1}
assert second["states"] == {"needs_conversion": 1}
row = conn.execute("SELECT * FROM workflows").fetchone()
assert json.loads(row["workflow_json"]) == {}
assert row["raw_source_json"] == path.read_text()
assert not json.loads(row["doc_json"])["api_companion"]["adopted"]
conn.close()
+2
View File
@@ -1,3 +1,5 @@
> 当前第六批:见 `第六批真实API配套导入.md`、`supplied-api/` 和 `sixth-evidence/`。7份真实附件已收取,6份采用为停用的配套API,case06缺类型继续关闭;294项API具名现值与源侧审校分开。通用转换146份仍未证明,完整定稿/实跑仍为0,未合并部署。以下批次为历史记录。
> 当前第四批:见 `第四批字段审校与转换前置清单.md`、`逐字段第四批审校.md`、`146份UI转换前置清单.md` 及 `fourth-evidence/`。685项新增局部审校已入实际说明;旧542项和140份说明保留。可靠转换仍剩146份,完整定稿/实跑均为0;以下为历史批次。
> 当前批次:见 `第三批语义审校与差分准备.md`、`逐文件第三批审校.md` 和 `third-evidence/`。140份源语义局部审校已补入实际说明;不要求暂停TTS或交出本地节点包/模型。下文及旧批次材料要求为历史记录,全量目标仍未完成。
File diff suppressed because it is too large Load Diff
+903
View File
@@ -0,0 +1,903 @@
{
"binding": {
"id": "02",
"source_path": "example_ComfyUI_workflows/1-语音生成/Qwen3-ASR-Subtitle语音转字幕.json",
"source_sha": "08a7519a6a6c532b8a0670dce3deff70881527ef",
"export_file": "02.api.json",
"source_sha256": "47f9afa955a6a5dce37000cb6a15bac7516d26ff50b6398bda334c825552cfd8",
"export_sha256": "daa40971b730076691721afe95e165932df94e3423f1fc44dcb7707026e7125b",
"original_filename": "Qwen3-ASR-Subtitle语音转字幕.json",
"provider": "白栖知",
"attachment_id": "01a187e2-366c-7d95-87e8-231a4b305a9e",
"received_at": "2026-10-29T13:38:38Z",
"received_at_basis": "主卡附件评论创建时间;不是导出时间",
"source_comment_id": "01a187e2-4f6e-761e-9412-43042e094daa",
"exported_at": null,
"frontend_version": null,
"node_versions": null,
"provenance": "user_supplied_api_export_environment_unknown",
"source_export_equivalence_verified": false,
"instruction": "语音转字幕:6.audio读入音频,9.audio接6的槽0;9具名hints已内联,原PrimitiveNode不在API中。1/2/3/4的source分别接9的槽0/1/2/3;原图标示STRING出口,只能确认文本预览,output_path字段不能证明已经产出字幕文件,文件映射仍待真实历史响应。"
},
"adopted": true,
"method": "supplied_api_companion",
"general_conversion_verified": false,
"execution_verified": false,
"comparison": {
"equivalent": false,
"scope": "逐节点/字段保留API值和类型;直接连线比较ID及槽;位置控件不按顺序猜名",
"nodes": [
{
"api_id": "1",
"api_node": {
"inputs": {
"source": [
"9",
3
]
},
"class_type": "PreviewAny",
"_meta": {
"title": "预览任意"
}
},
"fields": [
{
"field": "source",
"api_value": [
"9",
3
],
"api_type": "list",
"source_link": [
18,
9,
3,
1,
0,
"STRING"
],
"source_expected": [
"9",
3
],
"status": "link_equal"
}
],
"source_node": {
"id": 1,
"type": "PreviewAny",
"pos": [
3410,
5790
],
"size": [
370,
120
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"localized_name": "源",
"name": "source",
"type": "*",
"link": 18
}
],
"outputs": [],
"properties": {
"Node name for S&R": "PreviewAny",
"cnr_id": "comfy-core",
"ver": "0.11.0",
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {},
"version": "7.5.2"
}
},
"widgets_values": [
null,
null,
null
]
},
"status": "type_match",
"metadata": {
"source_title": "PreviewAny",
"api_meta": {
"title": "预览任意"
},
"title_equal": false
}
},
{
"api_id": "2",
"api_node": {
"inputs": {
"source": [
"9",
1
]
},
"class_type": "PreviewAny",
"_meta": {
"title": "预览任意"
}
},
"fields": [
{
"field": "source",
"api_value": [
"9",
1
],
"api_type": "list",
"source_link": [
16,
9,
1,
2,
0,
"STRING"
],
"source_expected": [
"9",
1
],
"status": "link_equal"
}
],
"source_node": {
"id": 2,
"type": "PreviewAny",
"pos": [
3410,
5410
],
"size": [
370,
180
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"localized_name": "源",
"name": "source",
"type": "*",
"link": 16
}
],
"outputs": [],
"properties": {
"Node name for S&R": "PreviewAny",
"cnr_id": "comfy-core",
"ver": "0.11.0",
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {},
"version": "7.5.2"
}
},
"widgets_values": [
null,
null,
null
]
},
"status": "type_match",
"metadata": {
"source_title": "PreviewAny",
"api_meta": {
"title": "预览任意"
},
"title_equal": false
}
},
{
"api_id": "3",
"api_node": {
"inputs": {
"source": [
"9",
2
]
},
"class_type": "PreviewAny",
"_meta": {
"title": "预览任意"
}
},
"fields": [
{
"field": "source",
"api_value": [
"9",
2
],
"api_type": "list",
"source_link": [
17,
9,
2,
3,
0,
"STRING"
],
"source_expected": [
"9",
2
],
"status": "link_equal"
}
],
"source_node": {
"id": 3,
"type": "PreviewAny",
"pos": [
3410,
5630
],
"size": [
370,
120
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"localized_name": "源",
"name": "source",
"type": "*",
"link": 17
}
],
"outputs": [],
"properties": {
"Node name for S&R": "PreviewAny",
"cnr_id": "comfy-core",
"ver": "0.11.0",
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {},
"version": "7.5.2"
}
},
"widgets_values": [
null,
null,
null
]
},
"status": "type_match",
"metadata": {
"source_title": "PreviewAny",
"api_meta": {
"title": "预览任意"
},
"title_equal": false
}
},
{
"api_id": "4",
"api_node": {
"inputs": {
"source": [
"9",
0
]
},
"class_type": "PreviewAny",
"_meta": {
"title": "预览任意"
}
},
"fields": [
{
"field": "source",
"api_value": [
"9",
0
],
"api_type": "list",
"source_link": [
15,
9,
0,
4,
0,
"STRING"
],
"source_expected": [
"9",
0
],
"status": "link_equal"
}
],
"source_node": {
"id": 4,
"type": "PreviewAny",
"pos": [
3410,
5190
],
"size": [
370,
180
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"localized_name": "源",
"name": "source",
"type": "*",
"link": 15
}
],
"outputs": [],
"properties": {
"Node name for S&R": "PreviewAny",
"cnr_id": "comfy-core",
"ver": "0.11.0",
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {},
"version": "7.5.2"
}
},
"widgets_values": [
null,
null,
null
]
},
"status": "type_match",
"metadata": {
"source_title": "PreviewAny",
"api_meta": {
"title": "预览任意"
},
"title_equal": false
}
},
{
"api_id": "6",
"api_node": {
"inputs": {
"audio": "ComfyUI-qwenasr_00003_.mp3"
},
"class_type": "LoadAudio",
"_meta": {
"title": "加载音频"
}
},
"fields": [
{
"field": "audio",
"api_value": "ComfyUI-qwenasr_00003_.mp3",
"api_type": "str",
"status": "unnamed_or_virtual_boundary_unverified"
}
],
"source_node": {
"id": 6,
"type": "LoadAudio",
"pos": [
2720,
5190
],
"size": [
290,
140
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"localized_name": "音频",
"name": "audio",
"type": "COMBO",
"widget": {
"name": "audio"
},
"link": null
},
{
"localized_name": "音频UI",
"name": "audioUI",
"type": "AUDIO_UI",
"widget": {
"name": "audioUI"
},
"link": null
},
{
"localized_name": "选择文件上传",
"name": "upload",
"type": "AUDIOUPLOAD",
"widget": {
"name": "upload"
},
"link": null
}
],
"outputs": [
{
"localized_name": "音频",
"name": "AUDIO",
"type": "AUDIO",
"links": [
13
]
}
],
"properties": {
"Node name for S&R": "LoadAudio",
"cnr_id": "comfy-core",
"ver": "0.11.0",
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {},
"version": "7.5.2"
}
},
"widgets_values": [
"ComfyUI-qwenasr_00003_.mp3",
null,
null
]
},
"status": "type_match",
"metadata": {
"source_title": "LoadAudio",
"api_meta": {
"title": "加载音频"
},
"title_equal": false
}
},
{
"api_id": "9",
"api_node": {
"inputs": {
"model": "Qwen/Qwen3-ASR-0.6B",
"precision": "bf16",
"attention": "auto",
"forced_aligner": "Qwen/Qwen3-ForcedAligner-0.6B",
"language": "auto",
"hints": "Important terms: ComfyUI, Qwen3-ASR\nUse exact casing for these terms.",
"output_format": "none",
"output_path": "",
"split_mode": "split_by_punctuation_or_pause_or_length",
"max_gap_sec": 0.6,
"max_chars": 40,
"max_inference_batch_size": 32,
"max_new_tokens": 256,
"normalize_text": true,
"unload_models": true,
"audio": [
"6",
0
]
},
"class_type": "AILab_Qwen3ASRSubtitle",
"_meta": {
"title": "Subtitle (QwenASR)"
}
},
"fields": [
{
"field": "model",
"api_value": "Qwen/Qwen3-ASR-0.6B",
"api_type": "str",
"status": "unnamed_or_virtual_boundary_unverified"
},
{
"field": "precision",
"api_value": "bf16",
"api_type": "str",
"status": "unnamed_or_virtual_boundary_unverified"
},
{
"field": "attention",
"api_value": "auto",
"api_type": "str",
"status": "unnamed_or_virtual_boundary_unverified"
},
{
"field": "forced_aligner",
"api_value": "Qwen/Qwen3-ForcedAligner-0.6B",
"api_type": "str",
"status": "unnamed_or_virtual_boundary_unverified"
},
{
"field": "language",
"api_value": "auto",
"api_type": "str",
"status": "unnamed_or_virtual_boundary_unverified"
},
{
"field": "hints",
"api_value": "Important terms: ComfyUI, Qwen3-ASR\nUse exact casing for these terms.",
"api_type": "str",
"source_link": [
14,
7,
0,
9,
6,
"STRING"
],
"source_expected": [
"7",
0
],
"status": "link_difference"
},
{
"field": "output_format",
"api_value": "none",
"api_type": "str",
"status": "unnamed_or_virtual_boundary_unverified"
},
{
"field": "output_path",
"api_value": "",
"api_type": "str",
"status": "unnamed_or_virtual_boundary_unverified"
},
{
"field": "split_mode",
"api_value": "split_by_punctuation_or_pause_or_length",
"api_type": "str",
"status": "unnamed_or_virtual_boundary_unverified"
},
{
"field": "max_gap_sec",
"api_value": 0.6,
"api_type": "float",
"status": "unnamed_or_virtual_boundary_unverified"
},
{
"field": "max_chars",
"api_value": 40,
"api_type": "int",
"status": "unnamed_or_virtual_boundary_unverified"
},
{
"field": "max_inference_batch_size",
"api_value": 32,
"api_type": "int",
"status": "unnamed_or_virtual_boundary_unverified"
},
{
"field": "max_new_tokens",
"api_value": 256,
"api_type": "int",
"status": "unnamed_or_virtual_boundary_unverified"
},
{
"field": "normalize_text",
"api_value": true,
"api_type": "bool",
"status": "unnamed_or_virtual_boundary_unverified"
},
{
"field": "unload_models",
"api_value": true,
"api_type": "bool",
"status": "unnamed_or_virtual_boundary_unverified"
},
{
"field": "audio",
"api_value": [
"6",
0
],
"api_type": "list",
"source_link": [
13,
6,
0,
9,
0,
"AUDIO"
],
"source_expected": [
"6",
0
],
"status": "link_equal"
}
],
"source_node": {
"id": 9,
"type": "AILab_Qwen3ASRSubtitle",
"pos": [
3030,
5190
],
"size": [
340,
460
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"localized_name": "audio",
"name": "audio",
"type": "AUDIO",
"link": 13
},
{
"localized_name": "model",
"name": "model",
"shape": 7,
"type": "COMBO",
"widget": {
"name": "model"
},
"link": null
},
{
"localized_name": "precision",
"name": "precision",
"shape": 7,
"type": "COMBO",
"widget": {
"name": "precision"
},
"link": null
},
{
"localized_name": "attention",
"name": "attention",
"shape": 7,
"type": "COMBO",
"widget": {
"name": "attention"
},
"link": null
},
{
"localized_name": "forced_aligner",
"name": "forced_aligner",
"shape": 7,
"type": "COMBO",
"widget": {
"name": "forced_aligner"
},
"link": null
},
{
"localized_name": "language",
"name": "language",
"shape": 7,
"type": "COMBO",
"widget": {
"name": "language"
},
"link": null
},
{
"localized_name": "hints",
"name": "hints",
"shape": 7,
"type": "STRING",
"widget": {
"name": "hints"
},
"link": 14
},
{
"localized_name": "output_format",
"name": "output_format",
"shape": 7,
"type": "COMBO",
"widget": {
"name": "output_format"
},
"link": null
},
{
"localized_name": "output_path",
"name": "output_path",
"shape": 7,
"type": "STRING",
"widget": {
"name": "output_path"
},
"link": null
},
{
"localized_name": "split_mode",
"name": "split_mode",
"shape": 7,
"type": "COMBO",
"widget": {
"name": "split_mode"
},
"link": null
},
{
"localized_name": "max_gap_sec",
"name": "max_gap_sec",
"shape": 7,
"type": "FLOAT",
"widget": {
"name": "max_gap_sec"
},
"link": null
},
{
"localized_name": "max_chars",
"name": "max_chars",
"shape": 7,
"type": "INT",
"widget": {
"name": "max_chars"
},
"link": null
},
{
"localized_name": "max_inference_batch_size",
"name": "max_inference_batch_size",
"shape": 7,
"type": "INT",
"widget": {
"name": "max_inference_batch_size"
},
"link": null
},
{
"localized_name": "max_new_tokens",
"name": "max_new_tokens",
"shape": 7,
"type": "INT",
"widget": {
"name": "max_new_tokens"
},
"link": null
},
{
"localized_name": "unload_models",
"name": "unload_models",
"shape": 7,
"type": "BOOLEAN",
"widget": {
"name": "unload_models"
},
"link": null
}
],
"outputs": [
{
"localized_name": "TEXT",
"name": "TEXT",
"type": "STRING",
"links": [
15
]
},
{
"localized_name": "SUBTITLES",
"name": "SUBTITLES",
"type": "STRING",
"links": [
16
]
},
{
"localized_name": "LANUGAGE",
"name": "LANUGAGE",
"type": "STRING",
"links": [
17
]
},
{
"localized_name": "OUTPUT_PATH",
"name": "OUTPUT_PATH",
"type": "STRING",
"links": [
18
]
}
],
"properties": {
"Node name for S&R": "AILab_Qwen3ASRSubtitle",
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {},
"version": "7.8"
}
},
"widgets_values": [
"Qwen/Qwen3-ASR-0.6B",
"bf16",
"auto",
"Qwen/Qwen3-ForcedAligner-0.6B",
"auto",
"Important terms: ComfyUI, Qwen3-ASR\nUse exact casing for these terms.",
"none",
"",
"split_by_punctuation_or_pause_or_length",
0.6,
40,
32,
256,
true
],
"color": "#151c19",
"bgcolor": "#444d49"
},
"status": "type_match",
"metadata": {
"source_title": "AILab_Qwen3ASRSubtitle",
"api_meta": {
"title": "Subtitle (QwenASR)"
},
"title_equal": false
}
}
],
"source_only_nodes": [
{
"source_id": "7",
"node": {
"id": 7,
"type": "PrimitiveNode",
"pos": [
2720,
5380
],
"size": [
290,
90
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"widget": {
"name": "hints"
},
"links": [
14
]
}
],
"properties": {
"Run widget replace on values": false,
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.8",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
"Important terms: ComfyUI, Qwen3-ASR\nUse exact casing for these terms."
]
}
}
],
"unconfirmed": [
"虚拟节点、子图边界、开关与循环展开语义需独立核查",
"未有可信节点定义;单位、范围、环境和实际产物未验证"
]
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,9 @@
........................................................................ [ 50%]
...................................................................... [100%]
=============================== warnings summary ===============================
calliope-backend/.venv/lib/python3.11/site-packages/starlette/testclient.py:53
/home/xiaomo/multica_workspaces/hello-af23464d222e/hel-892-99cfa82c5c3f/workdir/aigc-home/calliope-backend/.venv/lib/python3.11/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
142 passed, 1 warning in 69.18s (0:01:09)
@@ -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 @@
All checks passed!
@@ -0,0 +1,8 @@
......................................... [100%]
=============================== warnings summary ===============================
calliope-backend/.venv/lib/python3.11/site-packages/starlette/testclient.py:53
/home/xiaomo/multica_workspaces/hello-af23464d222e/hel-892-99cfa82c5c3f/workdir/aigc-home/calliope-backend/.venv/lib/python3.11/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
41 passed, 1 warning in 7.25s
@@ -0,0 +1 @@
{"batch_id": "6c595b05-738c-4107-9160-c99d09c8e89a", "source_commit": "d9f332895857a16058e9d0202da4d6f76f4dbb81", "counts": {"updated": 7, "skipped": 149}, "states": {"pending_check": 16, "needs_conversion": 140}, "total": 156, "doc_completed": 0, "exec_verified": 0}
@@ -0,0 +1 @@
{"adopted": 6, "general_conversion_verified": 0, "execution_verified": 0, "new_api_literal_params": 294}
+1
View File
@@ -0,0 +1 @@
{"batch_id": "6089635e-03d0-4095-8f4d-23c18a21f4c5", "source_commit": "d9f332895857a16058e9d0202da4d6f76f4dbb81", "counts": {"skipped": 156}, "states": {"pending_check": 16, "needs_conversion": 140}, "total": 156, "doc_completed": 0, "exec_verified": 0}
@@ -0,0 +1 @@
{"total": 156, "source_structure_purpose_partially_reviewed": 156, "full_documents_completed": 0, "files_with_selected_named_fields_reviewed": 42, "selected_named_fields_reviewed": 1227, "real_executions": 0, "states": {"pending_check": 16, "needs_conversion": 140}, "named_values_preserved": 1227, "unnamed_widget_nodes": 3701, "semantic_batch_files": 140, "semantic_batch_without_named_fields": 114, "semantic_batch_named_fields": 500, "named_values_without_manual_field_review": 0, "named_values_without_verified_units_ranges_effects": 1227, "scope_limit": "人工结论与机械原值清单分开;源语义局部审校非完整说明定稿", "partition": {"prior_files": 16, "prior_named_fields": 42, "new_files": 140, "new_named_fields": 500, "new_without_named_fields": 114, "disjoint_complete_sha_verified": true, "prior_review_payloads_unchanged": true}, "fourth_partition": {"mechanical_values_checked": 1227, "prior_reviewed": 542, "added_reviewed": 685, "new_files": 16, "classification_counts_new": {"runtime_parameter": 590, "frontend_state": 6, "current_value_only": 41, "semantic_unknown": 48}, "duplicates": 0, "prior_156_payloads_preserved": true, "added_fields_with_runtime_source_use": 590, "added_fields_without_confirmed_runtime_meaning": 95, "verified_units_ranges_effects": 0, "full_documents_completed": 0, "real_executions": 0}}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+304
View File
@@ -0,0 +1,304 @@
{
"1": {
"inputs": {
"preprocessor": "DepthAnythingPreprocessor",
"resolution": 512,
"image": [
"2",
0
]
},
"class_type": "AIO_Preprocessor",
"_meta": {
"title": "Aux集成预处理器"
}
},
"2": {
"inputs": {
"image": "comfyui-airport-editorial_00001_.png"
},
"class_type": "LoadImage",
"_meta": {
"title": "加载图像"
}
},
"3": {
"inputs": {
"images": [
"1",
0
]
},
"class_type": "PreviewImage",
"_meta": {
"title": "预览图像"
}
},
"4": {
"inputs": {
"ckpt_name": "depth_anything_vitl14.pth",
"resolution": 512,
"image": [
"2",
0
]
},
"class_type": "DepthAnythingPreprocessor",
"_meta": {
"title": "DepthAnything任何深度预处理器"
}
},
"5": {
"inputs": {
"images": [
"4",
0
]
},
"class_type": "PreviewImage",
"_meta": {
"title": "预览图像"
}
},
"10": {
"inputs": {
"low_threshold": 0.4,
"high_threshold": 0.8,
"image": [
"2",
0
]
},
"class_type": "Canny",
"_meta": {
"title": "Canny边缘检测"
}
},
"11": {
"inputs": {
"images": [
"10",
0
]
},
"class_type": "PreviewImage",
"_meta": {
"title": "预览图像"
}
},
"12": {
"inputs": {
"preprocessor": "CannyEdgePreprocessor",
"resolution": 1024,
"image": [
"2",
0
]
},
"class_type": "AIO_Preprocessor",
"_meta": {
"title": "Aux集成预处理器"
}
},
"13": {
"inputs": {
"images": [
"12",
0
]
},
"class_type": "PreviewImage",
"_meta": {
"title": "预览图像"
}
},
"18": {
"inputs": {
"preprocessor": "AnyLineArtPreprocessor_aux",
"resolution": 1024,
"image": [
"2",
0
]
},
"class_type": "AIO_Preprocessor",
"_meta": {
"title": "Aux集成预处理器"
}
},
"19": {
"inputs": {
"preprocessor": "LineArtPreprocessor",
"resolution": 1024,
"image": [
"2",
0
]
},
"class_type": "AIO_Preprocessor",
"_meta": {
"title": "Aux集成预处理器"
}
},
"20": {
"inputs": {
"preprocessor": "AnimeLineArtPreprocessor",
"resolution": 1024,
"image": [
"2",
0
]
},
"class_type": "AIO_Preprocessor",
"_meta": {
"title": "Aux集成预处理器"
}
},
"21": {
"inputs": {
"preprocessor": "LineartStandardPreprocessor",
"resolution": 1024,
"image": [
"2",
0
]
},
"class_type": "AIO_Preprocessor",
"_meta": {
"title": "Aux集成预处理器"
}
},
"22": {
"inputs": {
"images": [
"30",
0
]
},
"class_type": "PreviewImage",
"_meta": {
"title": "预览图像"
}
},
"28": {
"inputs": {
"direction": "right",
"match_image_size": true,
"spacing_width": 2,
"spacing_color": "white",
"image1": [
"18",
0
],
"image2": [
"19",
0
]
},
"class_type": "ImageStitch",
"_meta": {
"title": "图像拼接"
}
},
"29": {
"inputs": {
"direction": "right",
"match_image_size": true,
"spacing_width": 2,
"spacing_color": "white",
"image1": [
"20",
0
],
"image2": [
"21",
0
]
},
"class_type": "ImageStitch",
"_meta": {
"title": "图像拼接"
}
},
"30": {
"inputs": {
"direction": "down",
"match_image_size": true,
"spacing_width": 2,
"spacing_color": "white",
"image1": [
"28",
0
],
"image2": [
"29",
0
]
},
"class_type": "ImageStitch",
"_meta": {
"title": "图像拼接"
}
},
"33": {
"inputs": {
"preprocessor": "DWPreprocessor",
"resolution": 1024,
"image": [
"2",
0
]
},
"class_type": "AIO_Preprocessor",
"_meta": {
"title": "Aux集成预处理器"
}
},
"34": {
"inputs": {
"preprocessor": "AnimalPosePreprocessor",
"resolution": 1024,
"image": [
"38",
0
]
},
"class_type": "AIO_Preprocessor",
"_meta": {
"title": "Aux集成预处理器"
}
},
"36": {
"inputs": {
"images": [
"33",
0
]
},
"class_type": "PreviewImage",
"_meta": {
"title": "预览图像"
}
},
"37": {
"inputs": {
"images": [
"34",
0
]
},
"class_type": "PreviewImage",
"_meta": {
"title": "预览图像"
}
},
"38": {
"inputs": {
"image": "1772086821573.png"
},
"class_type": "LoadImage",
"_meta": {
"title": "加载图像"
}
}
}
+86
View File
@@ -0,0 +1,86 @@
{
"1": {
"inputs": {
"source": [
"9",
3
]
},
"class_type": "PreviewAny",
"_meta": {
"title": "预览任意"
}
},
"2": {
"inputs": {
"source": [
"9",
1
]
},
"class_type": "PreviewAny",
"_meta": {
"title": "预览任意"
}
},
"3": {
"inputs": {
"source": [
"9",
2
]
},
"class_type": "PreviewAny",
"_meta": {
"title": "预览任意"
}
},
"4": {
"inputs": {
"source": [
"9",
0
]
},
"class_type": "PreviewAny",
"_meta": {
"title": "预览任意"
}
},
"6": {
"inputs": {
"audio": "ComfyUI-qwenasr_00003_.mp3"
},
"class_type": "LoadAudio",
"_meta": {
"title": "加载音频"
}
},
"9": {
"inputs": {
"model": "Qwen/Qwen3-ASR-0.6B",
"precision": "bf16",
"attention": "auto",
"forced_aligner": "Qwen/Qwen3-ForcedAligner-0.6B",
"language": "auto",
"hints": "Important terms: ComfyUI, Qwen3-ASR\nUse exact casing for these terms.",
"output_format": "none",
"output_path": "",
"split_mode": "split_by_punctuation_or_pause_or_length",
"max_gap_sec": 0.6,
"max_chars": 40,
"max_inference_batch_size": 32,
"max_new_tokens": 256,
"normalize_text": true,
"unload_models": true,
"audio": [
"6",
0
]
},
"class_type": "AILab_Qwen3ASRSubtitle",
"_meta": {
"title": "Subtitle (QwenASR)"
}
}
}
+186
View File
@@ -0,0 +1,186 @@
{
"35": {
"inputs": {
"filename_prefix": "audio/audio_minimax_music3",
"format": "mp3",
"format.quality": "V0",
"audio": [
"37:43",
0
]
},
"class_type": "SaveAudioAdvanced",
"_meta": {
"title": "保存音频(高级)"
}
},
"37:6": {
"inputs": {
"unet_name": "MiniMax/minimax_music3_dit_fp16.safetensors",
"weight_dtype": "default"
},
"class_type": "UNETLoader",
"_meta": {
"title": "UNet加载器"
}
},
"37:13": {
"inputs": {
"caption": "Global Metadata: Lo-fi hip-hop, chillhop. 78 BPM, D flat major, major scale with jazzy extensions. Laid-back and dreamy throughout, a gentle warm drift with a subtle late-night glow that deepens in the middle and dissolves softly at the end. Studying, raining-outside, headphones-on late-night listening. Bedroom production: muddy warm texture, heavy vinyl crackle, tape hiss and wow-flutter pitch wobble, low-passed dusty mix, soft-clipped drums, everything slightly detuned and cozy.\n\nVocal Details: Soft androgynous vocal, hushed half-sung half-spoken delivery, sitting low in the mix like another instrument, lazy behind-the-beat phrasing, gentle breathy timbre. Sparse murmured double-tracked harmonies, occasional wordless \"mmm\" and \"ooh\" hums drenched in tape delay and warm spring reverb. Long stretches with no vocals at all.\n\nArrangement: Dusty boom-bap drums with a soft thumping kick, cracked snare with lazy swing, brushed hi-hats, low round sub bass. Warm Rhodes piano chords with slow chorus wobble as the harmonic bed, mellow jazzy guitar licks answering the vocal lines, constant vinyl crackle as texture. Intro: rain and vinyl noise, solo Rhodes chords fading in, drums slipping in halfway. Verses: minimal — drums, bass, Rhodes, soft guitar fills between lines. Instrumental sections: guitar and Rhodes trade relaxed jazzy phrases over the beat, occasional muted trumpet ghost notes far in the background. Bridge: drums drop away to rain, crackle, and floating detuned Rhodes, then the beat eases back in. Outro: elements fade one by one until only vinyl crackle and a last unresolved Rhodes chord remain.",
"lyrics": "[Intro]\nMmm...\n(rain on the window)\nOoh...\n\n[Verse]\nMidnight and the canvas glows\nDragging little wires where the current flows\nType a quiet dream, let the sampler drift\nNoise into a picture, like the fog just lifts\nTwenty slow steps, I'm in no hurry now\nLatents turning colors and I don't know how\nEvery render's like a polaroid I found\nSoft focus memories, no sound\n\n[Instrumental]\n\n[Verse]\nQueue another frame, let the motion breathe\nPictures start to move like the falling leaves\nVideo drifting by at twenty-four\nLittle animations on my bedroom floor\nSeed after seed like the rain outside\nSome of them are keepers, some I let slide\nSave the ones that feel like a Sunday slow\nNode to node to node... and off we go\n\n[Chorus]\nMmm... let it render on\n(take your time, take your time)\nOoh... by the morning it'll all be done\n(one more queue, one more try)\n\n[Instrumental]\n\n[Bridge]\nRain keeps drawing pictures on the glass...\nMy machine keeps dreaming...\nNeither of us fast...\n\n[Chorus]\nMmm... let it render on\n(take your time, take your time)\nOoh... by the morning it'll all be done\n(one more queue, one more try)\n\n[Instrumental]\n\n[Outro]\nMmm...\n(node to node)\nOoh... goodnight",
"seed": [
"37:38",
0
],
"max_duration": 60,
"cfg_scale": 1.7,
"top_k": 50,
"clip": [
"37:3",
0
]
},
"class_type": "MiniMaxMusic3TextEncode",
"_meta": {
"title": "MiniMax Music3 文本编码"
}
},
"37:3": {
"inputs": {
"clip_name": "MiniMax/minimax_music3_text_encoder_pruned_int8_convrot.safetensors",
"type": "minimax",
"device": "default"
},
"class_type": "CLIPLoader",
"_meta": {
"title": "加载CLIP"
}
},
"37:7": {
"inputs": {
"vae_name": "MiniMax/minimax_music3_dav.safetensors"
},
"class_type": "VAELoader",
"_meta": {
"title": "加载VAE"
}
},
"37:10": {
"inputs": {
"conditioning": [
"37:13",
0
]
},
"class_type": "ConditioningZeroOut",
"_meta": {
"title": "条件零化"
}
},
"37:15": {
"inputs": {
"seconds": [
"37:13",
1
],
"batch_size": 1
},
"class_type": "EmptyMiniMaxMusic3LatentAudio",
"_meta": {
"title": "空 MiniMax Music3 潜空间音频"
}
},
"37:9": {
"inputs": {
"seed": [
"37:38",
0
],
"steps": 30,
"cfg": 1.7,
"sampler_name": "euler",
"scheduler": "simple",
"denoise": 1,
"model": [
"37:6",
0
],
"positive": [
"37:13",
0
],
"negative": [
"37:10",
0
],
"latent_image": [
"37:15",
0
]
},
"class_type": "KSampler",
"_meta": {
"title": "K采样器"
}
},
"37:12": {
"inputs": {
"samples": [
"37:9",
0
],
"vae": [
"37:7",
0
]
},
"class_type": "VAEDecodeAudio",
"_meta": {
"title": "VAE解码(音频)"
}
},
"37:38": {
"inputs": {
"seed": 617970236276137
},
"class_type": "SeedNode",
"_meta": {
"title": "种子"
}
},
"37:42": {
"inputs": {
"tile_size": 1536,
"overlap": 64,
"samples": [
"37:9",
0
],
"vae": [
"37:7",
0
]
},
"class_type": "VAEDecodeAudioTiled",
"_meta": {
"title": "VAE解码音频(分块)"
}
},
"37:43": {
"inputs": {
"switch": true,
"on_false": [
"37:12",
0
],
"on_true": [
"37:42",
0
]
},
"class_type": "ComfySwitchNode",
"_meta": {
"title": "切换"
}
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+457
View File
@@ -0,0 +1,457 @@
{
"120": {
"inputs": {
"UNKNOWN": "Wan/Wan2_1-InfiniteTalk_Single_Q6_K.gguf"
},
"_meta": {
"title": ""
}
},
"122": {
"inputs": {
"UNKNOWN": "Wan/Wan2.1_I2V_14B_480p_AniWan_New_Q5_K_M.gguf",
"UNKNOWN_1": "fp16",
"UNKNOWN_2": "disabled",
"UNKNOWN_3": "offload_device",
"UNKNOWN_4": "sageattn",
"UNKNOWN_5": "default",
"block_swap_args": [
"134",
0
],
"lora": [
"138",
0
],
"multitalk_model": [
"120",
0
]
},
"_meta": {
"title": ""
}
},
"125": {
"inputs": {
"audio": "你的AI会韦伯斯特吗_.flac"
},
"class_type": "LoadAudio",
"_meta": {
"title": "加载音频"
}
},
"128": {
"inputs": {
"UNKNOWN": 4,
"UNKNOWN_1": 1.0000000000000002,
"UNKNOWN_2": 11.000000000000002,
"UNKNOWN_3": 178064833986090,
"UNKNOWN_4": "randomize",
"UNKNOWN_5": true,
"UNKNOWN_6": "dpm++_sde",
"UNKNOWN_7": 0,
"UNKNOWN_8": 1,
"UNKNOWN_9": false,
"UNKNOWN_10": "comfy",
"UNKNOWN_11": 0,
"UNKNOWN_12": -1,
"UNKNOWN_13": true,
"model": [
"122",
0
],
"image_embeds": [
"192",
0
],
"text_embeds": [
"317",
0
],
"multitalk_embeds": [
"194",
0
]
},
"_meta": {
"title": ""
}
},
"129": {
"inputs": {
"UNKNOWN": "Wan2_1_VAE_bf16.safetensors",
"UNKNOWN_1": "bf16",
"UNKNOWN_2": false,
"UNKNOWN_3": false
},
"_meta": {
"title": ""
}
},
"131": {
"inputs": {
"frame_rate": [
"328",
0
],
"loop_count": 0,
"filename_prefix": "video/WanVideo_InfiniteTalk",
"format": "video/h264-mp4",
"pix_fmt": "yuv420p",
"crf": 19,
"save_metadata": true,
"trim_to_audio": false,
"pingpong": false,
"save_output": true,
"images": [
"320",
0
],
"audio": [
"125",
0
]
},
"class_type": "VHS_VideoCombine",
"_meta": {
"title": "Video Combine 🎥🅥🅗🅢"
}
},
"134": {
"inputs": {
"UNKNOWN": 20,
"UNKNOWN_1": false,
"UNKNOWN_2": false,
"UNKNOWN_3": true,
"UNKNOWN_4": 0,
"UNKNOWN_5": 1,
"UNKNOWN_6": false
},
"_meta": {
"title": ""
}
},
"138": {
"inputs": {
"UNKNOWN": "Wan/Wan2.1_I2V_14B_lightx2v_cfg_step_distill_lora_rank64.safetensors",
"UNKNOWN_1": 1,
"UNKNOWN_2": false,
"UNKNOWN_3": false,
"prev_lora": [
"350",
0
]
},
"_meta": {
"title": ""
}
},
"192": {
"inputs": {
"UNKNOWN": 832,
"UNKNOWN_1": 480,
"UNKNOWN_2": 49,
"UNKNOWN_3": 9,
"UNKNOWN_4": false,
"UNKNOWN_5": "disabled",
"UNKNOWN_6": false,
"UNKNOWN_7": "infinitetalk",
"UNKNOWN_8": "",
"vae": [
"129",
0
],
"start_image": [
"291",
0
],
"clip_embeds": [
"237",
0
],
"width": [
"291",
1
],
"height": [
"291",
2
]
},
"_meta": {
"title": ""
}
},
"194": {
"inputs": {
"UNKNOWN": true,
"UNKNOWN_1": 400,
"UNKNOWN_2": 16,
"UNKNOWN_3": 1,
"UNKNOWN_4": 1,
"UNKNOWN_5": "para",
"UNKNOWN_6": false,
"UNKNOWN_7": false,
"wav2vec_model": [
"300",
0
],
"audio_1": [
"302",
0
],
"num_frames": [
"312",
0
],
"fps": [
"328",
0
]
},
"_meta": {
"title": ""
}
},
"237": {
"inputs": {
"UNKNOWN": 1,
"UNKNOWN_1": 1,
"UNKNOWN_2": "center",
"UNKNOWN_3": "average",
"UNKNOWN_4": true,
"UNKNOWN_5": 0,
"UNKNOWN_6": 0.5,
"clip_vision": [
"238",
0
],
"image_1": [
"291",
0
]
},
"_meta": {
"title": ""
}
},
"238": {
"inputs": {
"clip_name": "clip_vision_h.safetensors"
},
"class_type": "CLIPVisionLoader",
"_meta": {
"title": "加载CLIP视觉"
}
},
"284": {
"inputs": {
"image": "ComfyUI_01361_.png"
},
"class_type": "LoadImage",
"_meta": {
"title": "加载图像"
}
},
"291": {
"inputs": {
"image": [
"347",
0
]
},
"class_type": "GetImageSizeAndCount",
"_meta": {
"title": "Get Image Size & Count"
}
},
"300": {
"inputs": {
"UNKNOWN": "wav2vec2-chinese-base_fp16.safetensors",
"UNKNOWN_1": "fp16",
"UNKNOWN_2": "main_device"
},
"_meta": {
"title": ""
}
},
"301": {
"inputs": {
"UNKNOWN": "MelBandRoformer_fp16.safetensors"
},
"_meta": {
"title": ""
}
},
"302": {
"inputs": {
"model": [
"301",
0
],
"audio": [
"125",
0
]
},
"_meta": {
"title": ""
}
},
"312": {
"inputs": {
"expression": "ceil((a/1000)*b)+1",
"a": [
"315",
0
],
"b": [
"328",
0
]
},
"class_type": "MathExpression|pysssss",
"_meta": {
"title": "Math Expression 🐍"
}
},
"315": {
"inputs": {
"audio": [
"125",
0
]
},
"class_type": "Audio Duration (mtb)",
"_meta": {
"title": "音频时长(mtb)"
}
},
"317": {
"inputs": {
"UNKNOWN": "她对着前面唱歌",
"UNKNOWN_1": "bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards",
"UNKNOWN_2": true,
"UNKNOWN_3": true,
"UNKNOWN_4": "gpu",
"t5": [
"319",
0
],
"positive_prompt": [
"355",
0
]
},
"_meta": {
"title": ""
}
},
"319": {
"inputs": {
"UNKNOWN": "umt5-xxl-enc-fp8_e4m3fn.safetensors",
"UNKNOWN_1": "bf16",
"UNKNOWN_2": "offload_device",
"UNKNOWN_3": "disabled"
},
"_meta": {
"title": ""
}
},
"320": {
"inputs": {
"UNKNOWN": false,
"UNKNOWN_1": 272,
"UNKNOWN_2": 272,
"UNKNOWN_3": 144,
"UNKNOWN_4": 128,
"UNKNOWN_5": "default",
"vae": [
"129",
0
],
"samples": [
"128",
0
]
},
"_meta": {
"title": ""
}
},
"328": {
"inputs": {
"value": 16
},
"class_type": "FloatConstant",
"_meta": {
"title": "Float Constant"
}
},
"345": {
"inputs": {
"value": 1280
},
"class_type": "INTConstant",
"_meta": {
"title": "INT Constant"
}
},
"347": {
"inputs": {
"UNKNOWN": "original",
"UNKNOWN_1": 351,
"UNKNOWN_2": 1,
"UNKNOWN_3": "letterbox",
"UNKNOWN_4": "lanczos",
"UNKNOWN_5": "16",
"UNKNOWN_6": "longest",
"UNKNOWN_7": 720,
"UNKNOWN_8": "#000000",
"image": [
"284",
0
],
"scale_to_length": [
"345",
0
]
},
"_meta": {
"title": ""
}
},
"348": {
"inputs": {
"images": [
"347",
0
]
},
"class_type": "PreviewImage",
"_meta": {
"title": "预览图像"
}
},
"350": {
"inputs": {
"UNKNOWN": "Wan/Wan2.1_T2V_14B_480p_rCM_lora_average_rank_83_bf16_人物多动态.safetensors",
"UNKNOWN_1": 0.3,
"UNKNOWN_2": false,
"UNKNOWN_3": false
},
"_meta": {
"title": ""
}
},
"355": {
"inputs": {
"prompt": "对着观众说话"
},
"class_type": "CR Prompt Text",
"_meta": {
"title": "⚙️ CR Prompt Text"
}
}
}
File diff suppressed because it is too large Load Diff
+145
View File
@@ -0,0 +1,145 @@
{
"schema_version": 1,
"cases": [
{
"id": "01",
"source_path": "example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/ControlNet_aux_常用样例.json",
"source_sha": "03d2fe6ae190c7cae17b89947f8975016616014a",
"export_file": "01.api.json",
"source_sha256": "8898689d777330c4749a079cd762f573bb12a278c47a2fefbd066ffbdc122b6b",
"export_sha256": "0ed76e088a23af43d6fecbf273fc0a983d7112e2b046d347f715afffac56d57e",
"original_filename": "ControlNet_aux_常用样例.json",
"provider": "白栖知",
"attachment_id": "01a187e2-366f-7cdc-88cf-e0ee34746154",
"received_at": "2026-10-29T13:38:38Z",
"received_at_basis": "主卡附件评论创建时间;不是导出时间",
"source_comment_id": "01a187e2-4f6e-761e-9412-43042e094daa",
"exported_at": null,
"frontend_version": null,
"node_versions": null,
"provenance": "user_supplied_api_export_environment_unknown",
"source_export_equivalence_verified": false,
"instruction": "图像预处理:API节点2和38各读一张图;1/4/10/12/18/19/20/21/33/34按各自具名参数预处理,28/29/30拼接,多个PreviewImage仅作预览。检查两张输入文件及分支连线,不能把Reroute剔除当通用转换规则。"
},
{
"id": "02",
"source_path": "example_ComfyUI_workflows/1-语音生成/Qwen3-ASR-Subtitle语音转字幕.json",
"source_sha": "08a7519a6a6c532b8a0670dce3deff70881527ef",
"export_file": "02.api.json",
"source_sha256": "47f9afa955a6a5dce37000cb6a15bac7516d26ff50b6398bda334c825552cfd8",
"export_sha256": "daa40971b730076691721afe95e165932df94e3423f1fc44dcb7707026e7125b",
"original_filename": "Qwen3-ASR-Subtitle语音转字幕.json",
"provider": "白栖知",
"attachment_id": "01a187e2-366c-7d95-87e8-231a4b305a9e",
"received_at": "2026-10-29T13:38:38Z",
"received_at_basis": "主卡附件评论创建时间;不是导出时间",
"source_comment_id": "01a187e2-4f6e-761e-9412-43042e094daa",
"exported_at": null,
"frontend_version": null,
"node_versions": null,
"provenance": "user_supplied_api_export_environment_unknown",
"source_export_equivalence_verified": false,
"instruction": "语音转字幕:6.audio读入音频,9.audio接6的槽0;9具名hints已内联,原PrimitiveNode不在API中。1/2/3/4的source分别接9的槽0/1/2/3;原图标示STRING出口,只能确认文本预览,output_path字段不能证明已经产出字幕文件,文件映射仍待真实历史响应。"
},
{
"id": "03",
"source_path": "example_ComfyUI_workflows/2-音乐生成/minimax_music_文生音乐.json",
"source_sha": "c248b9f72ba42a8fe2e27ab3762d2ef56869b0f8",
"export_file": "03.api.json",
"source_sha256": "0a655ead5a0da406159dceb46451439df0c02050becaaa25b3018abb41840284",
"export_sha256": "91e6c2cea3747a03bbb71f661dbd016b28040781482b956365ff76a7a8b647ce",
"original_filename": "minimax_music_文生音乐.json",
"provider": "白栖知",
"attachment_id": "01a187e2-366a-7575-b7e1-f4d66e5e2c1d",
"received_at": "2026-10-29T13:38:38Z",
"received_at_basis": "主卡附件评论创建时间;不是导出时间",
"source_comment_id": "01a187e2-4f6e-761e-9412-43042e094daa",
"exported_at": null,
"frontend_version": null,
"node_versions": null,
"provenance": "user_supplied_api_export_environment_unknown",
"source_export_equivalence_verified": false,
"instruction": "音乐:37子图展开为37:*节点;37:13.caption/lyrics经clip编码,37:38.seed连接编码器和采样器;37:43.switch选择普通/分块解码,35.audio接开关结果并配置filename_prefix/format/format.quality。先核对保存节点、时长及开关现值;尚未验证音频文件响应。"
},
{
"id": "04",
"source_path": "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_文生图_提示词增强.json",
"source_sha": "791b23c19730a5a88dbf19247bfae5c814df9741",
"export_file": "04.api.json",
"source_sha256": "dfe10917d101bf1a8a8c20750f4360690ecd478e9eb33d16a59ea0c6f12c086c",
"export_sha256": "2066b07b2ca5390ba3e795df6b43934dab83865b12870b6ff26d8c0ef24f091e",
"original_filename": "Qwen_image2.1_文生图_提示词增强.json",
"provider": "白栖知",
"attachment_id": "01a187e2-3666-7bc7-9101-98fe3dab8070",
"received_at": "2026-10-29T13:38:38Z",
"received_at_basis": "主卡附件评论创建时间;不是导出时间",
"source_comment_id": "01a187e2-4f6e-761e-9412-43042e094daa",
"exported_at": null,
"frontend_version": null,
"node_versions": null,
"provenance": "user_supplied_api_export_environment_unknown",
"source_export_equivalence_verified": false,
"instruction": "文生图:13输出分辨率,483.value提供提示词,459子图展开;459:471为TextGenerate,459:474开关连接提示词分支,459:452编码后经459:458采样及459:457解码送461保存。具名采样字段和嵌套配置原值来自API,不由位置控件推断;开关行为与模型版本待核查。"
},
{
"id": "05",
"source_path": "example_ComfyUI_workflows/4-视频生成/Minimax-h3/MiniMax_H3_导演台时间线素材_双采样潜空间放大_多分段拼接.json",
"source_sha": "ad7d38328e79df4fc9e76664148e45644fa6e4c8",
"export_file": "05.api.json",
"source_sha256": "172eb8af3aca70082941427520fdcca06568957bab3d39101c5e9d6641b45e4a",
"export_sha256": "95a01c1ea27a8279a6dc202820505099a94161d91e0789189b61208b09007af8",
"original_filename": "MiniMax_H3_导演台时间线素材_双采样潜空间放大_多分段拼接.json",
"provider": "白栖知",
"attachment_id": "01a187e2-3664-76ba-bacc-507b9e8c468a",
"received_at": "2026-10-29T13:38:38Z",
"received_at_basis": "主卡附件评论创建时间;不是导出时间",
"source_comment_id": "01a187e2-4f6e-761e-9412-43042e094daa",
"exported_at": null,
"frontend_version": null,
"node_versions": null,
"provenance": "user_supplied_api_export_environment_unknown",
"source_export_equivalence_verified": false,
"instruction": "视频时间线:7.timeline_data保留完整JSON字符串,7.finite_plan供8.finite_plan;8接模型/CLIP/双VAE/sampler/sigmas,9接图像及音频后送10保存。先核对时间线素材引用、generation_seconds、分辨率及seed;标题提及的二采与拼接不能代替实际16节点API证据,时间线执行语义待节点定义。"
},
{
"id": "06",
"source_path": "example_ComfyUI_workflows/5-数字人/Wan2.1_I2V_InfiniteTalk_rCM_数字人对口型多动态(KJ版).json",
"source_sha": "f902213a4d0368017e451676e2998b547409f9b9",
"export_file": "06.api.json",
"source_sha256": "90fb512939d5bbaebfd3462d8edd019ad388611951748e6df09993ddd7f3a36f",
"export_sha256": "3e9176a5346ce8b8122b6da10f377fbeb894dc7c2c82a415f85ffc0dbfefc90b",
"original_filename": "Wan2.1_I2V_InfiniteTalk_rCM_数字人对口型多动态(KJ版).json",
"provider": "白栖知",
"attachment_id": "01a187e2-3664-761a-b711-c364fb81c75b",
"received_at": "2026-10-29T13:38:38Z",
"received_at_basis": "主卡附件评论创建时间;不是导出时间",
"source_comment_id": "01a187e2-4f6e-761e-9412-43042e094daa",
"exported_at": null,
"frontend_version": null,
"node_versions": null,
"provenance": "user_supplied_api_export_environment_unknown",
"source_export_equivalence_verified": false,
"instruction": "数字人导出不完整:28节点中17个缺class_type且含UNKNOWN字段,保留原文和原图候选类型用于定位,不补写类型、不采用为执行图;不能据此断言目标机缺了哪些插件。"
},
{
"id": "07",
"source_path": "example_ComfyUI_workflows/6-动作迁移/Wan_Animate2_动作迁移_for循环长视频.json",
"source_sha": "b8708632a9c585f697aa1dae6d32d5a2996715b2",
"export_file": "07.api.json",
"source_sha256": "22b7853e22629822dd354b0b768e2961a53b4c2f480cfaceeaea9dc51c0f0d0b",
"export_sha256": "b1b4f6a6c02d8d21701943c67b62805b1210fed17e7e26b618c58e112ea1d70d",
"original_filename": "Wan_Animate2_动作迁移_for循环长视频.json",
"provider": "白栖知",
"attachment_id": "01a187e2-365f-7e64-9e07-87b60da5152e",
"received_at": "2026-10-29T13:38:38Z",
"received_at_basis": "主卡附件评论创建时间;不是导出时间",
"source_comment_id": "01a187e2-4f6e-761e-9412-43042e094daa",
"exported_at": null,
"frontend_version": null,
"node_versions": null,
"provenance": "user_supplied_api_export_environment_unknown",
"source_export_equivalence_verified": false,
"instruction": "动作迁移:261与477两个子图分别展开,477:458包含continue_motion;606:590/599保留for循环起止及初值连线。585读视频并配置frame_load_cap/skip_first_frames等;API另有612 LoadImage,原图没有同ID节点,属源变化待核查。245合成图像与音频送246保存;video_frame_offset与循环尾批行为未实跑确认。"
}
]
}
@@ -0,0 +1,64 @@
本批采用用户提供的API配套图,未完成通用UI转换,也未进行真实执行。PR #25,base `main`,继续原分支 `agent/agent/a64a969a6a44`;开工head/远端PR head均为 `d9f332895857a16058e9d0202da4d6f76f4dbb81`。没有修改前端、源工作流、在线配置或数据。
## 输入与来源
7份附件原字节保存在 `supplied-api/01.api.json` 至 `07.api.json`。`supplied-api/manifest.json` 逐份记录提供者、附件ID、原文件名、接收时间、原文件SHA256、准确源路径、源SHA1及SHA256。接收时间依据主卡附件评论 `01a187e2-4f6e-761e-9412-43042e094daa` 的创建时间,不是导出时间。真实导出时间、前端版本、节点包版本均为null;源文件自带的版本属性不能证明本次导出环境。清单没有填入“已验证原样导出”断言,路径/哈希绑定也不证明历史来源或逐值等价。
检查未发现凭据标记或绝对本地路径;未执行任何附件内文本、脚本、提示词或引用请求。原始文件未修改。case06仍完整保留用于复验,不补写class_type。
## 逐case结果
“具名现值”指API内非连线inputs的保留数量,不代表新增确认了语义,也不计作源侧1227项审校。
|case|API节点/inputs|配套保留的具名现值|隔离导入结果及实际说明|
|---|---:|---:|---|
|01|22/57|34|采用配套API,pending_check;2/38两路LoadImage、10 Canny、预处理分支、28/29/30拼接与7个PreviewImage映射已衔接。14个直接连线吻合,9处源连线与API不同(包含Reroute边界),不忽略差异。位置控件仍不按顺序猜名。|
|02|6/21|16|采用配套API,pending_check;6.audio→9.audio、模型/语言/精度/hints/output_format等现值保留。1/2/3/4分别接9的0/1/2/3槽,源标示STRING;仍unknown、空文件输出映射。PrimitiveNode内联与实际字幕文件响应待核查,不能凭output_path宣称已有文件。|
|03|12/40|24|采用37:*子图配套API,pending_check;caption/lyrics、种子连线、时长、KSampler、普通/分块解码与ComfySwitchNode、35保存配置已保留。15处直接连线吻合、9处差异;子图边界上的默认值与API连线有类型差异,未当逐值相同。SaveAudioAdvanced不在可信输出注册表,仍unknown、空映射,不把AUDIO连线当历史文件证据。|
|04|16/60|42|采用459:*配套API,pending_check;分辨率、提示词增强TextGenerate及switch分支、采样/解码/461保存已衔接。13处直接连线吻合、20处差异;包括子图边界、提示词及随机种子配置差异。仅461为既有可信图像输出映射,不能代表生成通过。|
|05|16/66|48|采用配套API,pending_check;timeline_data原JSON字符串、generation_seconds、width/height连线、有限计划采样、图像/音频合成和10 SaveVideo已衔接。18处直接连线吻合;5个未连线具名值存在差异,涉及模型/LoRA引用,不当成同值。标题的二采/放大/多分段不能代替16节点的实际证据,插件语义和时间线素材仍待核查。|
|06|28/143|0|拒绝采用,needs_conversion;17节点缺class_type(120、122、128、129、134、138、192、194、237、300、301、302、317、319、320、347、350)。证据记录原图同ID类型作为候选定位,未补写API,不能据此断言缺插件。主卡后续用户表示该份不需要;本批未擅自删除条目或修改全量验收范围,由总管统一处理范围。|
|07|72/251|130|采用配套API,pending_check;261/477子图、477:458.continue_motion、606:590/599循环、video_frame_offset、585视频输入和245/246合成保存已保留。93处直接连线吻合、57处不同,585.video有明确具名值变化;新增612 LoadImage在原图不存在。循环尾批/虚拟节点展开仍未核验,不宣称与原图等价。|
6份合计保留294个API具名现值。所有638个API inputs(含case06的143个未确认字段)逐项保留值及类型、原图节点/命名字段/连线证据和差异;_meta完整保留并单列标题对照。无法证明位置控件、子图边界或虚拟节点对应关系时明确unverified,不忽略种子、路径、分支或槽差异。`sixth-evidence/01.json` 至 `07.json` 为完整节点级记录,`summary.json` 汇总差异及映射。
## 实现与数据保护
- `companions.py`:显式加载清单、校验原始字节哈希及源路径/双哈希;复用现有API结构/连线检查,源图+API对照保留所有节点与字段,支持核对源子图的对象型连线。具名控件仅采用源中明确存在的widgets_values_named或字典,不推断位置数组。
- `library.py`、`library_cli.py`:新增可选 `--companions`,只作用于清单准确绑定的7份;API作为workflow_json原样数据保留,原始源图和旧source_review不变。doc_json新增api_companion及294个独立标明来源的参数、6份具体中文步骤、API输入输出和模型引用。说明参数用“配套API:”作用域并保留api_node_id,防止套用原图同ID字段的旧语义审校。单位、范围和效果仍未知。
- 不传清单保持旧行为;移除配套清单或源哈希变化会撤销旧配套;文件哈希错误/JSON损坏在写库前拒绝。清单内容或说明版本变化刷新未修改条目。沿用整行指纹保护、单事务批次与快照回退;用户改动行不覆盖,回退可恢复旧行。无自动启用、安装、下载或执行。
- 每份采用的API都附companion_unverified阻塞,即使将来传入快照也不会绕过待核查。6份均pending_check、默认停用,说明和实跑时间戳为空;缺类型文件保持needs_conversion。重新分析、启用和测试入口仍受原有拦截。
- `audit_library_documents.py` 保持原源侧审校集合审计,另核对API参数来源和值;新增 `audit_supplied_api.py` 从原始材料/源文件/隔离数据库核对哈希、prompt全保留、294参数和关闭状态。
## 本次验证
- 受影响12组回归142 passed;之后完成参数作用域隔离与源版本失效用例,最终4组数据链路41 passed(包含本批11项配套专项),不是与142相加的独立数量。
- 覆盖真实7份结构检查与6份合法导出保留、文件/源错配、API哈希变化、源SHA变化失效、缺class_type、缺失上游、负输出槽、正槽差异的精确对照、bool/int类型区别、具名seed差异、元信息差异、子图对象型连线、实际入库、重导156 skipped、说明升级、整行用户保护、撤销配套、批次回退和启用/测试拦截。
- 全库实际隔离导入156条,16 pending_check、140 needs_conversion;这是10份原API+6份配套API,并非146份通用转换已完成。重复导入156 skipped。原156份源说明审计、第三批140份分区和第四批685字段分区均通过;原1227源具名值及3701未具名控件记录保留。
- 改动6个Python文件Ruff通过,wheel/sdist构建通过,git diff --check通过。后台全量829/5旧失败/6跳过属于此前批次记录,本次未重跑全后台或前端检查;不声称全仓lint/测试全绿。未新增依赖。
- 本次未连接目标机或用户本地、未暂停TTS/启动ComfyUI、未调用/prompt、未实跑媒体/字幕、未写在线库、未合并或部署。
## 离线复现
在仓库根目录使用现有锁定依赖。只传操作人明确指定的隔离数据库路径;下列命令不会提交生成任务。
```bash
uv sync --project calliope-backend --frozen --extra dev --python 3.11
uv run --project calliope-backend --frozen python -m calliope.comfyui.library_cli import \
--root example_ComfyUI_workflows --db .local-evidence/review.db \
--source-commit d9f332895857a16058e9d0202da4d6f76f4dbb81 \
--companions docs/hel-892/supplied-api/manifest.json --output-dir .local-evidence/review
uv run --project calliope-backend --frozen python calliope-backend/scripts/audit_supplied_api.py \
--repo . --manifest docs/hel-892/supplied-api/manifest.json \
--db .local-evidence/review.db --output .local-evidence/paired-audit
uv run --project calliope-backend --frozen python calliope-backend/scripts/audit_library_documents.py \
--repo . --documents .local-evidence/review --output .local-evidence/source-audit.json \
--partition docs/hel-892/third-evidence/review-partition.json \
--fourth-partition docs/hel-892/fourth-evidence/field-partition.json
```
重复第一条import应156 skipped;批次回退仍用原 `library_cli rollback --db ... --batch-id ... --output-dir ...`。
## 剩余缺口
6份是提供的执行图配套材料,通用可靠转换仍有146份未证明;其中6份现可采用配套API继续核查,其余140份尚无可采用API(含case06)。代表样本不能推广至其他139份。仍有156份完整说明未定稿、真实环境检查和约定必要实跑未完成;完整定稿0、实跑0。6份还需核查源差异及展开/分支、准确导出版本、可信节点定义对应的字段单位/范围/实际输入输出;字幕和高级音频保存尤其缺真实文件响应证据。模型/素材引用只证明图内引用,不证明存在或缺失。本批请HEL-893审核增量,全量完成并审核通过后才考虑部署。