Nodes/ComfyUI-H3-Project-Suite/H3 Context Save Latent
ComfyUI Node

H3 Context Save Latent

How the next H3 clip gets its head start

By Adudeguyman·Created about a month ago·Updated a day ago· 31
H3 Context Save Latent
  • latent
  • latent_path
filename_prefixh3_context/clip
clip_index0

H3 Context Save Latent answers a question you might not have thought to ask: how does the next clip know what the last clip sounded like? The answer is a file on disk, and this node is the one that writes it.

The problem it solves is architectural. H3 Context's latent path slices the pinned video and audio straight from the previous clip's latent - but you can't wire the sampler's output straight into context_latent, because that would be a cycle: the sampler consuming its own result. The latent that motion context needs belongs to the previous run, so it has to cross runs through disk, exactly like the frames and audio already do. And stock ComfyUI Save Latent can't serialize H3's nested video/audio pair - that's why this node exists.

How it works

H3 Context Save Latent takes the sampler's output latent and writes the video and audio streams side by side into a .safetensors file under your ComfyUI output folder. Next run, the matching Load node reads it back and hands it to H3 Context's context_latent input, where the audio is sliced out and pinned alongside the video. That's the whole loop: save at the end of run N, load at the start of run N+1.

Because it's an output node it always runs, and it returns the latent_path it wrote - which you can feed straight into the Load node's latent_path if you like explicit wiring instead of folder-based resolution.

The inputs

  • latent - the sampler's output latent, the same one you wire into the decode nodes. Don't grab a random latent; it needs to be the H3 AV latent with both streams, or save refuses.
  • filename_prefix (default h3_context/clip) - saved under the ComfyUI output folder. The default keeps all chain latents in one folder so the Load node can always pick the newest. Leave it.
  • clip_index - which clip of the chain this is. Generating clip 2: set 2 here and 1 on the Load node. The magic is that it saves to that clip's fixed slot, so a re-roll overwrites its own reject instead of stacking new files - rejects never accumulate, and never get loaded later. At 0 you get the old behavior: a new numbered file every run, where the numbers count runs, not clips.

Install and gotchas

Same shared install as the whole suite: ComfyUI Manager → search "H3 Project Suite", or cd ComfyUI/custom_nodes && git clone https://github.com/Adudeguyman/ComfyUI-H3-Project-Suite, restart, hard-refresh. Saving uses safetensors, which is part of any ComfyUI that's been alive for more than five minutes.

The one genuinely confusing thing is the pairing with the Load node, and it's worth repeating because it trips everyone once: the Save node gets the number of the clip you're making, the Load node gets the number of the clip you're continuing from. Clip 2 continuing clip 1 means Save 2, Load 1. Accept, then bump both numbers. Screw it up and the chain just continues from the wrong clip - no crash, no error, just a join that makes no sense.

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 (1)

NameTypeDescription
latent_pathSTRING