Nodes/Spark-H3/Load MiniMax H3 AV Latent Cache
ComfyUI Node

Load MiniMax H3 AV Latent Cache

Loading a Cached MiniMax-H3 Latent

By zechengtang·Created about a month ago·Updated about 3 hours ago· 82
Load MiniMax H3 AV Latent Cache
    • LATENT
    ◄cache_path/tmp/minimax_h3_av.safetensors►

    The expensive part of a MiniMax-H3 run isn't the VAE. It's the denoise pass - minutes of DiT over a token sequence with tens of thousands of video tokens, on a 33B model. This node exists so you pay for that exactly once: it reads back the sampler output that SaveMiniMaxH3AVLatentCache wrote to disk and hands you a LATENT you can decode, on a later run, or on a different machine.

    It's a one-input node, and that's the whole point. There's no model to load, no resolution to declare - the latent already knows its shape.

    What's actually in the file

    MiniMax-H3 is an omni-modal model that generates picture and stereo audio in one pass, so its latent isn't a single tensor. It's a nested pair: a video stream and an audio stream. The pack's save node writes those as two tensors literally named video and audio in a safetensors file, which is why H3 decoding needs two VAEs - the video VAE through VAEDecode and the audio VAE through VAEDecodeAudio, both fed from the same latent.

    This node rehydrates that pair. Under the hood it's about six lines: load the file on CPU, check that the tensor set is exactly {"video", "audio"}, wrap them in comfy.nested_tensor.NestedTensor, and return {"samples": ...}. Note it does not decode anything. Decoding stays in your graph, so you can swap VAE precision or try a different audio VAE without re-denoising.

    It also implements IS_CHANGED off the file's mtime and size. That sounds like a footnote, but it's the reason the node is usable in a loop: overwrite the cache with a fresh denoise and the loader actually re-reads it, instead of ComfyUI caching the old latent forever because the input string didn't change.

    The input, and where the output goes

    • cache_path - a string, defaulting to /tmp/minimax_h3_av.safetensors. Change it. That default is the author's benchmark scratch path, on Windows it's not what you think it is, and on a lot of Linux boxes /tmp is cleared on reboot. Tildes expand, so ~/h3_caches/clip01.safetensors works, and relative paths resolve against ComfyUI's working directory.

    Output is a single LATENT. Wire the same socket into both decoders:

    Load MiniMax H3 AV Latent Cache ──┬──> VAEDecode      (video VAE)
                                      └──> VAEDecodeAudio (audio VAE)
    

    Then frames go into CreateVideo with the audio and an fps, and out to whatever save node you like. The pack's own benchmark harness uses exactly this split - a denoise graph that ends in the save node, and a decode graph that starts here - which is how it can run four samplers on one GPU and decode all the clips afterwards.

    Installing it

    The whole pack installs together, and the officially supported route is the release ZIP, because the CUDA backend has to be built for your GPU architecture:

    cd /path/to/ComfyUI/custom_nodes
    unzip /path/to/ComfyUI-Spark-H3-<version>-linux-x86_64-sm120-cu130.zip   # SM120 example
    /path/to/ComfyUI/.venv/bin/python ComfyUI-Spark-H3/install.py
    

    Use the Python interpreter that starts ComfyUI, not a system one. Or grab it from ComfyUI Manager - the pack is on the Comfy Registry as publisher zechengtang, node ID comfyui-spark-h3. A plain git clone https://github.com/zechengtang/Spark-H3 into custom_nodes also works for this node, but the Spark attention nodes still need the matching comfy-kitchen backend, so you end up running the installer anyway.

    The pack wants ComfyUI 0.38.x or 0.39.x (0.39.2 is the current recommendation), CUDA 13.0, and an SM86/SM89/SM120 card. Models aren't bundled - the H3 diffusion model, text encoder, and both VAEs come from Comfy-Org/MiniMax-H3.

    Worth saying out loud once: H3's open weights ship under the MiniMax H3 Community License, whose "Applicable Territory" excludes the EU, UK, South Korea and the US - and that reaches the outputs, not just the weights. If you're in one of those places, the local pipeline isn't licensed to you. The hosted Hailuo API is a separate thing.

    When it breaks

    invalid MiniMax-H3 AV latent cache - the file loaded fine but its tensors aren't video + audio. Almost always this means you pointed it at a latent from some other model, or at something a generic latent-save node wrote. H3 latents are a two-stream nested pair; a single-tensor file will never satisfy this check.

    A file-not-found traceback before the node even runs - that's IS_CHANGED stat-ing the path during graph validation. ComfyUI reports it as a node error, but nothing about the node's execution is broken; the path is just wrong.

    Cache gets stale or vanishes between sessions. On Linux, check whether your /tmp is tmpfiles-managed; put caches somewhere under your ComfyUI output tree if you want them to survive. And check free disk before you start: a full 14-second 1344×768 clip's latent safetensors is not a small file.

    Categorymodel/latent/minimax

    Inputs (1)

    NameTypeDefaultDescription
    cache_pathSTRING/tmp/minimax_h3_av.safetensors—

    Outputs (1)

    NameTypeDescription
    LATENTLATENT—