Nodes/MiniMax H3 Extender/MiniMax H3 Save AV Latent
ComfyUI Node

MiniMax H3 Save AV Latent

Save the latent, or a partial rewrite of the clip is impossible

By pmhaidn·Created 20 days ago·Updated 19 days ago· 8
MiniMax H3 Save AV Latent
  • latent
  • latent
  • latent_path
◄filename_prefixh3_context/clip►
◄clip_index0►

Here's the workflow shape that makes this whole pack useful: you generate a clip, spot one flaw in it, and want to re-roll just that part. Partial Denoise Mask needs the original latent as its latent_image - the thing it pins and resamples against. And here's the problem: a plain single-shot R2V/I2V/T2V graph in ComfyUI throws the latent away the moment it decodes to video. Only the Contex Loop chain keeps per-clip latents, inside its checkpoints. MiniMaxH3SaveLatent is the fix for everyone else: stick it next to SaveVideo and the latent survives on disk, ready for the day you need to reopen and edit the clip.

How it works

Core SaveLatent writes samples["samples"] as a single tensor - which is fine for image latents and useless for H3's NestedTensor holding two. This node flattens the pair on the way out and records in a small JSON sidecar how many tensors there were and what shapes they had, so Load Latent can rebuild the nesting on the way in. Plain .safetensors files, nothing proprietary.

The inputs

  • samples - the H3 latent to save.
  • filename_prefix - defaults to h3_latents/clip. Files land in ComfyUI's output directory with the usual numbered suffix, so you get h3_latents/clip_00001_.safetensors and so on.
  • dtype - bf16 (default), fp16, or fp32. bf16 halves the file and is what the model runs in anyway; the tooltip's advice is direct: pick fp32 only if you want the sampler output back bit-for-bit. For reference, a 4.5-second 1.5 MP clip is roughly 430 MB in bf16 - fp32 doubles that for a precision you'll never see.

The original dtype is recorded in the metadata and restored on load, so downstream nodes see what they expect regardless of what you saved as.

Where to put it

Next to your SaveVideo node, at the end of a run you care about. It's an output node, so it prints the path and file size to the console when it runs - a nice confirmation that something ~430 MB actually landed. The use case is archival, not casual: this is the file that makes "fix the glyph in the logo, keep the camera drift" possible tomorrow instead of regenerating the whole commercial.

Honest note on the alternative: if you didn't save the latent, the pack's Pack Latent can rebuild one from the mp4 via a VAE round trip - but that costs one generation of VAE loss across the whole clip, so untouched regions degrade slightly too. Save Latent is the lossless route and Pack Latent is the salvage route. Prefer this one.

Install

Part of the ten-node pack:

cd ComfyUI/custom_nodes
git clone https://github.com/panghea/ComfyUI-MiniMax-H3-Inpaint-Tools
cd ComfyUI-MiniMax-H3-Inpaint-Tools && pip install -r requirements.txt

Or ComfyUI Manager, search MiniMax H3 Inpaint Tools, restart, and it's under MiniMax H3/latent. The matching reader on the other side is MiniMax H3 Load Latent, which also understands the Contex Loop chain's checkpoint format if that's where your latent already lives.

Categoryconditioning/minimax

Inputs (3)

NameTypeDefaultDescription
latentLATENTThe sampler's output latent (the same one you wire into the decode nodes).
filename_prefixSTRINGh3_context/clipSaved under the ComfyUI output folder. The default keeps all chain latents in one folder so the Load node can always pick the newest.
clip_indexINT00–9999Which clip of the chain THIS is. Saves to that clip's fixed slot, so a re-roll overwrites its own reject instead of stacking new files. Generating clip 2: set 2 here and 1 on the Load node. 0 = old behaviour, a new numbered file every run (numbers count runs, not clips).

Outputs (2)

NameTypeDescription
latentLATENTPassthrough of the input latent so you can wire this node directly in-line.
latent_pathSTRINGAbsolute path of the saved H3 AV safetensors checkpoint.