ComfyUI Node

VAE Model Saver

Pull a VAE Out of Any Checkpoint and Keep It as Its Own File

By hekmon·Created about a year ago·Updated about a year ago· 1
VAE Model Saver
  • vae
    output_nameextracted_model
    output_foldermodels/vae

    VAEModelSaver is the low-drama sibling of this pack's CLIPModelSaver. It does exactly one thing: take a VAE object, write it to a .safetensors file, done. No dual-split logic, no prefix cleanup - vae.get_sd() straight into safetensors.torch.save_file, about thirty lines of code. That simplicity is the feature: there's not much that can go wrong.

    When you'd actually reach for it

    Two real cases, and only one of them is exotic.

    First, the workflow this pack was built for: TensorRT. When you compile a checkpoint into a TensorRT engine, the engine replaces the UNet but you still need the VAE to decode latents - and the naive move is loading the whole checkpoint again just to get it. Wiring VAEModelSaver into the build pass means you extract the VAE while the engine is being built, one load instead of two.

    Second, and more useful to the average person: yanking a baked-in VAE out of a checkpoint you like. Some checkpoints ship a good VAE inside the file; if you want that exact VAE to fix a different model whose output comes out grey and washed out - the classic missing-or-wrong-VAE symptom - this is the quick way to get it as a standalone file you can reuse.

    Inputs

    Three inputs, and vae is the only non-obvious one:

    • vae - the VAE output of a Checkpoint Loader, or any node that produces a VAE object.
    • output_name - default extracted_model. The node appends _vae.safetensors for you, so you'd get extracted_model_vae.safetensors.
    • output_folder - default models/vae, which is where ComfyUI's built-in VAE Loader reads from. Change it only if your models live elsewhere.

    No outputs - it's a terminal save node.

    Install

    Same story as the pack's CLIP node: the project isn't in the ComfyUI Manager catalog, so install via Git URL (Custom Nodes Manager → Install via Git URL, paste https://github.com/hekmon/comfyui-checkpoint-extract.git) and restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/hekmon/comfyui-checkpoint-extract.git
    

    Then restart. No model downloads, and the only dependency is safetensors, which ComfyUI already ships.

    Gotchas

    Two worth knowing. If you've pointed ComfyUI at a custom models directory via extra_model_paths, the default output_folder won't be where your VAE Loader looks - set it explicitly or your freshly saved file will sit in the default tree, invisible to the picker. And keep the format habit in mind: the node writes .safetensors, which is the safe format anyway - no pickle-executing .ckpt surprises.

    Honest verdict: this is a tiny utility node, not a workflow centerpiece. If you never touch TensorRT and your checkpoints already have working baked VAEs, you may never need it. But it's the right tool for two specific, real problems - and unlike a lot of custom nodes, it does exactly what its one-line description says.

    CategoryModels Savers

    Inputs (3)

    NameTypeDefaultDescription
    vaeVAE
    output_nameSTRINGextracted_modelThe model file name without extension ('_vae.safetensors' will be appended automatically).
    output_folderSTRINGmodels/vaeThe destination folder to output the model to.

    Outputs (0)

    No outputs