Nodes/comfyui-darkil-nodes/Erase Metadata [darkilNodes]
ComfyUI Node

Erase Metadata [darkilNodes]

Erase Metadata can't clean the thing you think it can — read this before wiring it up

By pytraveler·Created 8 months ago·Updated a day ago· 9
Erase Metadata [darkilNodes]
  • value
  • value

Here's the thing nobody tells you before they recommend a metadata scrubber for ComfyUI: ComfyUI doesn't carry the workflow along the wires between nodes. An IMAGE, a MASK, a LATENT - those are plain tensors with nowhere to keep a workflow. The workflow gets stamped into the file at save time, by the save node, out of hidden inputs the engine hands it straight from the request. No node sitting upstream can prevent that, because it never had the metadata in its hands in the first place.

So Erase Metadata in front of a Save Image will happily pass your image through and then tell you in the console there was nothing to remove. Because there wasn't. That's not a bug - that's the architecture. If that's the outcome you actually wanted, the cheap fix is to launch ComfyUI with --disable-metadata (one flag kills the workflow chunks for every save node at once), or swap the save node for this pack's Save Image (no metadata).

What it actually does work on

Erase Metadata takes one value input of any type and hands back the same thing on value, cleaned wherever that was possible. Its real targets are:

  • VIDEO. A video object is a wrapper around a real file - tags and all. Worse, saving a video copies the source container's tags into the new file, so a video that's been through ComfyUI once drags its old workflow along every time it's saved again. The node hands back a copy with the container and stream tags gone, and leaves the file it was given alone.
  • File names. Any string that names an existing media file - and lists or tuples of them, recursed up to depth 4 - gets cleaned where it lies; the path comes back unchanged. This is the case that actually covers still images and audio, because the only moment their metadata exists is after the file's been written. Packs that hand you output paths (VideoHelperSuite is the classic) plug straight into this.
  • Raw bytes. An encoded file passed around in memory gets stripped too.

How the stripping works, format by format

The author put real work in here. PNG is taken apart chunk by chunk - tEXt, zTXt, iTXt, eXIf, tIME and anything parked after IEND are dropped, with the pixels copied through byte for byte. JPEG loses EXIF, XMP, IPTC and comments, but deliberately keeps JFIF, the ICC profile and the Adobe marker, because dropping those changes the colors. WEBP (still and animated) loses EXIF and XMP with the VP8X flags corrected, and GIF loses comment and application blocks while keeping the loop count so animations still loop.

MP4, MOV, MKV, WEBM, AVI, FLV, TS, MP3, FLAC, WAV, OGG, OPUS, M4A and AAC go through a stream copy - lossless, but the file gets rebuilt. EXR, TIFF and anything on no list is left alone, and a file it can't parse is left alone rather than guessed at. Files are rewritten to a temp copy and moved into place, so an interrupted run can't leave you with half a file, and a second pass is a no-op.

Two gotchas worth knowing. First, the container formats quietly depend on PyAV (av), which this pack does not declare in its requirements - if it's not in your environment, a video or MP3 just passes through with a console warning, no stripping. Second, put this node in front of a plain Save Image and you'll get the "nothing to remove" log line, because that's genuinely all there is for it to do.

Installing it

This is one node out of the comfyui-darkil-nodes pack by pytraveler (also published as "darkil"), a one-person collection of ComfyUI utility nodes. It has no Python dependencies at all - requirements.txt is empty - and downloads no models. Install once, get all its nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/pytraveler/comfyui-darkil-nodes.git

Then restart ComfyUI. Via Manager it's the same thing: search comfyui-darkil-nodes (or just "darkil") and hit install. After a restart the node shows up under darkilNodes/files. There's no per-node uninstall - if you only want this one, you're taking the whole pack, and it's a big one (text, logic, WAN, MiniMax, image loaders), so weigh that before you clone it for a single scrubber.

The metadata reality-check above isn't a weakness of the node - it's the wall every metadata tool in ComfyUI runs into, and this one documents it honestly instead of pretending.

CategorydarkilNodes/files

Inputs (1)

NameTypeDefaultDescription
value*

Outputs (1)

NameTypeDescription
value*