ComfyUI Node

Load Universal Latent

Load a latent from disk — even the weird video ones

By XxcomfyTestxX·Created 3 months ago·Updated 3 months ago· 2
Load Universal Latent
    • LATENT
    latent_file

    The other half of the "save the latent, decode later" trick. LoadUniversalLatent pulls a .latent file out of ComfyUI/input/ and hands it back as a real LATENT socket, ready to feed a VAE Decode or another sampler pass. Where it earns the "universal" in its name: Comfy's native LoadLatent only reads the tightly-serialized latents its own SaveLatent writes to output/, and the README is blunt that it chokes on LTX latents. This one just does a torch.load() of whatever's in the file and returns the whole dict untouched - which is precisely what makes video latents, with their extra metadata keys, load without drama.

    How it works

    The dropdown lists every .latent file in ComfyUI/input/. Pick one and it's read with torch.load(map_location="cpu") and returned as-is. Like its conditioning sibling, it keeps itself honest: an IS_CHANGED SHA-256 hash of the file means re-saving over the same name re-triggers the node instead of ComfyUI's cache serving you the old copy, and it validates the file exists before running so you get a clear error rather than a cryptic one.

    The input and output

    • latent_file - the one enum widget. Choose from the list; drop a new .latent in input/ and hit refresh on the widget to make it appear.
    • Output: LATENT - wire it into a VAE Decode to turn a saved generation into pixels, or back into a KSampler to keep sampling from a saved state. Works for stills and video latents alike, since nothing is stripped out on the way through.

    When this pays off

    Three solid uses. The memory play: generate and save in one workflow, then decode in a clean one where the big model never loads - the community's standard workaround for VAE OOM on video models, where the sampler and the VAE rarely fit in VRAM together. The continuation play: save a latent, then load it as the starting point of an img2vid or video-extension pass without regenerating from scratch. And the sharing play: hand someone a .latent and a matching VAE and they can decode your result without ever downloading the model that made it.

    Install

    Standard custom-node install, and there's nothing extra to install - no pip requirements, no model files, just the ComfyUI core it already runs on.

    • ComfyUI Manager → install from Git URL → https://github.com/XxcomfyTestxX/ComfyUI-SaveLoadUniversalConditioningLatent, then restart; or
    • cd ComfyUI/custom_nodes && git clone https://github.com/XxcomfyTestxX/ComfyUI-SaveLoadUniversalConditioningLatent and restart.

    Where people get burned

    First: these are pickle files, not the safetensors .latent files Comfy's native nodes write to output/. If you're looking for a native-saved latent, it's not in input/, and this node won't read it - the two ecosystems don't interoperate. Second: a latent only means something to the VAE of the model family that produced it. Loading an LTX latent and decoding with an SDXL VAE gives you garbage at best, an error at worst. Keep the file, its model family, and the matching VAE together. And the loaded tensors sit on CPU until you feed them downstream - that's fine, ComfyUI handles the move - so don't go adding a node to "fix" it.

    CategoryUniversalIO

    Inputs (1)

    NameTypeDefaultDescription
    latent_fileCOMBO0 options:

    Outputs (1)

    NameTypeDescription
    LATENTLATENT