IO_SaveLatent
Save an H3 video latent to disk so you can reload it later — or hand it to another workflow
- latent
- latent_path
IO_SaveLatent is the writer half of this pack's latent checkpoint pair: it takes an H3 video/audio latent and writes it to disk as a .safetensors file that IO_loadLatent can read back. If you've ever wanted to pause a long video generation, close ComfyUI, and pick up later with the exact same motion and audio context - this is the node that makes that possible. It's ComfyUI's answer to "save my place," but for latent space instead of pixels.
It's an output node, so it always runs, and the main thing to know is what it writes and where: H3 AV latents are joint structures - a nested video tensor plus an audio tensor in one object - and this saves both into a single file with a h3_motion_context_av_v1 metadata tag that marks it as loadable by the pack's reader.
Inputs
latent(LATENT) - the H3 AV latent to save. Comes from a sampler or from anAD_*node's context output.filename_prefix(STRING, default "h3_context/clip") - the name and folder, relative to the ComfyUI output folder. The default puts files underoutput/h3_context/.clip_index(INT, default 0) - the clip slot. 0 means "new numbered file every run" - good for versioning, bad if you keep re-running and want one canonical file. Set it to a specific number (1, 2, …) to overwrite the same fixed slot each run, which is what you want when you're iterating on one clip and don't want the folder filling up.
Output: latent_path (STRING) - the full path where the file was written, which you can feed straight into IO_loadLatent or display.
The clip_index workflow, in plain terms
The tooltip says it exactly: "Fixed clip slot to overwrite. 0 creates a new numbered file on every run." So the practical rhythm is - use 0 while you're experimenting and want history; switch to a fixed slot when you've settled on a clip and just want it overwritten in place. Since IO_loadLatent with clip_index 0 grabs the newest file in the folder, keeping both ends at 0 "just works" for quick resume; pinning both ends to a slot gives you deterministic, reproducible loads.
Where people get burned
Forgetting that relative paths resolve against the output folder, not the ComfyUI root - point IO_loadLatent at the path string this node returns and you can't go wrong. And it only writes H3 joint latents; if you feed it a plain single-stream latent from another pack, expect a complaint rather than a mysterious file. Otherwise it's one of the least surprising nodes in the suite: write, restart, reload, continue.
Installing it
From cardenluo/ComfyUI-Apt_Preset:
cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset
pip install -r requirements.txt # or install.bat on Windows
Restart ComfyUI; it appears under Apt_Preset/IO_Port. No model downloads required.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | — | |
| filename_prefix | STRING | h3_context/clip | — |
| clip_index | INT | 00–9999 | Fixed clip slot to overwrite. 0 creates a new numbered file on every run. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent_path | STRING | — |