ComfyUI Node

AIHub Utils Load VAE

A VAE loader driven by a string, with cross-workflow memory

By otavanopisto·Created about a year ago·Updated 22 days ago· 7
AIHub Utils Load VAE
    • VAE
    vae

    AIHubUtilsLoadVAE is the VAE-loading member of the pack's string-driven loader family, and the logic that justifies it is identical to the others: the VAE name arrives as a string, not a dropdown pick. So the VAE can be chosen at runtime by a client, read from a stored file, or derived from an expose - and in the otavanopisto ComfyUI-aihub-workflow-exposer world, that's exactly the flexibility a workflow needs when it must keep working across different models.

    It also caches across workflows. The source remembers the last VAE file and object, so a workflow run that uses the same VAE twice - or two workflows sharing a VAE in one session - doesn't re-read the file from disk. The README calls this out explicitly: "it works across workflows and will keep the VAE in memory." For a client that runs workflows back to back, that's the difference between snappy and slow.

    The one input, the one output

    • vae (STRING) - the VAE filename. Empty means "don't load" (returns None, logs "No VAE specified" - not an error, so validate the string upstream if the client can send blanks).
    • VAE - the loaded object, ready for a VAEDecode or VAEEncode.

    Under the hood it routes to ComfyUI's VAELoader, with a GGUF branch if the name resolves to the model_gguf folder - useful if you're running a quantized VAE. If the file can't be loaded, you get a clear ValueError: Could not load the VAE.

    Why you'd reach for it

    Two scenarios. The straightforward one: your workflow's VAE comes from an expose or selection at runtime, so a static VAELoader won't cut it. The subtler one: model metadata. This pack's exported models carry a vae_file field (for checkpoints that don't bundle a VAE - a common enough situation that a missing or wrong VAE is one of the most-reported causes of washed-out, grey output). A dynamic workflow can read that field and load the matching VAE here, instead of hardcoding one.

    Gotchas

    The same blank-string foot-gun as the other loaders - empty input isn't an error, it's a None. And the caching means if you change the VAE mid-session, the source will notice (the cache is keyed on the filename) and reload, so that part is handled; the real gotcha is wiring the string. VAE filenames must match the models/vae folder exactly, including extension.

    Install

    No requirements, like the whole pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/otavanopisto/ComfyUI-aihub-workflow-exposer
    

    Restart ComfyUI. It's a small node with one string input, but in a dynamic workflow it's the difference between a VAE that follows the model and a VAE you hardcode and forget to update.

    Categoryaihub/utils

    Inputs (1)

    NameTypeDefaultDescription
    vaeSTRINGThe VAE to load

    Outputs (1)

    NameTypeDescription
    VAEVAE