H3 Motion Context Clip Purge /noEmbryo
Purge those clip archives before they eat your SSD
- report
You'll meet this node the day you finally finish a long chained MiniMax H3 video and realize it left an awful lot of files behind. If you've never touched H3 Motion Context chaining, this node is meaningless to you - skip it. If you have, it's the broom you've been missing.
Here's the situation it exists for. H3 Motion Context (NikoDemon80's ComfyUI-H3-Motion-Context) lets you chain clips of MiniMax H3 so motion and audio keep going across cuts. Each approved clip is written to disk as a numbered h3_motion_context_av_v1 archive - clip_00001.safetensors, clip_00002.safetensors - holding the full paired video+audio latent so the next clip can start from the exact same numbers instead of a lossy decode round-trip. That's great for seams and terrible for your disk. A long chain stacks up a lot of these, and the archives live in the open long after you've stitched the final cut. The sibling node in this same pack, H3 Motion Context Clip Stitcher, turns the approved clips into one IMAGE + AUDIO pair; this node deletes them once you're done.
What it actually does
Purge is deliberately dumb and deliberately safe. It scans only the root level of the folder you give it, matches filenames against a glob, and removes the hits. Sub-folders and everything inside them are never touched - no recursion, no symlink chasing. Each deletion (or near-miss) is reported with the file's size, and the run ends with a human-readable total of bytes freed, formatted in KiB/MiB/GiB.
The three inputs that matter
- mode - a boolean, default on ("Purge"). This is the one to watch. Set it off and the node becomes a dry run: it lists exactly what would be deleted and deletes nothing, which is how you're supposed to meet it the first time.
- folder - default
h3_context. Absolute paths work, or paths relative to ComfyUI'soutputfolder, which is where your H3 workflow already writes. - pattern - default
clip_*.safetensors. Only root-level files whose names match get touched. Keep it narrow.
The single output is report, a STRING that shows the node's actions. It's an output node and always executes (IS_CHANGED is NaN), so a purge never gets silently skipped as "unchanged" - which is exactly what you want from something with side effects.
Install
It ships in the noEmbryo pack, so installing the pack installs it. Through ComfyUI Manager, search for "noEmbryo" and hit install. Or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/noembryo/ComfyUI-noEmbryo.git
Then restart ComfyUI. No model downloads, no extra pip deps - the purge node itself is pure Python standard library. (The stitcher sibling wants safetensors and torchaudio around, but ComfyUI's bundled environment usually has both.) You'll find it under Add node > noEmbryo.
Where people get burned
- Deletion is permanent.
os.removemeans no recycle bin, no undo. The mode toggle defaults to Purge, so the very first thing you do with this node should be flipping it to Preview and running once to see the report. One look at the list and you'll know if you're pointed at the right folder. - It doesn't recurse. Root level only, by design. But if your H3 Save Latent writes into a subfolder (the pack's own example workflows use
h3_context/clip), pointing purge at the parent does nothing. Give it the folder that actually holds the files. - Point it at a folder that doesn't exist and it errors out rather than silently doing nothing. That's a feature - and the error message says "H3 Motion Context Clip Stitcher: folder not found" even when purge raised it, a copy-paste leftover in the source. Don't let the name throw you; it's just telling you the path is wrong.
- The default glob catches more than numbered clips. H3's auto-saved files get a trailing underscore (
clip_00002_.safetensors) so indexed loading skips them - butclip_*.safetensorsstill matches those. If you've been relying on auto-saves to keep rejected takes around, the dry run will show them on the chopping block before you commit.
It's a one-trick node, and that's fine. Chain a few H3 clips, stitch them, then run purge in preview, confirm, and get your disk back.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | BOOLEAN | true | Purge (Enabled): delete the matching files. Preview (dry run, Disabled): delete nothing; the report just lists the files that would be deleted. |
| folder | STRING | h3_context | Folder whose root-level clip archives will be deleted. Absolute paths and paths relative to ComfyUI/output are accepted. |
| pattern | STRING | clip_*.safetensors | Filename glob. Only root-level FILES matching this pattern are deleted. Sub-folders are never touched. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| report | STRING | — |