911 lines
36 KiB
Python
911 lines
36 KiB
Python
"Static source-bound explanation of the original-frame interpolation chain."
|
||
|
||
from __future__ import annotations
|
||
|
||
import hashlib
|
||
import json
|
||
from pathlib import Path
|
||
|
||
REPO = Path(__file__).resolve().parents[3]
|
||
OUT = Path(__file__).resolve().parent
|
||
REF = OUT.parent / "simple-vfi-reference"
|
||
PATHS = [
|
||
(
|
||
"example_ComfyUI_workflows/0-基础"
|
||
"处理:图像合并-音频分离-视频截取合并-图像视频放大/高清放"
|
||
"大/视频模型放大插帧(简单快速版).json"
|
||
)
|
||
]
|
||
|
||
|
||
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()
|
||
graph = json.loads(raw)
|
||
entries = json.loads((REF / "sources.json").read_bytes())["sources"]
|
||
refs = []
|
||
|
||
def ref(key, file, first, last, claim):
|
||
e = next(e for e in entries if e["id"] == key and e["file"] == file)
|
||
data = (REF / e["local_file"]).read_bytes()
|
||
assert hashlib.sha256(data).hexdigest() == e["sha256"]
|
||
assert 1 <= first <= last <= len(data.decode().splitlines()), (file, first, last)
|
||
refs.append(
|
||
{
|
||
**e,
|
||
"local_file": "../simple-vfi-reference/" + e["local_file"],
|
||
"lines": [first, last],
|
||
"claim": claim,
|
||
}
|
||
)
|
||
return len(refs) - 1
|
||
|
||
literal = ref(
|
||
"literals",
|
||
"nodes.py",
|
||
11,
|
||
58,
|
||
("Int/Float准确STRING schema、int/float解析和失败抛错;不执行解析"),
|
||
)
|
||
ref("literals", "__init__.py", 1, 12, "Int/Float准确注册;初始化含startup hook,未执行")
|
||
cr = ref(
|
||
"cr",
|
||
"nodes/nodes_upscale.py",
|
||
19,
|
||
75,
|
||
("CR模型放大后按原图尺寸重采样;schema默认范围和当前rescale分支"),
|
||
)
|
||
resize = ref(
|
||
"cr",
|
||
"nodes/functions_upscale.py",
|
||
27,
|
||
86,
|
||
("模型路径/设备、OOM分块及rescale/resize、字符串supersample和最终尺寸"),
|
||
)
|
||
ref("cr", "node_mappings.py", 1, 15, "CR模块导入注册入口;ImportError条件未执行")
|
||
ref("cr", "node_mappings.py", 118, 125, "CR Upscale Image准确注册")
|
||
ref("cr", "__init__.py", 1, 25, "CR包注册入口")
|
||
rife = ref(
|
||
"rife",
|
||
"vfi_models/rife/__init__.py",
|
||
11,
|
||
107,
|
||
"RIFE模型名/架构映射、schema/函数缺省差别及推理参数传递",
|
||
)
|
||
loop = ref(
|
||
"rife", "vfi_utils.py", 124, 256, "相邻帧插值/末帧、可选跳帧状态与缓存清理条件;未运行"
|
||
)
|
||
download = ref("rife", "vfi_utils.py", 65, 109, "权重不存在时自动下载条件;本轮禁止执行/下载")
|
||
arch = ref(
|
||
"rife",
|
||
"vfi_models/rife/rife_arch.py",
|
||
370,
|
||
585,
|
||
("准确IFNet的ensemble分支及仅4.0/4.2/4.3采用非fast残差路径"),
|
||
)
|
||
ref("rife", "__init__.py", 13, 41, "RIFE类导入及映射注册")
|
||
impact = ref(
|
||
"impact",
|
||
"modules/impact/util_nodes.py",
|
||
389,
|
||
402,
|
||
("IMAGE批次逐张保留批次维,返回list/OUTPUT_IS_LIST=True;零控件"),
|
||
)
|
||
ref("impact", "__init__.py", 49, 49, "Impact util_nodes导入")
|
||
ref("impact", "__init__.py", 230, 230, "ImpactImageBatchToImageList注册")
|
||
essentials = ref(
|
||
"essentials",
|
||
"image.py",
|
||
171,
|
||
198,
|
||
("INPUT_IS_LIST=True,按第一项尺寸bicubic/center对齐后cat批次"),
|
||
)
|
||
ref("essentials", "image.py", 1621, 1621, "ImageListToBatch+准确注册")
|
||
ref("essentials", "__init__.py", 1, 20, "IMAGE_CLASS_MAPPINGS合入包注册")
|
||
ref(
|
||
"essentials",
|
||
"pyproject.toml",
|
||
1,
|
||
15,
|
||
("源cnr_id与包名同为comfyui_essentials;发布者matteo/仓库cubiq分列,不推目标安装"),
|
||
)
|
||
front = ref(
|
||
"litegraph",
|
||
"package/dist/litegraph.es.js",
|
||
3780,
|
||
3834,
|
||
("前端1.23.0锁定litegraph0.15.15位置恢复/序列化;不证明UE组合恢复"),
|
||
)
|
||
string = ref(
|
||
"frontend",
|
||
("src/composables/widgets/useStringWidget.ts"),
|
||
94,
|
||
120,
|
||
"STRING无后端显式默认时前端空串;不把源JSON整数改为字符串",
|
||
)
|
||
ref("frontend", "package.json", 1, 10, "源声明frontend1.23.0与准确tag包版本")
|
||
ref(
|
||
"frontend",
|
||
"package-lock.json",
|
||
950,
|
||
955,
|
||
("精确前端锁文件;完整字节绑定含litegraph0.15.15及integrity"),
|
||
)
|
||
load = ref(
|
||
"vhs",
|
||
"videohelpersuite/load_video_nodes.py",
|
||
423,
|
||
473,
|
||
"上传目录枚举、schema/输出槽/路径验证",
|
||
)
|
||
sampling = ref(
|
||
"vhs",
|
||
"videohelpersuite/load_video_nodes.py",
|
||
24,
|
||
168,
|
||
"格式表、尺寸对齐、重采样/跳帧/抽帧/帧数上限",
|
||
)
|
||
loadrun = ref(
|
||
"vhs",
|
||
"videohelpersuite/load_video_nodes.py",
|
||
293,
|
||
420,
|
||
"内存限制、VAE/格式条件、懒音频裁切及返回",
|
||
)
|
||
audio = ref(
|
||
"vhs", "videohelpersuite/utils.py", 207, 252, "懒音频首次访问时ffmpeg提取;未访问不加载"
|
||
)
|
||
utils = ref("vhs", "videohelpersuite/utils.py", 20, 56, "BIGMAX/DIMMAX与floatOrInt类型")
|
||
combine = ref(
|
||
"vhs", "videohelpersuite/nodes.py", 234, 340, "合成schema、可选输入、输出目录选择"
|
||
)
|
||
formats = ref("vhs", "videohelpersuite/nodes.py", 45, 135, "格式动态枚举/额外控件默认/模板替换")
|
||
combinewrite = ref(
|
||
"vhs", "videohelpersuite/nodes.py", 340, 394, "首帧workflow PNG写入与保存目录条件"
|
||
)
|
||
combineloop = ref("vhs", "videohelpersuite/nodes.py", 441, 494, "pingpong/循环/FFmpeg帧率参数")
|
||
mux = ref(
|
||
"vhs",
|
||
"videohelpersuite/nodes.py",
|
||
558,
|
||
625,
|
||
"可用音频才混流;trim控制apad、shortest、返回历史预览",
|
||
)
|
||
metadata = ref(
|
||
"vhs", "videohelpersuite/nodes.py", 140, 163, "save_metadata条件写临时元数据并交FFmpeg"
|
||
)
|
||
vhsreg = ref(
|
||
"vhs", "videohelpersuite/nodes.py", 1023, 1030, "VHS_LoadVideo和VHS_VideoCombine真实注册"
|
||
)
|
||
vhsinit = ref("vhs", "__init__.py", 1, 9, "包注册入口与WEB_DIRECTORY")
|
||
fmt = ref(
|
||
"vhs", "video_formats/h264-mp4.json", 1, 15, "h264-mp4编码器/像素格式/CRF/元数据/裁切默认"
|
||
)
|
||
restore = ref(
|
||
"vhs", "web/js/VHS.core.js", 41, 168, "按键恢复/回调,序列化全部控件值;不等于实际运行输入"
|
||
)
|
||
loadformat = ref(
|
||
"vhs", "web/js/VHS.core.js", 648, 720, "加载format动态回调、reset条件及控件选项调整"
|
||
)
|
||
ref("vhs", "web/js/VHS.core.js", 721, 824, "上传按钮值/回调与video引用分离,不当服务端参数")
|
||
fmtjs = ref("vhs", "web/js/VHS.core.js", 1222, 1282, "合成格式回调动态重建编码控件")
|
||
previewjs = ref(
|
||
"vhs", "web/js/VHS.core.js", 915, 970, "历史videopreview控件状态;本轮仅纯文本,不请求媒体"
|
||
)
|
||
ref("vhs", "web/js/VHS.core.js", 1870, 1873, "VHS_节点准确useKVState注册钩子;未执行")
|
||
for key in ["rife", "essentials", "impact", "vhs", "frontend", "litegraph"]:
|
||
e = next(e for e in entries if e["id"] == key and "LICENSE" in e["file"])
|
||
ref(
|
||
key,
|
||
e["file"],
|
||
1,
|
||
len((REF / e["local_file"]).read_text().splitlines()),
|
||
"准确原件许可文本;发布包Git绑定未知",
|
||
)
|
||
# Spec rows copied from the same exact VHS1.7.7 release and edited for this source.
|
||
specs = {}
|
||
|
||
def spec(cls, name, label, typ, default, unit, limits, effect, evidence, role="scalar"):
|
||
specs[cls, name] = dict(
|
||
field=name,
|
||
label=label,
|
||
type=typ,
|
||
schema_default=default,
|
||
unit=unit,
|
||
limits=limits,
|
||
effect=effect,
|
||
evidence=evidence,
|
||
role=role,
|
||
)
|
||
|
||
load_specs = [
|
||
(
|
||
"video",
|
||
"输入视频文件引用",
|
||
"COMBO",
|
||
"input目录视频动态枚举,无固定默认",
|
||
"文件名",
|
||
"webm/mp4/mkv/gif/mov;实际目录列表未知",
|
||
("保存WanVideo_SCAIL_00009-audio.mp4,仅引用名;未读文件,-audio不证明有音轨。"),
|
||
),
|
||
(
|
||
"force_rate",
|
||
"强制加载采样帧率",
|
||
"FLOAT/INT(floatOrInt)",
|
||
"0",
|
||
"帧/秒",
|
||
"0~60,step1,0不强制",
|
||
(
|
||
(
|
||
"源缓存JSON int0由149.Int经边327覆盖;其保"
|
||
"存字符串16,准确解析规则为int(Number)。静态预期"
|
||
"采样16fps,但解析/恢复未实际验证。"
|
||
)
|
||
+ ("合成外接155.Float保存字符串60,不能由16×4和60保证时长或音画同步。")
|
||
),
|
||
),
|
||
(
|
||
"custom_width",
|
||
"自定义加载宽度",
|
||
"INT",
|
||
"0",
|
||
"像素",
|
||
"0~8192;0不指定,受格式dim影响",
|
||
("源0;两宽高均0先取素材尺寸,但AnimateDiff按8倍数近似对齐,不保证原尺寸或输出宽度。"),
|
||
),
|
||
(
|
||
"custom_height",
|
||
"自定义加载高度",
|
||
"INT",
|
||
"0",
|
||
"像素",
|
||
"0~8192;0不指定,单边指定则按比例算另一边",
|
||
"源0;与宽度/格式共同计算并按dim对齐;实际素材尺寸未读取。",
|
||
),
|
||
(
|
||
"frame_load_cap",
|
||
"加载帧数上限",
|
||
"INT",
|
||
"0",
|
||
"帧",
|
||
"0~2**53-1,step1;0不设此上限",
|
||
("源0不设控件帧数上限,仍受素材、可用内存及格式约束,不是零帧或保证全片成功。"),
|
||
),
|
||
(
|
||
"skip_first_frames",
|
||
"跳过起始采样帧",
|
||
"INT",
|
||
"0",
|
||
"采样帧",
|
||
"0~2**53-1,step1",
|
||
(
|
||
"源0不跳过;源码按采样后的计数判定,懒音频起点为skip乘t"
|
||
"arget_frame_time,不当原始帧索引。"
|
||
),
|
||
),
|
||
(
|
||
"select_every_nth",
|
||
"间隔抽取采样帧",
|
||
"INT",
|
||
"1",
|
||
"采样间隔",
|
||
"1~2**53-1,step1",
|
||
(
|
||
"源1保留每个采样位置;大于1才间隔取帧,音频裁切时长和loa"
|
||
"ded_fps有对应计算,不反转声音。"
|
||
),
|
||
),
|
||
(
|
||
"format",
|
||
"加载格式约束",
|
||
"COMBO",
|
||
"AnimateDiff",
|
||
"格式名",
|
||
("内置None/AnimateDiff/Mochi/LTXV/Hunyuan/Cosmos/Wan及外部扩展;目标动态列表未知"),
|
||
(
|
||
("保存AnimateDiff,固定内置target_rate8、dim=(8,")
|
||
+ ("0,512,512),无frames约束。Python使用dim,不直接将f")
|
||
+ "orce_rate改8;JS回调有条件reset,不能据此重写保存0/0/"
|
||
"0。"
|
||
),
|
||
),
|
||
]
|
||
for name, label, typ, default, unit, limits, effect in load_specs:
|
||
spec(
|
||
"VHS_LoadVideo",
|
||
name,
|
||
label,
|
||
typ,
|
||
default,
|
||
unit,
|
||
limits,
|
||
effect,
|
||
[load, sampling, loadrun, audio, utils, restore, loadformat, vhsreg, vhsinit],
|
||
)
|
||
combine_specs = [
|
||
(
|
||
"frame_rate",
|
||
"合成播放帧率",
|
||
"FLOAT/INT(floatOrInt)",
|
||
"8",
|
||
"帧/秒",
|
||
"min1,step1,schema无max",
|
||
(
|
||
(
|
||
"源缓存JSON int60由155.Float经边333覆盖"
|
||
";155保存字符串60,按float规则解析后传FFmpeg"
|
||
"画面-r;未运行解析。"
|
||
)
|
||
+ "不证明原片FPS或与直连声音同步。"
|
||
),
|
||
),
|
||
(
|
||
"loop_count",
|
||
"合成画面循环次数",
|
||
"INT",
|
||
"0",
|
||
"次数",
|
||
"0~100,step1",
|
||
"源0,视频分支不追加loop滤镜;不套GIF的循环语义,实际时长未知。",
|
||
),
|
||
(
|
||
"filename_prefix",
|
||
"输出文件名前缀",
|
||
"STRING",
|
||
"AnimateDiff",
|
||
"相对前缀",
|
||
"由folder_paths路径规则及计数决定;实际目录权限未知",
|
||
("源video/ComfyUI,save_output=true时在输出目录下分配名称,非历史E盘路径绑定。"),
|
||
),
|
||
(
|
||
"format",
|
||
"合成编码格式",
|
||
"COMBO",
|
||
"schema首项image/gif;函数缺省image/gif",
|
||
"格式名",
|
||
"image/gif、image/webp和动态video格式列表",
|
||
(
|
||
"源video/h264-mp4采用包内libx264/A"
|
||
"AC mp4规则;动态回调产生pix_fmt/crf等额"
|
||
"外项,不证明目标编码器存在。"
|
||
),
|
||
),
|
||
(
|
||
"pix_fmt",
|
||
"编码像素格式",
|
||
"COMBO",
|
||
"首项yuv420p",
|
||
"编码格式",
|
||
"yuv420p/yuv420p10le",
|
||
("源yuv420p,传给libx264的-pix_fmt,颜色变换按包内bt709滤镜,实际画质未知。"),
|
||
),
|
||
(
|
||
"crf",
|
||
"H264质量控制数值",
|
||
"INT",
|
||
"19",
|
||
"CRF数值",
|
||
"schema 0~100,step1;编码器接受范围/效果仍需环境验证",
|
||
("源19传-crf;通常调节质量/体积,但不把schema上限当目标libx264有效范围或效果承诺。"),
|
||
),
|
||
(
|
||
"save_metadata",
|
||
"保存编码元数据",
|
||
"BOOLEAN",
|
||
"true",
|
||
"布尔",
|
||
"true/false;格式模板与FFmpeg分支条件",
|
||
(
|
||
("源false,格式模板转字符串False关闭此编码metadata分支;不承诺视频完全无元")
|
||
+ ("数据。首帧workflow PNG另受VHS_MetadataImage控制")
|
||
+ ",不能把两个开关混同。"
|
||
),
|
||
),
|
||
(
|
||
"trim_to_audio",
|
||
"合成时按音频裁切开关",
|
||
"BOOLEAN",
|
||
"false",
|
||
"布尔",
|
||
"仅有可取waveform且走视频音频混流分支时生效",
|
||
(
|
||
("源false不是关闭音频;固定实现保留apad=whole_dur(画面时长")
|
||
+ ("+1)并用-shortest。true移除apad。音轨不存在/提取失败可能")
|
||
+ "跳过混流,未验证实际同步。"
|
||
),
|
||
),
|
||
(
|
||
"pingpong",
|
||
"合成往返帧序开关",
|
||
"BOOLEAN",
|
||
"false",
|
||
"布尔",
|
||
"true/false;视频meta_batch旁路条件另有限制",
|
||
"源false不在合成器追加往返帧;本图没有Reverse节点。",
|
||
),
|
||
(
|
||
"save_output",
|
||
"合成保存目录选择",
|
||
"BOOLEAN",
|
||
"true",
|
||
"布尔",
|
||
"true输出目录,false临时目录;均可能写文件",
|
||
(
|
||
("源true选择output目录;会产生视频并可能写首帧workflow PN")
|
||
+ ("G、临时元数据,有音频可另写-audio文件。当前仅GET浏览,没有图执行文")
|
||
+ "件副作用。"
|
||
),
|
||
),
|
||
]
|
||
for name, label, typ, default, unit, limits, effect in combine_specs:
|
||
spec(
|
||
"VHS_VideoCombine",
|
||
name,
|
||
label,
|
||
typ,
|
||
default,
|
||
unit,
|
||
limits,
|
||
effect,
|
||
[combine, formats, fmt, combinewrite, combineloop, mux, metadata, fmtjs, restore],
|
||
)
|
||
for cls in ["VHS_LoadVideo", "VHS_VideoCombine"]:
|
||
spec(
|
||
cls,
|
||
"videopreview",
|
||
"历史视频预览完整对象",
|
||
"前端历史状态",
|
||
"无服务端默认",
|
||
"结构对象",
|
||
"嵌套值和JSON类型原样;不递归计入保存位置",
|
||
(
|
||
("原hidden/paused/params完整保留,仅历史缓存。DOM控件s")
|
||
+ ("erialize=false但包内useKVState仍保存w.value;")
|
||
+ ("合成缓存的E盘fullpath、60fps、workflow PNG和-au")
|
||
+ ("dio文件名不是当前产物/音轨证明;加载缓存同样不是实际参数执行证据。不读盘")
|
||
+ "、不请求api/view或媒体。"
|
||
),
|
||
[previewjs, restore, mux],
|
||
"frontend_history",
|
||
)
|
||
# Array positions below are reference schema associations, never named saved values.
|
||
rife_rows = [
|
||
(
|
||
"ckpt_name",
|
||
"插帧模型文件",
|
||
"rife47.pth",
|
||
"模型名",
|
||
("准确枚举rife40/41/42/43/44/45/46/47/48/49.pth及sudo测试模型"),
|
||
(
|
||
"保存rife49.pth映射架构4.7,不把49当架构4.9"
|
||
"。模型需真实权重,缺文件时helper尝试下载;本轮不执行、"
|
||
"不下载、不证明安装。"
|
||
),
|
||
),
|
||
(
|
||
"clear_cache_after_n_frames",
|
||
"处理多少相邻帧后清缓存",
|
||
"10",
|
||
"相邻帧对计数",
|
||
"INT 1~1000",
|
||
(
|
||
"保存30;循环每处理一对未跳过的相邻帧累加,达到30调用so"
|
||
"ft_empty_cache并归零,最后另清一次;不是输出帧"
|
||
"数/显存保证,本轮未清缓存。"
|
||
),
|
||
),
|
||
(
|
||
"multiplier",
|
||
"插帧倍率缓存",
|
||
"2",
|
||
"倍率",
|
||
"INT min1;schema无max",
|
||
(
|
||
("缓存4由146.Int经边325覆盖,146源JSON int4但STRING ")
|
||
+ ("schema,解析/恢复未测。循环每对补multiplier-1帧再追加末帧;无")
|
||
+ "跳帧时静态(N-1)×M+1,不保证总帧恰为N×4或同步。"
|
||
),
|
||
),
|
||
(
|
||
"fast_mode",
|
||
"快速模式开关",
|
||
"schema true;函数缺省false",
|
||
"布尔",
|
||
"true/false;取决于准确模型架构",
|
||
(
|
||
("保存false;传IFNet fastmode。非fast额外context/u")
|
||
+ ("net残差仅架构4.0/4.2/4.3启用,当前rife49映射4.7不走此额外")
|
||
+ "路径;不能承诺当前false更高画质。"
|
||
),
|
||
),
|
||
(
|
||
"ensemble",
|
||
"双向融合开关",
|
||
"schema true;函数缺省false",
|
||
"布尔",
|
||
"true/false;准确IFNet各架构分支不同",
|
||
(
|
||
"保存true;4.7分支执行交换两帧和反向时间/流的额外推断"
|
||
"与融合,具体算法按准确源码;未实测质量或速度。"
|
||
),
|
||
),
|
||
(
|
||
"scale_factor",
|
||
"RIFE内部流计算缩放",
|
||
"1.0",
|
||
"内部尺度",
|
||
"枚举0.25/0.5/1.0/2.0/4.0",
|
||
(
|
||
"源JSON int1,schema数值枚举含float1.0"
|
||
";生成scale_list=[8/s,4/s,2/s,1/s"
|
||
"]传模型,不是把最终画面放大1倍的输出尺寸设置。"
|
||
),
|
||
),
|
||
]
|
||
for name, label, default, unit, limits, effect in rife_rows:
|
||
spec(
|
||
"RIFE VFI",
|
||
name,
|
||
label,
|
||
"BOOLEAN"
|
||
if name in ["fast_mode", "ensemble"]
|
||
else "INT"
|
||
if name in ["multiplier", "clear_cache_after_n_frames"]
|
||
else "COMBO",
|
||
default,
|
||
unit,
|
||
limits,
|
||
effect,
|
||
[rife, loop, arch, download, front],
|
||
)
|
||
cr_rows = [
|
||
(
|
||
"upscale_model",
|
||
"旁支超分模型",
|
||
"无固定默认;upscale_models目录枚举",
|
||
"文件名",
|
||
"依赖实际目录/模型结构",
|
||
(
|
||
("保存RealESRGAN_x4plus.pth;模型自身scale先用于模型放大")
|
||
+ (",之后按原图尺寸重采样。文件名不证明模型装好或倍率真实;103输出links=[")
|
||
+ "],未接成片链,不保证该旁支会执行。"
|
||
),
|
||
),
|
||
(
|
||
"mode",
|
||
"旁支尺寸模式",
|
||
"schema首项rescale;函数rescale",
|
||
"枚举",
|
||
"rescale/resize",
|
||
(
|
||
("保存rescale按原始宽高乘rescale_factor取整,不按模型输出尺寸")
|
||
+ ("再乘2;resize才用resize_width和rounding_modulu")
|
||
+ "s。输出未接成片链。"
|
||
),
|
||
),
|
||
(
|
||
"rescale_factor",
|
||
"旁支最终缩放倍率缓存",
|
||
"2",
|
||
"倍率",
|
||
"FLOAT 0.01~16.0,step0.01",
|
||
(
|
||
("原浮点2.0000000000000004保持原样,边332由156.Float")
|
||
+ ("覆盖,其保存字符串2按float规则解析;当前rescale按原宽高乘外线倍率取")
|
||
+ "整,未实测。"
|
||
),
|
||
),
|
||
(
|
||
"resize_width",
|
||
"旁支固定宽度缓存",
|
||
"1024",
|
||
"像素",
|
||
"INT 1~48000,step1",
|
||
("保存1024;当前rescale不采用此宽度,resize才按宽度及原比例算高并向上倍数对齐。"),
|
||
),
|
||
(
|
||
"resampling_method",
|
||
"旁支重采样方法",
|
||
"schema首项lanczos;函数lanczos",
|
||
"枚举",
|
||
"lanczos/nearest/bilinear/bicubic",
|
||
("保存lanczos,用于PIL最终重采样和supersample中间处理,不是模型名,不保证画质。"),
|
||
),
|
||
(
|
||
"supersample",
|
||
"旁支中间超采样",
|
||
"schema首项字符串true;函数字符串true",
|
||
"字符串枚举",
|
||
"字符串true/false;不是JSON bool",
|
||
(
|
||
"保存字符串true,准确代码比较supersample =="
|
||
" true字符串时先重采样至目标两轴8倍,再缩到目标尺寸;不"
|
||
"是最终8倍超分,可能额外耗资源但未估算/执行。"
|
||
),
|
||
),
|
||
(
|
||
"rounding_modulus",
|
||
"旁支宽高倍数对齐",
|
||
"8",
|
||
"像素倍数",
|
||
"INT 8~1024,step8",
|
||
(
|
||
"保存8;只在resize分支把宽高向上取倍数,当前resca"
|
||
"le分支不采用;模型分块512/32及OOM减tile是另外"
|
||
"机制。"
|
||
),
|
||
),
|
||
]
|
||
for name, label, default, unit, limits, effect in cr_rows:
|
||
spec(
|
||
"CR Upscale Image",
|
||
name,
|
||
label,
|
||
"FLOAT"
|
||
if name == "rescale_factor"
|
||
else "INT"
|
||
if name in ["resize_width", "rounding_modulus"]
|
||
else "COMBO",
|
||
default,
|
||
unit,
|
||
limits,
|
||
effect,
|
||
[cr, resize, front],
|
||
)
|
||
fields = []
|
||
zero = []
|
||
for i, n in enumerate(graph["nodes"]):
|
||
values = n["widgets_values"]
|
||
if values == []:
|
||
ev = impact if n["id"] == 136 else essentials
|
||
zero.append(
|
||
dict(
|
||
node_id=str(n["id"]),
|
||
class_type=n["type"],
|
||
pointer=f"/nodes/{i}/widgets_values",
|
||
effect="源保存空[],零位置;"
|
||
+ (
|
||
"逐张切片为list后分别接CR旁支与137。"
|
||
if n["id"] == 136
|
||
else (
|
||
"接136原始帧list,按首项宽高对齐并拼批次,送104插帧"
|
||
";不是接103放大结果。"
|
||
)
|
||
),
|
||
evidence=[ev],
|
||
)
|
||
)
|
||
continue
|
||
if n["type"] in ["Int", "Float"]:
|
||
kind = n["type"]
|
||
effect = {
|
||
146: (
|
||
("保存JSON int4而schema输入STRING;int(Number)成功")
|
||
+ ("才输出INT,失败抛Invalid value provided for INT")
|
||
+ ",无回退默认。边325覆盖104.multiplier。"
|
||
),
|
||
149: (
|
||
"保存字符串16;int(Number)成功才输出INT,失败"
|
||
"抛错不回退;边327覆盖123.force_rate缓存0;"
|
||
"不当原视频FPS。"
|
||
),
|
||
155: (
|
||
("保存字符串60;float(Number)成功才输出FLOAT,失败抛Inval")
|
||
+ ("id value provided for FLOAT不回退;边333覆盖124")
|
||
+ ".frame_rate缓存60;不保证音画同步。"
|
||
),
|
||
156: (
|
||
("保存字符串2;float(Number)成功才输出FLOAT,失败抛错无默认回退")
|
||
+ (";边332覆盖103.rescale_factor缓存2.00000000000")
|
||
+ "00004;103输出未接,不保证执行。"
|
||
),
|
||
}[n["id"]]
|
||
spec(
|
||
kind,
|
||
"Number",
|
||
"常量" + ("整数" if kind == "Int" else "浮点") + "文本输入",
|
||
"STRING",
|
||
"后端未声明default;准确前端STRING缺省空串",
|
||
"传给下游后由其定义单位",
|
||
"无schema数值范围;int/float转换失败抛错;不执行表达式",
|
||
effect,
|
||
[literal, string, front],
|
||
)
|
||
keys = (
|
||
list(values)
|
||
if isinstance(values, dict)
|
||
else [r[0] for r in rife_rows]
|
||
if n["type"] == "RIFE VFI"
|
||
else [r[0] for r in cr_rows]
|
||
if n["type"] == "CR Upscale Image"
|
||
else ["Number"]
|
||
)
|
||
assert len(keys) == len(values)
|
||
for j, key in enumerate(keys):
|
||
v = values[key] if isinstance(values, dict) else values[j]
|
||
ptr = f"/nodes/{i}/widgets_values/{key if isinstance(values, dict) else j}"
|
||
inp = next(
|
||
(k for k, x in enumerate(n["inputs"]) if x.get("widget", {}).get("name") == key),
|
||
None,
|
||
)
|
||
link = n["inputs"][inp].get("link") if inp is not None else None
|
||
f = {
|
||
**specs[n["type"], key],
|
||
"node_id": str(n["id"]),
|
||
"scope": "root",
|
||
"class_type": n["type"],
|
||
"pointer": ptr,
|
||
"input_pointer": f"/nodes/{i}/inputs/{inp}" if inp is not None else ptr,
|
||
"value": v,
|
||
"json_type": type(v).__name__,
|
||
"execution_note": "源mode0;"
|
||
+ (f"边{link}覆盖缓存;" if link is not None else "无输入边覆盖此保存项;")
|
||
+ (
|
||
"实际前端1.23.0与UE7.4.1组合恢复/宿主/目标安装"
|
||
"未知,未构造prompt、未执行解析/模型/媒体。"
|
||
),
|
||
}
|
||
if link is not None:
|
||
f["role"] = "linked_cache"
|
||
fields.append(f)
|
||
assert len(fields) == 37 and len(zero) == 2
|
||
overview = (
|
||
("这张图把视频原始画面拆成列表再重组,送RIFE插帧后合成视频,音频直接从加载器进")
|
||
+ ("入合成。RealESRGAN放大旁支的输出没有接入成片链,不能称已将模型放大结果")
|
||
+ ("插帧成片,也不保证未接旁支会执行。输入采样与输出帧率分别外接16和60的保存文本")
|
||
+ ",实际解析、时长、音轨和同步未知;只供参考,转换与生成保持关闭。"
|
||
)
|
||
flow = [
|
||
overview,
|
||
(
|
||
"10节点/10物理边,全mode0,无子图/Note;37顶"
|
||
"层保存位置=35标量含字符串+2完整videopreview"
|
||
"对象,136/137空[]各零位置。"
|
||
),
|
||
(
|
||
("画面链123.LoadVideo槽0→136.BatchToList;136分别")
|
||
+ ("→103.CR Upscale及137.ImageListToBatch+;13")
|
||
+ ("7→104.RIFE→124.Combine。103.IMAGE links=[")
|
||
+ "]、show_help亦未接;不补线,不保证依赖遍历会执行旁支。"
|
||
),
|
||
(
|
||
("136准确OUTPUT_IS_LIST=True,每次image[i:i+1]保")
|
||
+ ("留单张批次维;137准确INPUT_IS_LIST=True按首张尺寸对不一致项")
|
||
+ ("bicubic/center后cat。传给RIFE的是原始帧重组,不是103输出")
|
||
+ ("。源cnr_id comfyui_essentials与发布包名一致,Regis")
|
||
+ ("try下载所有者matteo,包内Repository是cubiq/ComfyU")
|
||
+ "I_essentials;来源层次分列,不证明目标安装。"
|
||
),
|
||
(
|
||
("四常量:146保存JSON int4而STRING schema,149保存字符")
|
||
+ ("串16;155保存字符串60、156保存字符串2。准确Int/Float仅int")
|
||
+ ("(Number)/float(Number),失败抛错无默认回退。STRING准")
|
||
+ "确前端默认空串;不运行转换或表达式,不将源类型归一化。"
|
||
),
|
||
(
|
||
("边325:146→104.multiplier覆盖缓存4;327:149→123")
|
||
+ (".force_rate覆盖0;332:156→103.rescale_facto")
|
||
+ ("r覆盖2.0000000000000004;333:155→124.frame_")
|
||
+ ("rate覆盖60。四组缓存与外线均保留,连线类型INT到floatOrInt/F")
|
||
+ "LOAT入口不等于实际恢复/执行已验证。"
|
||
),
|
||
(
|
||
("RIFE保存rife49.pth/30/4/false/true/JSON in")
|
||
+ ("t1;rife49映射架构4.7。optional_interpolation_")
|
||
+ ("states未接,无状态跳帧时静态循环(N-1)×multiplier+1,不能")
|
||
+ ("由16×4与60保证时长相同或同步。fast=false在4.7不启用仅4.0/")
|
||
+ ("4.2/4.3的context/unet额外路径;ensemble=true走4")
|
||
+ ".7反向融合。scale_factor仅内部流尺度;未推理/清缓存/下载。"
|
||
),
|
||
(
|
||
("CR七值保留RealESRGAN_x4plus.pth/rescale/2.00")
|
||
+ ("00000000000004/1024/lanczos/字符串true/8。先模")
|
||
+ ("型放大,再基于原尺寸乘rescale倍率取整;当前不采用resize_width")
|
||
+ ("及rounding_modulus。字符串true先做目标两轴8倍中间重采样再缩")
|
||
+ ("回,非JSON bool/最终8倍。模型倍率/目标尺寸/真实效果分开;输出未接成")
|
||
+ "片链。"
|
||
),
|
||
(
|
||
("123保存cap0/skip0/nth1、宽高0/0、AnimateDiff、源")
|
||
+ ("文件名;force_rate缓存0由149覆盖。AnimateDiff dim按")
|
||
+ ("8倍数近似对齐,内置target_rate8不等于Python强制改为8。图无上")
|
||
+ ("传按钮保存项,不制造。123.frame_count未接、video_info ")
|
||
+ "links=[];meta_batch/vae未接。"
|
||
),
|
||
(
|
||
("音频边319从123槽2直连124.audio,不经RIFE/CR;懒音轨访问时")
|
||
+ ("才提取,素材名-audio不证明音轨存在。实际源FPS、声音长度、画面帧数及同步")
|
||
+ "未知,不读取素材或探测。"
|
||
),
|
||
(
|
||
("124保存H264/yuv420p/crf19、save_metadata=fa")
|
||
+ ("lse/trim=false/pingpong=false/save_outpu")
|
||
+ ("t=true;正式output目录MP4,libx264与AAC需目标支持。VH")
|
||
+ ("S_MetadataImage=true控制首帧workflow PNG,独立于")
|
||
+ ("编码元数据false;音轨可取才另混-audio.mp4,trimfalse保留")
|
||
+ ("apad并-shortest,不能保证同步。VHS_KeepIntermedia")
|
||
+ ("te=true保留中间文件。静态返回ui.gifs及result((save_o")
|
||
+ ("utput,output_files),);输出VHS_FILENAMES未连下")
|
||
+ "游。"
|
||
),
|
||
(
|
||
("两个videopreview完整历史对象各一位置,不拆嵌套计数;input视频名")
|
||
+ ("与output E盘路径、ComfUI_00004-audio.mp4、work")
|
||
+ ("flow PNG和缓存60皆非本次产物,不请求URL/媒体。VHS准确JS us")
|
||
+ ("eKVState恢复/序列化按键及动态格式控件,LiteGraph按位置;UE7")
|
||
+ (".4.1及空ue_links/links_added_by_ue不证明没有覆盖,")
|
||
+ "组合恢复未知,不重开UE调查。"
|
||
),
|
||
(
|
||
("身份分层:节点VHS1.7.7准确发布包与图extra的f24f4e10f448")
|
||
+ ("913eb8c0d8ce5ff6190a8be84454分别记录;RIFE节点1")
|
||
+ (".0.7与图级c336f7184cb1ac1243381e725fea1ad2c")
|
||
+ ("0a10c09冲突分列,不能当同一安装事实。frontend1.23.0准确ta")
|
||
+ ("g及锁定LiteGraph0.15.15;ComfyLiterals与CR完整提")
|
||
+ ("交准确绑定。Impact8.25.1/Essentials1.1.0发布包Git")
|
||
+ "绑定未知。"
|
||
),
|
||
(
|
||
("图级core0.3.12/fastblend6677d656f030d34568")
|
||
+ ("4e3c2680b0cddb2680c307在本图无对应节点,只保留历史元数据,")
|
||
+ ("不编造依赖。CR及ComfyLiterals准确提交树未发现LICENSE/CO")
|
||
+ ("PYING;固定README/源码头信息,许可文本缺失仍未知,不借最新版。真实宿")
|
||
+ "主扩展、依赖、模型、素材、设备/资源耗时和效果均未知。"
|
||
),
|
||
(
|
||
("旧34块1069位置+25注释逐对象冻结;新增37位置/0注释,现35图1106")
|
||
+ ("+25仅参考。155停用未检查、完整定稿0/必要实跑0/新增转换0;16/139")
|
||
+ ("、1217/3660/294及145UI9参考候选136关闭保持,case06排")
|
||
+ "除。"
|
||
),
|
||
*["原边 root " + json.dumps(e, ensure_ascii=False) for e in graph["links"]],
|
||
]
|
||
versions = [
|
||
e["id"] + "→" + e["commit"] for e in json.loads((REF / "identities.json").read_bytes())
|
||
]
|
||
for key in ["vhs", "rife", "impact", "essentials", "litegraph"]:
|
||
e = next(e for e in entries if e["id"] == key)
|
||
versions.append(key + "→" + e["commit"] + ";包到Git绑定未知")
|
||
return dict(
|
||
source_path=PATHS[index],
|
||
source_sha1=hashlib.sha1(raw).hexdigest(),
|
||
source_sha256=hashlib.sha256(raw).hexdigest(),
|
||
canonical_sha256=hashlib.sha256(canonical(graph)).hexdigest(),
|
||
notice=(
|
||
"仅固定来源参考;原帧插帧链与未接放大旁支分开,实际恢复/环境"
|
||
"/时长/音画同步及效果未知,转换关闭、未实跑。"
|
||
),
|
||
user_overview=overview,
|
||
versions=versions,
|
||
counts=dict(
|
||
saved_fields=37,
|
||
source_nodes=10,
|
||
physical_edges=10,
|
||
source_notes=0,
|
||
history_objects=2,
|
||
linked_saved_fields=4,
|
||
frontend_only=2,
|
||
final_scalars=0,
|
||
final_prompt_constructed=False,
|
||
),
|
||
fields=fields,
|
||
sources=refs,
|
||
comments=[],
|
||
flow=flow,
|
||
flow_evidence=list(range(len(refs))),
|
||
zero_saved_nodes=zero,
|
||
boundaries=[],
|
||
steps=[
|
||
overview,
|
||
("操作1:只读核对原帧插帧链和103未接出口,保留停用,不上传/处理素材,不补线。"),
|
||
(
|
||
"操作2:核准准确节点/前端与UE组合、四常量类型及外线覆盖,"
|
||
"再核素材/模型/编码依赖;未获真实验证不放行。"
|
||
),
|
||
("操作3:全量完成并审核前仅读参考说明;不构造prompt、不运行解析/上游插件/模型/媒体。"),
|
||
],
|
||
)
|