Nodes/ComfyUI-SwissArmyKnife/Update Video Metadata
ComfyUI Node

Update Video Metadata

Put your LoRAs and your name on generated videos — without re-encoding

By sammykumar·Created 12 months ago·Updated 8 months ago· 6
Update Video Metadata
  • filenames
  • Filenames
comment
lora_json
overwrite_originalNo

Here's a small injustice of the ecosystem: your PNG outputs carry the whole workflow embedded in their metadata, and nobody thinks twice about it - drag the image back into ComfyUI and the graph rebuilds itself. Your videos get nothing. An MP4 rolling off VHS_VideoCombine is a naked file with zero provenance, so when you post it, the "what did you use" question has no answer baked in. This node, "Update Video Metadata" from ComfyUI-SwissArmyKnife, is the fix: it stamps artist, comments, and LoRA info onto your finished video with ffmpeg -c copy, which means no re-encode and no quality loss.

It's a small utility, but it slots into a real gap. If you batch out videos for a portfolio, an archive, or sharing with collaborators, having the LoRAs recorded in the file itself is the difference between "I think that was the dark-sketch one" and knowing exactly.

How it works

You feed it the filename list straight from VHS_VideoCombine. The node runs ffprobe to read whatever metadata already exists, then builds an ffmpeg command that appends new fields instead of clobbering them - artist and comments get combined with what's already there, so you don't lose earlier tagging. The streams are copied, not re-encoded, so it's fast and lossless. If you choose to overwrite, it writes to a temp file first and swaps it in, so a crash mid-run leaves the original intact; otherwise it produces a new _metadata-suffixed file.

The interesting input is lora_json. Its sibling in the same pack, the "LoRA Info Extractor" node, emits a JSON string describing your active LoRAs, and this node parses it into proper tags: combined_display becomes the video title, each LoRA's info becomes a bullet in the description, the names become keywords prefixed with LoRA:, and the raw JSON rides along as a custom lora_json tag for power users. If the JSON won't parse, it degrades gracefully to a plain lora= string. Worth noting: the docs talk about an artist field, but the exposed inputs are the ones below - the LoRA path is how artist-style attribution actually gets in.

Inputs and output

  • filenames (required, VHS_FILENAMES) - wire this to the Filenames output of VHS_VideoCombine.
  • comment (optional, multiline) - free-form notes; appended to any existing comment tag.
  • lora_json (optional) - JSON from the LoRA Info Extractor sibling node.
  • overwrite_original (Yes/No, default No) - rewrite the source file or emit a new _metadata copy.

The single output, Filenames (VHS_FILENAMES), hands the updated path back so you can keep chaining into a save or upload node.

Installing it

It ships with ComfyUI-SwissArmyKnife, so install the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/sammykumar/ComfyUI-SwissArmyKnife.git
pip install -r ComfyUI-SwissArmyKnife/requirements.txt

or find "ComfyUI-SwissArmyKnife" in ComfyUI Manager. Two things to know: FFmpeg is a system dependency, not a pip one - if it's not on your PATH the node fails, so install it (sudo apt install ffmpeg or your platform's equivalent) and confirm with ffmpeg -version.

Where people get burned

The batch gotcha: this node processes the first file in the list only. If your VHS_VideoCombine emitted several videos, the rest stay untagged - either run the pack once per file or accept the limitation. And the error handling is blunt: a missing file or a broken ffmpeg install surfaces as a generic "Video metadata operation failed" message, so when it dies mysteriously, check ffmpeg first. If you're storing videos long-term, overwrite_original: No is the safer default - you keep the untouched master and get a tagged copy.

CategorySwiss Army Knife 🔪/Utils

Inputs (4)

NameTypeDefaultDescription
filenamesVHS_FILENAMESVideo filenames from VHS_VideoCombine (VHS_FILENAMES type)
commentoptSTRINGAdditional comments metadata
lora_jsonoptSTRINGLoRA JSON data from LoRAInfoExtractor (contains structured LoRA metadata)
overwrite_originaloptCOMBONoWhether to overwrite the original file or create a new one with '_metadata' suffix

Outputs (1)

NameTypeDescription
FilenamesVHS_FILENAMES