Nodes/ComfyUI-H3VAE_TRT/MiniMax-H3 TRT VAE Loader
ComfyUI Node

MiniMax-H3 TRT VAE Loader

The TensorRT MiniMax-H3 VAE loader — how your H3 videos get fast without looking like it

By lihaoyun6·Created about 11 hours ago·Updated about 11 hours ago· 1
MiniMax-H3 TRT VAE Loader
    • VAE
    decoder
    encoder

    The MiniMax-H3 VAE is the autoencoder that sits between the sampler and your pixels: it turns the model's 24-channel latents into video frames (decode) and your input frames back into latents (encode). For a 33B video model it's a serious chunk of math, and in plain PyTorch it drags down the end of every generation. This loader is the payoff of this pack's whole game: you load pre-compiled TensorRT engines instead of the raw PyTorch/ONNX graph, and encode/decode gets roughly 1.7x faster - the reason to reach for this pack in the first place.

    It's from lihaoyun6, the same developer behind the popular ComfyUI-FlashVSR_Ultra_Fast video upscaler, and it shares that pack's philosophy: do the expensive conversion once, then run. To everyone else in your workflow, this node is just another VAE loader. You wire its single VAE output into VAE Decode / VAE Encode and nothing downstream knows (or cares) that the pixels came out of an NVIDIA TensorRT engine instead of a PyTorch module.

    How it works

    The dropdowns list every .engine file in your models/vae folder. Pick a decoder and an encoder, and the node wraps them in a runner that lazily loads the engine - first to RAM as serialized bytes, then deserializes it onto the GPU only when the first inference actually happens. That lazy-loading is why it plays nice with ComfyUI's memory management: it hooks into unload_all_models and free_memory, so when ComfyUI decides it needs VRAM for something else, the engines get offloaded instead of leaking. Unless you launched ComfyUI with --highvram or --gpu-only, in which case it keeps them resident.

    Once loaded, it's a genuinely clever wrapper around the fixed-shape engines. The H3 VAE is a video autoencoder with 16x spatial and 4x temporal compression, and because the compiled engines only accept one tile size, the node tiles everything itself: frames are split into 256px spatial tiles with 64px overlap (blended back to hide seams), and the temporal dimension is processed in 17-frame clips with overlap and blending so long clips stay coherent. That's the part you never see - and the reason the engine can have a single fixed input shape while your videos can be any size.

    The inputs that matter

    Two dropdowns, both required, both from the models/vae folder:

    • decoder - the compiled decoder engine.
    • encoder - the compiled encoder engine.

    The node will flatly refuse to run with either set to None ("Encoder cannot be None!" / "Decoder cannot be None!"), so don't try to get away with a decode-only setup. The output is a standard VAE that slots into any MiniMax-H3 workflow's VAE slots.

    Getting there

    Install via ComfyUI Manager (search ComfyUI-H3VAE_TRT) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/lihaoyun6/ComfyUI-H3VAE_TRT
    python -m pip install -r ComfyUI-H3VAE_TRT/requirements.txt
    

    That requirements file is a single line - tensorrt - so this node is NVIDIA-only by construction. Before it will show anything in its dropdowns, you need three things: the ONNX models from lihaoyun6/MiniMax-H3-VAE-ONNX sitting in ComfyUI/models/vae, a run of the MiniMax-H3 TRT Compiler to turn them into .engine files, and a press of R to refresh the model list so the new engines appear.

    Common issues

    • Empty dropdown means you haven't compiled yet - the loader only sees .engine files, never .onnx. Run the compiler first.
    • Both dropdowns default to None and the node errors if you leave them that way. Select both every time (or save the workflow after selecting).
    • "TensorRT library not found!" - the tensorrt pip package isn't importable in ComfyUI's Python. Reinstall into the right environment.
    • If you've changed TensorRT versions or machines since compiling, the engines may fail to deserialize - recompile rather than debugging; it's the standard fix.

    One last reality check: the speedup is on VAE encode/decode only, not on sampling. If the transformer itself is your bottleneck, this pack won't save you - but if you're staring at a long decode at the end of every H3 render, it's the cheapest win on the table.

    CategoryMiniMax_H3/Acceleration

    Inputs (2)

    NameTypeDefaultDescription
    decoderCOMBO1 options: None
    encoderCOMBO1 options: None

    Outputs (1)

    NameTypeDescription
    VAEVAE