H3 Disk Decode
Decode the clip to disk before your VRAM finds out
- latent
- vae
- audio_vae
- video_path
- video
The stock way to get pixels out of an H3 latent is VAE Decode into a batch of IMAGE tensors, then a video node. That's fine at 768p and a couple of hundred frames. It stops being fine the moment you upscale. A 4x H3 clip decoded the normal way wants the whole run of frames resident at once, and the failure mode isn't a warning - it's a slow crawl into an OOM after ten minutes of decoding.
H3 Disk Decode does the obvious, boring, correct thing instead: it decodes the latent a chunk at a time, writes PNG frames into a folder as it goes, and then encodes an MP4 from those frames. Peak RAM stays roughly flat no matter how long the clip is.
Why you'd reach for it rather than the normal path
Two reasons, and the second one is the useful one.
The first is size: if you've upscaled a chain and you want actual files out of it, the frames never all exist in memory here.
The second is that it's restartable. A stopped decode resumes where it left off when you queue it again with the same output_name. On a big clip that's the difference between "my 4x render died at frame 900 and I lost the lot" and "click run again". It manages this with a manifest.json in the clip's folder, recording which latent it was decoding, the size, the frame rate and the trim. Same name with a different latent underneath stops with an error rather than quietly mixing two clips into one folder. That's the right behaviour, and it's worth knowing because it means a re-render at a different resolution needs a new output_name.
How it works
It writes frames to output/h3_disk_decode/<output_name>/frames, then <output_name>.mp4 beside them, at 24 fps. Decoding goes through the H3 video VAE you hand it - the standard one decodes in tiles, which is why memory stays bounded. Sol-H3-VAE works too, but it holds the whole clip in VRAM at once, which rather defeats the point.
trim_frames is the input that makes this play nice with chaining: it cuts frames off the front, picture and sound together. For a chained clip, wire it from H3 Motion Context's trim_frames output and the carried head comes off both streams in the same operation, so you don't end up with audio that's a third of a second ahead of the picture.
The inputs that matter
Required: latent, vae, output_name (default clip_001), and trim_frames. The latent has to come from Load Latent with stock_format on - the pack's own latent output is trimmed for context_latent use and stock decoders won't take it.
Optional: audio_vae, and leave it empty for a silent video. Then the encoding settings, which you can leave alone on a first pass - codec (libx264 or libx265), crf 16, preset slow, pixel_format yuv420p, audio_bitrate 192. yuv420p plays everywhere; the 10-bit and 444 options look better on a scope and worse in a browser.
Outputs are video_path (a STRING) and video (a VIDEO) for anything downstream that wants one. It's marked as an output node, so it runs when you queue.
Install
ComfyUI Manager → search H3 Motion Context, or:
cd ComfyUI/custom_nodes
git clone https://github.com/NikoDemon80/ComfyUI-H3-Motion-Context
Restart ComfyUI. ComfyUI 0.34.0+ is required; pack 0.3.1 is the last version that works on 0.33.4 and older. Nothing needs downloading for this node specifically - no upscaler checkpoint, no extra model files - but it does want the H3 weights, and H3 is a 33B model with roughly 42.5GB of reported weights, so you're already in "large card" territory. No requirements.txt ships with the pack; it uses numpy, PIL and aiohttp from ComfyUI's own environment, plus PyAV for the encode. If PyAV is missing, the pack says so plainly instead of throwing a stack trace about av.
If you had the old ComfyUI-H3-Disk-Upscale pack, remove it - this replaces it.
Common issues
"PyAV is not installed in ComfyUI's Python." Exactly what it says. Update ComfyUI, or install its requirements into the same Python ComfyUI runs on. The pack refuses rather than half-writing a file.
Re-queueing the same name errors out. You changed the latent, the trim, or the size. Give it a new output_name, or delete the old folder. This check is why partial decodes are safe to resume.
Frames look slightly brighter at the top of a clip. The H3 video VAE builds each frame from the ones before it, so a cold-start decode is a little hot for its first frames. H3 Chain Upscale gets around it across a chain by decoding each clip with the previous clip's last latent steps in front, then dropping them - more machinery than one clip needs.
You wanted this for a whole chain. You want H3 Chain Upscale, not this. This node is the single-clip tool: any H3 latent, frames on disk, an MP4 out.
One last thing worth saying because it costs people an evening: audio. A hardcoded 48 kHz anywhere in your pipeline will silently truncate the tail of an H3 clip, since H3 emits 32 kHz. Check the rate off the file before you remux or concatenate.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | An H3 latent with sound. From Load Latent, turn on stock_format. | |
| vae | VAE | The H3 video VAE. | |
| output_name | STRING | clip_001 | Name for this clip's folder and file, under output/h3_disk_decode. Reusing a name resumes that clip. |
| trim_frames | INT | 00–4096 | Frames cut off the front, picture and sound. For a chained clip, wire from Motion Context's trim_frames. |
| audio_vaeopt | VAE | The H3 audio VAE. Leave empty for a silent video. | |
| codecopt | COMBO | libx264 | libx264 (H.264) plays almost everywhere. libx265 (H.265) makes smaller files but encodes slower. |
| crfopt | INT | 160–51 | Picture quality. Lower is better and makes bigger files. 10 to 14 for files you will process further. 16 to 18 for a final video: it looks the same at a fraction of the size. 23 is a quick draft. |
| presetopt | COMBO | slow | Slower makes smaller files at the same quality. The picture barely changes. |
| pixel_formatopt | COMBO | yuv420p | yuv420p plays everywhere. 444 keeps full color and 10le is 10-bit; both can fail in some players. |
| audio_bitrateopt | COMBO | 192 | Sound quality in kbps. 192 is fine for sharing, 320 is the best. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| video_path | STRING | — |
| video | VIDEO | — |