From 946e1702ed47a53532a1a03edbccb9af0e0cc232 Mon Sep 17 00:00:00 2001 From: malkuthro <166633396+malkuthro@users.noreply.github.com> Date: Sat, 16 May 2026 22:57:34 +0200 Subject: [PATCH] feat(video): suppress metadata PNG + silent intermediate by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream VHS writes 3 files per render when audio is connected: - _NNNNN.png (first-frame sidecar with workflow metadata) - _NNNNN.mov (silent intermediate) - _NNNNN-audio.mov (final audio-muxed video) Both extras are controlled by hidden VHS_MetadataImage and VHS_KeepIntermediate flags in extra_pnginfo['workflow']['extra'], both default-on upstream. Result: a single 500MB render lands as three files (one needed, two clutter), nearly 2x the disk footprint and a confusing folder. Adds two optional BOOLEAN inputs (both default False on Koolook): - save_metadata_png - keep_silent_intermediate combine_video injects them into extra_pnginfo before delegating to super(), so the existing upstream flags do the actual work — no post-hoc file deletion, no fork divergence from upstream's encoder path. The extra_pnginfo dict is copied (not mutated in place) so other nodes in the workflow that reference the same dict are unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) --- k_video_combine.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/k_video_combine.py b/k_video_combine.py index fb3b519..d360dbe 100644 --- a/k_video_combine.py +++ b/k_video_combine.py @@ -228,6 +228,20 @@ if _VHS_AVAILABLE: "tooltip": "Auto-create the output directory if missing.", }, ) + types["optional"]["save_metadata_png"] = ( + "BOOLEAN", + { + "default": False, + "tooltip": "Save the first-frame PNG with embedded workflow metadata.", + }, + ) + types["optional"]["keep_silent_intermediate"] = ( + "BOOLEAN", + { + "default": False, + "tooltip": "Keep the audio-less intermediate video when audio is muxed in.", + }, + ) return types def combine_video(self, *args, **kwargs): @@ -243,6 +257,23 @@ if _VHS_AVAILABLE: kwargs.pop("output_directory", "") ) create_path_if_missing = kwargs.pop("create_path_if_missing", False) + save_metadata_png = kwargs.pop("save_metadata_png", False) + keep_silent_intermediate = kwargs.pop("keep_silent_intermediate", False) + + # Inject VHS's hidden extra_options flags so upstream skips + # the metadata PNG and deletes the silent intermediate after + # audio mux. Defaults are False on Koolook (one clean file + # per render); flip the toggles to re-enable upstream's + # default-on behavior. Copy extra_pnginfo before mutating so + # other nodes referencing the same dict aren't affected. + extra_pnginfo = dict(kwargs.get("extra_pnginfo") or {}) + workflow = dict(extra_pnginfo.get("workflow") or {}) + extra = dict(workflow.get("extra") or {}) + extra["VHS_MetadataImage"] = bool(save_metadata_png) + extra["VHS_KeepIntermediate"] = bool(keep_silent_intermediate) + workflow["extra"] = extra + extra_pnginfo["workflow"] = workflow + kwargs["extra_pnginfo"] = extra_pnginfo # Split-mode: directory + name combined into one effective # prefix that the existing isabs discrimination handles