Files
aigc-home/docs/hel-892/qwen-edit-document-evidence/build_definition.py
T

706 lines
32 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Build editorial evidence for the exact edit graph; never create an execution profile."""
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
PATH = "example_ComfyUI_workflows/3-图像生成/Qwen-Image-2.1/Qwen_image2.1_图像编辑_提示词增强.json"
def canonical(value):
return json.dumps(value, ensure_ascii=False, sort_keys=True, separators=(",", ":")).encode()
def build():
raw = (REPO / PATH).read_bytes()
source = json.loads(raw)
graph = source["definitions"]["subgraphs"][0]
old = json.loads((OUT.parent / "qwen-document-evidence/definition.json").read_bytes())
refs = copy.deepcopy(old["sources"])
specs = {}
for f in old["fields"]:
if f["scope"] != "definition" and f["class_type"] not in (
"ResolutionSelector",
"SaveImageAdvanced",
):
continue
specs[f["class_type"], f["field"]] = {
k: copy.deepcopy(f[k])
for k in (
"field",
"label",
"type",
"schema_default",
"unit",
"limits",
"effect",
"evidence",
)
}
def ref(directory, filename, start, end, claim):
directory_path = OUT.parent / directory
entry = next(
x
for x in json.loads((directory_path / "sources.json").read_bytes())["sources"]
if x["local_file"] == filename
)
data = (directory_path / filename).read_bytes()
assert hashlib.sha256(data).hexdigest() == entry["sha256"]
assert 1 <= start <= end <= len(data.decode().splitlines())
refs.append(
{
**{k: entry[k] for k in ("id", "commit", "file", "url", "sha256")},
"local_file": "../" + directory + "/" + filename,
"lines": [start, end],
"claim": claim,
}
)
return len(refs) - 1
load = ref(
"promoted-reference",
"core-0.38.0__nodes.py",
1746,
1820,
"LoadImage动态文件列表、注解路径、加载分支、IMAGE/MASK与存在性校验",
)
preview = ref(
"promoted-reference",
"core-0.38.0__nodes.py",
1667,
1744,
"SaveImage IMAGE出口及PNG保存、PreviewImage继承并改为temp目录/随机前缀",
)
py = ref(
"qwen-edit-reference",
"rgthree__py__image_comparer.py",
1,
45,
"rgthree精确schema、A/B临时预览与result回传;继承core IMAGE出口",
)
js = ref(
"qwen-edit-reference",
"rgthree__web__comfyui__image_comparer.js",
8,
76,
"历史URL构造、执行响应、rgthree_comparer创建和serialize去img保留数组",
)
restore = ref(
"qwen-edit-reference",
"rgthree__web__comfyui__image_comparer.js",
180,
243,
"setter接受数组或images包装、selected与Image对象恢复;本轮不调用setter",
)
slide = ref(
"qwen-edit-reference",
"rgthree__web__comfyui__image_comparer.js",
244,
308,
"Click与Slide的绘制条件;只读静态源码",
)
ref(
"qwen-edit-reference",
"rgthree____init__.py",
35,
73,
"导入RgthreeImageComparer并以NAME注册",
)
ref(
"qwen-edit-reference",
"rgthree__py__constants.py",
1,
11,
"Python Image Comparer名称后缀注册规则",
)
ref(
"qwen-edit-reference",
"rgthree__web__comfyui__constants.js",
1,
62,
"前端Image Comparer名称枚举",
)
ref(
"qwen-edit-reference",
"core__comfy_extras__nodes_post_processing.py",
519,
593,
"BatchImagesNode注册schema、空列表条件、首图尺寸及通道匹配(无None过滤)、合批",
)
ref(
"qwen-edit-reference",
"core__comfy_extras__nodes_post_processing.py",
890,
914,
"BatchImagesNode扩展注册",
)
upload = ref(
"qwen-edit-reference",
"frontend__src__extensions__core__uploadImage.ts",
1,
40,
"LoadImage前端上传控件注册和处理,非后端image参数",
)
upload_widget = ref(
"qwen-edit-reference",
"frontend__src__renderer__extensions__vueNodes__widgets__composables__useImageUploadWidget.ts",
105,
142,
"上传button初值image且serialize:false;含恢复后预览回调;本轮未执行",
)
ref(
"qwen-edit-reference",
"rgthree__web__comfyui__base_node.js",
76,
83,
"rgthree configure委托固定LGraphNode,再恢复控件显示位置",
)
ref(
"qwen-edit-reference",
"rgthree__web__comfyui__utils_widgets.js",
21,
38,
"RgthreeBaseWidget的serializeValue返回value,Comparer的onSerialize再转images数组",
)
effects = {
"UNETLoader": (
"按diffusion_models解析文件;default不强制"
"dtype,fp8选项设置加载选项。宿主unet_name覆"
"盖内部文件名,名称bf16/int8不证明精度或显存;权重/设备"
"未核对。"
),
"CLIPLoader": (
"按text_encoders解析文件、type映射CLIPTyp"
"e;device=cpu显式设加载/卸载设备。453图像编码"
"与477编辑PE文本生成均保存qwen_image,宿主文件各自"
"覆盖;目标列表/硬件未知。"
),
"VAELoader": "按vae列表与近似模型条件解析文件并创建VAE;宿主覆盖内部文件"
"名。本图既向474参考图编码供VAE也向457解码供VAE,文件"
"存在与真实能力未知。",
"EmptyLatentImage": (
"width/height按像素尺度创建[batch,4,heig"
"ht//8,width//8]空latent;宽高被宿主/根"
"502覆盖。456槽0进468.on_true,不等于编码器47"
"4的64通道latent,目标兼容和实际尺寸未验证。"
),
"ResolutionSelector": (
"固定比例/MP/倍数参与total_pixels=MP×1024"
"×1024、开方后round到倍数。源比例9:16,1.5M"
"P与8不当实测产物;槽0/1经810/811覆盖宿主width/height。"
),
"KSampler": (
"按固定core将seed/steps/cfg/sampler_name/scheduler/denoise交给common_"
"ksampler。宿主scheduler实际绑定sampler_"
"name,scheduler_1才是scheduler;不承"
"诺质量/耗时/推理可重复。"
),
"ComfySwitchNode": (
"固定代码true选择on_true,false选择on_fals"
"e,并按lazy条件请求分支。484为提示优化,468为自定"
"义尺寸;两个内部false都由不同宿主true覆盖,不能凭标签推"
"分支。"
),
"QwenImage21Cache": (
"clone模型并写transformer_options.qwen_image21_cache的device/dtype。a"
"uto/gpu/cpu/off及default/int8/int"
"4是固定枚举;没有运行模型,真实缓存/速度/显存/误差未知。"
),
"TextEncodeQwenImage21": (
"474同时接两图与VAE:按数字后缀排序,跳过None,每项只取"
"image[:1];resolution>0按像素预算缩放,"
"0按各图本身尺寸round到32并至少32。首个有效图确定编码l"
"atent空间;RGBA视觉分支合白底,VAE保留原通道。正"
"负token与参考latent送458,不能保证实际素材/兼容性。"
),
"TextGenerate": (
"500以477.clip和485图像批次tokenize;采样o"
"n按限定sampling_mode.*取值,max_leng"
"th为生成长度上限;thinking仅请求模型支持的思考。use"
"_default_template=false令skip_t"
"emplate=true且system_prompt为空,479"
"指南虽连线仍不采用;MTP无权重不保证生效,未生成文本。"
),
"PrimitiveStringMultiline": (
"479原始系统指南逐字保留,经807接500.system_pr"
"ompt;当前use_default_template=fa"
"lse使该指南不传入tokenize。原文不是本轮指令,也未改写或运行。"
),
"SaveImageAdvanced": (
"461接459输出,保存分支为png/8-bit/sRGB;前缀"
"image/Qwen_image_2.1参与目录/计数器及s"
"erialize替换,PNG整数化/颜色处理和元数据受固定代码与"
"disable_metadata条件控制。IMAGE透传经8"
"09到501.image_b,ui.images仅协议,未实际保存文件。"
),
}
individual = {
("KSampler", "seed"): "采样噪声种子,与文本生成种子来源相同但语义独立。",
("KSampler", "steps"): "去噪迭代步数,本图25;不保证质量或耗时。",
("KSampler", "cfg"): "条件引导强度,本图1区别于schema默认8。",
("KSampler", "sampler_name"): "采样算法,本图euler;宿主scheduler绑定此字段。",
("KSampler", "scheduler"): "噪声序列调度,本图simple;宿主scheduler_1绑定此字段。",
("KSampler", "denoise"): "去噪比例,本图1传入采样;不当实测质量。",
("TextGenerate", "prompt"): "500收到宿主中文编辑请求,覆盖内部空串,无根483外线。",
(
"TextGenerate",
"max_length",
): "传clip.generate的最大生成长度16256,不是汉字数或实测输出长度。",
("TextGenerate", "sampling_mode"): "on令do_sample为真并展开限定参数;off分支无子字段。",
(
"TextGenerate",
"sampling_mode.temperature",
): "on分支传temperature=1;随机性及文本效果未实测。",
("TextGenerate", "sampling_mode.top_k"): "on分支传top_k=20,schema默认64与执行缺省50另列。",
("TextGenerate", "sampling_mode.top_p"): "on分支传top_p=0.95;不承诺质量。",
(
"TextGenerate",
"sampling_mode.min_p",
): "on分支传min_p=0.05,本图与schema默认相同,执行缺省0另列。",
(
"TextGenerate",
"sampling_mode.repetition_penalty",
): "on分支传重复惩罚1.05,实际文本重复情况未知。",
(
"TextGenerate",
"sampling_mode.seed",
): "on分支种子由宿主1054732230873463覆盖内部0;限定名不自动添control_after_generate。",
(
"TextGenerate",
"sampling_mode.presence_penalty",
): "on分支传presence_penalty=0,调整效果未验证。",
(
"TextGenerate",
"thinking",
): "直接保存true,没有宿主思考控件覆盖;第二thinking输出未接,不声称有思考结果。",
(
"TextGenerate",
"use_default_template",
): "直接保存false,使原479指南不采用;不是schema默认true。",
(
"TextGenerate",
"mtp",
): "auto转True、off转False、数字转int;无MTP权重时无效,同seed输出亦不保证。",
("EmptyLatentImage", "batch_size"): "决定空latent批量维,本图1;与两参考图数量不同。",
("ResolutionSelector", "aspect_ratio"): "画面比例9:16,按冒号前后数值参与计算。",
("ResolutionSelector", "megapixels"): "目标总像素预算1.5×1024×1024,不是宽或高。",
(
"ResolutionSelector",
"multiple",
): "宽高各自round到8倍数,schema步进4与UI显示步进区别保留。",
("TextEncodeQwenImage21", "prompt"): "正向编码文本由484经480覆盖内部空串。",
(
"TextEncodeQwenImage21",
"negative_prompt",
): "负向编码文本由宿主空字符串覆盖,不等于未接参考图。",
}
for (cls, name), spec in specs.items():
spec["effect"] = individual.get((cls, name), "") + effects[cls]
spec["limits"] = (
spec["limits"]
.replace("源3:4", "源9:16")
.replace("本图保存fixed", "本图保存randomize")
.replace("本参考仅fixed", "本图randomize仅记录前端控制,不调用队列钩子")
)
if cls == "KSampler" and name == "control_after_generate":
spec["schema_default"] = "裸seed附加控制默认randomize;本图也保存randomize"
spec["effect"] = (
"仅前端种子控制,不进入后端prompt。原件为randomize"
",任务摘要fixed与原件不符;不改源值,不模拟队列变值,不"
"保证宿主seed运行时保持。限定sampling_mode.seed不自动附加控制。"
)
if cls == "TextEncodeQwenImage21" and name == "resolution":
spec["effect"] += (
" 本图宿主resolution=0覆盖内部1024,是保持各参考"
"图自身尺寸并对齐32的哨兵,不是无效或完全原尺寸。无有效图时"
"latent_w/h回退resolution or 1024。"
)
def add(cls, name, label, typ, default, unit, limits, effect, evidence):
specs[cls, name] = dict(
field=name,
label=label,
type=typ,
schema_default=default,
unit=unit,
limits=limits,
effect=effect,
evidence=evidence,
)
add(
"LoadImage",
"image",
"输入图像文件",
"动态COMBO / STRING",
"目标动态列表首项,无固定文件默认",
"不适用",
"目标input文件列表/注解路径,未访问。",
"保留源引用;固定加载器返回IMAGE和MASK,本图MASK均未"
"接。470供编辑第一参考与对比A,475供第二参考,不保证文件可"
"读/内容/批大小。",
[load],
)
add(
"LoadImage",
"upload",
"上传显示控制",
"前端控件 / STRING",
"image(前端显示状态)",
"不适用",
"前端上传控件,非后端执行字段。",
"源保存image是前端上传显示值,不是图片数据或文件名;不进入LoadImage.image,不执行上传。",
[upload, upload_widget, load],
)
add(
"Image Comparer (rgthree)",
"rgthree_comparer",
"历史A/B对比状态",
"前端复合ARRAY",
"构造值{images: []},不是后端参数",
"不适用",
"一个保存位置含两记录;selected/url历史状态,不证明当前可达。",
(
"位置数组由onSerialize取value.images并删除"
"img;具名包装仍为{images:[...img:{}]}"
",setter支持两形态。本图保留两层原形,不强作逐JSON相等"
"。固定Python继承PreviewImage,A/B各自可"
"能写temp PNG并返回a_images/b_images;输"
"出继承IMAGE,result优先A否则B。历史URL只作不"
"透明文本,不加载、不嵌图、不探测。"
),
[py, preview, js, restore, slide],
)
by_id = {n["id"]: n for n in graph["nodes"]}
bindings = []
for slot, boundary in enumerate(graph["inputs"][:18]):
targets = []
for lid in boundary["linkIds"]:
ei, edge = next((i, e) for i, e in enumerate(graph["links"]) if e["id"] == lid)
n = by_id[edge["target_id"]]
inp = n["inputs"][edge["target_slot"]]
targets.append(
dict(
node_id=f"459:{n['id']}",
definition_node_id=str(n["id"]),
field=inp["name"],
link_pointer=f"/definitions/subgraphs/0/links/{ei}",
target_pointer=f"/definitions/subgraphs/0/nodes/{graph['nodes'].index(n)}/inputs/{edge['target_slot']}",
)
)
bindings.append(
dict(
slot=slot,
name=boundary["name"],
boundary_id=boundary["id"],
boundary_pointer=f"/definitions/subgraphs/0/inputs/{slot}",
widget_id_rule=f"widgetId(rootGraph.id, 459, {boundary['name']!r})",
value_pointer=f"/nodes/0/widgets_values/{slot}",
named_pointer="/nodes/0/widgets_values_named/" + boundary["name"],
targets=targets,
)
)
targets = {(t["node_id"], t["field"]): b for b in bindings for t in b["targets"]}
fields = []
comments = []
for scope, g in [("root", source), ("definition", graph)]:
for ni, n in enumerate(g["nodes"]):
prefix = f"/nodes/{ni}" if scope == "root" else f"/definitions/subgraphs/0/nodes/{ni}"
if n["type"] in ("MarkdownNote", "Note"):
comments.append(
dict(
node_id=str(n["id"]),
pointer=prefix + "/widgets_values/0",
text=n["widgets_values"][0],
)
)
continue
names = list(n.get("widgets_values_named", {}))
values = n.get("widgets_values") or []
assert len(names) == len(values)
for offset, (name, value) in enumerate(zip(names, values)):
nid = str(n["id"]) if scope == "root" else f"459:{n['id']}"
binding = None
if n["id"] == 459:
binding = next(b for b in bindings if b["name"] == name)
t = next(
t
for t in binding["targets"]
if (by_id[int(t["definition_node_id"])]["type"], t["field"]) in specs
)
spec = copy.deepcopy(
specs[by_id[int(t["definition_node_id"])]["type"], t["field"]]
)
spec["label"] = "宿主暴露:" + spec["label"]
spec["field"] = name
note = "宿主保存值,经边界送至" + ", ".join(
t["node_id"] + "." + t["field"] for t in binding["targets"]
)
else:
spec = copy.deepcopy(specs[n["type"], name])
note = "保留此保存值;仅固定源码参考,未实跑。"
role = "scalar"
if (nid, name) in targets:
binding = targets[nid, name]
role = "linked"
note = f"内部保存值由宿主{binding['name']}({binding['value_pointer']})覆盖。"
if (n["id"] == 459 and name in ("width", "height")) or (
n["id"] == 456 and name in ("width", "height")
):
note += "根502经810/811覆盖宿主1024缓存,再经660/661到456;当前468选456。"
role = "linked"
if n["id"] == 459 and name == "prompt":
note += ";本图没有根外线覆盖,原始中文编辑请求同时到484.on_false与500.prompt。"
if n["id"] == 474 and name == "prompt":
note = (
"内部空串由480槽0经743覆盖,484槽0经791进480;switch_1=true选500生成文本。"
)
role = "linked"
if n["id"] == 479:
note = "经807连到500.system_prompt,use_default_template=false使指南不采用。"
if name == "control_after_generate":
role = "frontend"
note = (
"原保存randomize(并非fixed),前端控制不进prom"
"pt;未调用钩子,不推断队列后值。"
)
if n["type"] == "LoadImage" and name == "upload":
role = "frontend"
note = (
"前端上传button的保存显示值,serialize:false,"
"不进入后端prompt;未上传或触发预览回调。"
)
if n["id"] == 501:
role = "frontend"
note = (
"历史A/B预览复合状态,一项不是两项;具名包装另列在flow。URL仅文本,未请求。"
)
spec.update(
node_id=nid,
definition_node_id=str(n["id"]),
scope=scope,
class_type=n["type"],
value=value,
json_type=type(value).__name__,
pointer=prefix + f"/widgets_values/{offset}",
named_pointer=prefix + "/widgets_values_named/" + name,
role=role,
execution_note=note,
)
if binding:
spec["binding"] = binding
fields.append(spec)
assert len(fields) == 70 and len(comments) == 3 and len(bindings) == 18
comparer = next(n for n in source["nodes"] if n["id"] == 501)
flows = [
(
"本图用途:以两张参考图和中文编辑请求“为角色更换服装”作条件,可"
"选提示词优化,经采样/解码/PNG保存并与第一参考图对比。根"
"9节点7边、定义15节点58边,共24源节点65物理边;70保存"
"位置不是70最终执行参数,未构造执行候选。"
"执行标量计数0仅表示本轮未构造候选,不表示运行无需参数。"
),
(
"作用域:459引用bc1c967a-7f6a-4be9-a372"
"-dad16e4f28e3;18宿主保存值、根其它12值与内"
"部40值分列。widgetId(rootGraph.id,459"
",input.name)按边界/原件恢复;物理外线优先于宿主"
"保存,再覆盖内部保存值。未接images.image_3~10及"
"images.image_5_1等源名全部保留,不能据固定核"
"心同名认定前端兼容。"
),
(
"提示链:宿主prompt无外线,同时经739到484.on_fa"
"lse、802到500.prompt;switch_1=tr"
"ue经741到484.switch,500槽0经806到on_true,484经791到480.source,480经743"
"到474.prompt。false才直接采用原始编辑请求;Pre"
"viewAny只文本预览/透传,未生成字幕文件。"
),
(
"系统/思考:479指南经807进500.system_prompt,但use_default_template=false使"
"skip_template=true、system_prompt"
"为空;thinking=true仅请求支持能力,不是已产生思"
"考结果。原请求和指南作为不透明字符串保存,未改写或运行。"
),
(
"尺寸链:switch=true经703到468.switch,t"
"rue取456空latent(684→on_true),fa"
"lse才取474编码latent(724→on_false),输"
"出682到458.latent_image。根502比例9:"
"16/1.5MP/8经810/811覆盖宿主width/heig"
"ht=1024,再经660/661到456。本图不是两个开关"
"都控制提示词,也不保证不同latent通道与目标模型兼容。"
),
(
"resolution=0经725覆盖474内部1024:>0按r"
"esolution平方预算保持比例缩放,0按每项自身宽高ro"
"und到32并至少32;首个有效图确定编码latent空间。没有"
"图时回退resolution or 1024;自定义尺寸当前"
"取456,所以编码分辨率与采样latent尺寸须分开,不把0解释"
"成完全原尺寸或不生效。"
),
(
"两图链:470槽0经704到459.images.image_1"
",475槽0经728到image_2;分别扇出到474(71"
"0/711)和485(750/779)。474按数字后缀排序、跳"
"None、每项取首张;485将images.values送合"
"批,空列表返回None,代码不主动过滤None;按最大通道数给不"
"足者补1通道,再按首图宽高bilinear/center匹配"
"后cat成batch,501不参与这条编辑条件链。真实素材/可用"
"性/批大小/输出质量未知,不声称已读两图。"
),
(
"双seed:宿主1054732230873463经667到458.seed、804到500.sampling_mode.se"
"ed,两个内部0都保留为被覆盖保存值。KSampler实际con"
"trol_after_generate=randomize,"
"任务摘要fixed与源不符;只记录前端控制,不模拟队列随机化或保"
"证重复性,限定sampling_mode.seed不自动加种"
"子控制。"
),
(
"模型/条件:451→469缓存→458.model,453→47"
"4.clip,477→500.clip,两CLIP type"
"均为qwen_image;454向474和457供VAE。474"
"正负出口722/723到458,458经651到457解码,"
"457经650到子图输出,再672→461。宿主unet_name/clip_name/clip_name_1/vae_na"
"me与内部不同名均保留,路径反斜杠不归一化;动态选项、模型文件、"
"设备、显存与UE7.8实际安装未知。"
),
(
"对比拓扑:470槽0经808到501.image_a;459→4"
"61槽0经809到501.image_b。第二张475不直接"
"作A端。固定rgthree Python继承core Previ"
"ewImage/SaveImage的IMAGE出口并返回re"
"sult优先A,否则B;本图声明出口与该固定core一致,但其它"
"目标版本仍未知,未使用出口不删除。A/B各可能保存temp "
"PNG供UI,461永久输出与501临时预览分别说明,均未真实生成。"
),
(
"复合双存储:501仅一项widgets_values数组,含两个"
"历史A/B记录;widgets_values_named.r"
"gthree_comparer是images包装且带img={}"
"。固定JS setter接受数组或包装,serialize取"
"images并删img;不能套逐JSON相等规则,也不能证明具名"
"包装序列化钩子实际运行顺序。selected=true不证明"
"当前预览/文件存在。历史/api/view URL只作为不透明文"
"本,不加载、超链接探测或嵌图。"
),
"对比属性(不计入70项):"
+ json.dumps(comparer["properties"], ensure_ascii=False)
+ ";comparer_mode=Slide是显示属性,固定JS非C"
"lick时按指针位置绘制滑动对比;不是后端参数。双存储原具名包装"
":" + json.dumps(comparer["widgets_values_named"], ensure_ascii=False),
(
"三条源注释全文保留,可读但不当运行事实或下载授权。模型/素材链接"
"、原生2K/关闭取原尺寸等注释建议不能代替固定算法和实际环境"
"验证;仅本地说明GET,未访问历史/api/view或目标机。"
),
(
"执行边界:此图不在已审九份完整参考候选中;仅接入固定说明,未添加"
"profile或生成API。转换/未知依赖仍拦截,regis"
"try/object_info/client/output_map/worker不改,155定稿0/实跑0。"
),
]
for b in bindings:
flows.append(
"暴露绑定:459."
+ b["name"]
+ ";"
+ b["widget_id_rule"]
+ ";"
+ b["value_pointer"]
+ ";边界"
+ b["boundary_pointer"]
+ " → "
+ json.dumps(b["targets"], ensure_ascii=False)
)
for scope, g in [("root", source), ("definition", graph)]:
for i, e in enumerate(g["links"]):
flows.append("源边 " + scope + " " + str(i) + ":" + json.dumps(e, ensure_ascii=False))
return dict(
notice="固定版本参考说明:frontend1.53.6/core0.38"
".0与rgthree精确提交;UE7.8/目标安装/素材/实跑未"
"知,执行仍关闭",
source_path=PATH,
source_sha1=hashlib.sha1(raw).hexdigest(),
source_sha256=hashlib.sha256(raw).hexdigest(),
canonical_sha256=hashlib.sha256(canonical(source)).hexdigest(),
subgraph_sha256=hashlib.sha256(canonical(graph)).hexdigest(),
versions=[
"frontend1.53.6=7d533a4cd4c4904ff"
"db0537f6b80ae9793dd62f1;固定保存/恢复参"
"考,不证明队列或第三方具名序列化顺序。",
(
"核心声明core0.38.0=6b747c0428c343e1417219641db93a4fb7cb69ae;rgthre"
"e-comfy=449c58fcdd612f7733e54c51"
"f6758ead63fa180b;固定源码不证明目标安装。"
),
"UE7.8记录、未接动态端口/旧端口名与目标插件、动态模型/素材/设备/历史预览状态均待核对。",
],
counts=dict(
saved_fields=70,
root_saved=30,
definition_saved=40,
source_notes=3,
host_saved=18,
source_nodes=24,
physical_edges=65,
linked_saved_fields=sum(f["role"] == "linked" for f in fields),
frontend_only=sum(f["role"] == "frontend" for f in fields),
final_scalars=0,
final_prompt_constructed=False,
),
fields=fields,
sources=refs,
flow=flows,
flow_evidence=list(range(len(refs))),
comments=comments,
bindings=bindings,
steps=[
"核对两素材引用:470为第一参考和A端,475只作第二参考;MA"
"SK未接,不能把文件名中的masked当遮罩已参与。",
"核对宿主中文编辑请求,无根外线覆盖;提示词优化switch_1="
"true选500结果,false才直传请求。系统指南当前不采用,"
"思考仅支持条件。",
"分别核对resolution=0参考图对齐规则与自定义尺寸swi"
"tch=true空latent路径;根502宽高覆盖缓存,不能照"
"注释声称原尺寸或实际输出尺寸。",
"逐项核对18宿主绑定、40内部保存值及模型/两seed;rand"
"omize只是原前端状态,未运行队列,不保证双seed运行时相同"
"或可复现。",
(
"沿474条件→458采样→457解码→461 PNG→501.i"
"mage_b,对照470→image_a;历史A/B sel"
"ected和URL不是本次生成结果。常见误判是把第二参考作A、把"
"系统指南当生效、把内部缓存当有效尺寸、把历史URL当当前文件"
"。"
),
"真实文件读取、缺图/混合尺寸兼容、模型/设备/插件安装、hist"
"ory与PNG/临时文件/质量须未来授权实跑核对;当前全停用、未"
"定稿、未实跑。",
],
)
def main():
target = REPO / "calliope-backend/src/calliope/comfyui/source_reviews.json"
reviews = json.loads(target.read_bytes())
block = build()
assert reviews[PATH]["source_sha"] == block["source_sha1"]
reviews[PATH]["fixed_version_document"] = block
target.write_text(json.dumps(reviews, ensure_ascii=False, indent=2) + "\n")
(OUT / "definition.json").write_text(json.dumps(block, ensure_ascii=False, indent=2) + "\n")
print(hashlib.sha256(canonical(block)).hexdigest())
if __name__ == "__main__":
main()