Nodes/ComfyUI-WanVideo-LatentIO/Load Wan Video Latent
ComfyUI Node

Load Wan Video Latent

Replay an expensive Wan render without re-sampling it

By heresyCoder·Created 8 months ago·Updated 7 months ago· 4
Load Wan Video Latent
    • LATENT
    filename
    source_directoryinput
    subdirectory

    The sampler is the expensive part. This node lets you skip it.

    Wan 14B renders at 720p are a commitment. A single clip can sit in the sampler for twenty minutes or more on consumer hardware, and if all you changed is the VAE decode, the upscaler, or the second half of a two-pass workflow, re-running that sampler is pure waste. Load Wan Video Latent exists to turn earlier work into a starting point: it reads a saved Wan video latent back into your graph as a standard LATENT, and everything downstream behaves as if the sampler had just finished.

    This is not a theoretical trick. Wan 2.2 denoises in two stages - a high-noise expert that handles motion and composition, then a low-noise expert that adds detail - and the community has been splitting those passes since the model shipped. Run many cheap stage-one renders, keep the few you like, and feed only those saved latents into stage two. On full FP16 14B models (roughly 28GB each) that also means you don't keep swapping models in and out of VRAM between passes. This node is the half of that pipeline that puts the saved latent back in.

    How it works

    Under the hood it's a small file reader with a LATENT out. It resolves ComfyUI's real input or output directory via folder_paths, joins your filename (plus optional subdirectory), and loads the file. If the exact name isn't found it automatically retries with .safetensors, .pt, and .pth appended, so typing the extension is optional. Safetensors files come back through safetensors' load_file; older .pt/.pth files go through torch.load. A lone tensor is wrapped into the standard {"samples": ...} dict shape ComfyUI's decoders and samplers expect, and any extra tensors in the file - like the noise input some Wan workflows carry - come along for the ride.

    The inputs that matter

    • filename - the author's tooltip says "Filename with extension (e.g., latent.safetensors)." The auto-extension fallback is forgiving, but be explicit anyway; it removes ambiguity when the file lives in a subfolder.
    • source_directory - input or output. This is the feature that justifies the pack: ComfyUI's stock latent loader only reads the input folder, while here you can load straight from output/, where the sibling SaveWanVideoLatent node writes.
    • subdirectory (optional) - a subfolder within the chosen directory. The path is sanitized to block .. traversal, which is a nice touch for a node that takes user-supplied paths.

    Where the LATENT goes

    The single LATENT output wires into a VAE decode node to get frames, or straight into the latent input of a second-pass Wan sampler to continue a generation. You can also drop a Wan latent .safetensors into ComfyUI/input by hand and load it like any other file.

    Install

    It's a two-node pack from a small author (heresyCoder), so the install is the boring, reliable kind: through ComfyUI Manager, search "ComfyUI-WanVideo-LatentIO", or

    cd ComfyUI/custom_nodes
    git clone https://github.com/heresyCoder/ComfyUI-WanVideo-LatentIO
    

    then restart ComfyUI. No model downloads, no extra pip packages - it only uses torch and safetensors, both already bundled with ComfyUI.

    Gotchas

    Watch the pairing with the Save node. Its first save of a given name writes the file extension-less unless you type one, and a second save with the same name becomes name_001.safetensors - while a Load node pointing at the base name will keep reading the oldest file. Give each run its own name and you sidestep the whole thing. And since .pt files are Python pickles, only load ones you saved yourself or you're trusting whatever code is embedded in the file. Non-tensor metadata doesn't survive the round trip either, but for plain Wan latents that's almost always just samples, so it rarely bites.

    CategoryWanVideo/latent

    Inputs (3)

    NameTypeDefaultDescription
    filenameSTRINGFilename with extension (e.g., latent.safetensors)
    source_directoryCOMBOinputLoad from ComfyUI/input or ComfyUI/output
    subdirectoryoptSTRINGSubfolder within selected directory

    Outputs (1)

    NameTypeDescription
    LATENTLATENT