Nodes/ZF-ComfyUI-Helper/ZF Load Latent Folders
ComfyUI Node

ZF Load Latent Folders

Feed an entire latent folder into your workflow in one wire

By Z-yaofang·Created 2 months ago·Updated 19 days ago· 1
ZF Load Latent Folders
    • latent_1
    • latent_2
    • latent_3
    • latent_4
    • latent_5
    • latent_6
    • latent_7
    • latent_8
    • latent_9
    • latent_10
    wan_has_reftrue
    wan_drop_lastfalse
    wan_loopedfalse
    address_1/root/Latent
    address_2
    address_3
    address_4
    address_5
    address_6
    address_7
    address_8
    address_9
    address_10

    The single-file latent loader in this pack is great until you need to process twenty latents that live in a folder. That's exactly what LoadLatentsFromFolderPath (display name "ZF Load Latent Folders") is for: it scans up to ten local folders and hands you every latent in each one as a list, ready to feed downstream in one go. If you're doing batch latent-to-video work - say, taking a folder of saved WAN latent clips and re-sampling or upscaling them all - this is the node that makes it a one-wire affair instead of twenty loader nodes.

    How it works

    Each of the ten address_1 through address_10 inputs is a folder path, and each has a matching latent_1 through latent_10 output. Fill in as many folders as you need; leave the rest empty. The node scans each filled folder for .latent, .safetensors, and .sft files, sorts them alphabetically, and loads every one.

    Three things to know about the outputs:

    • They are lists. latent_1 isn't a single latent, it's all the latents in address_1, in order. That's what makes this useful for batch work - and what makes it different from the single-load node.
    • A folder with no matching files is an error, not a silent skip. The node validates on queue and will tell you "No latent files found in folder: …" rather than quietly doing nothing.
    • You need at least one real folder. If every address is blank, it raises before running.

    The same three WAN flags from the single loader (wan_has_ref, wan_drop_last, wan_looped) sit at the top and apply to every latent loaded from every folder. Defaults are True/False/False; change them only if your video pipeline tells you to.

    The detail that saves you time

    The loader hashes every file it loads for ComfyUI's change-detection (IS_CHANGED). That means if you drop new latents into the folder or edit existing ones, the next run picks them up automatically - no bypassing nodes, no clearing the cache. Given that "I replaced a file and ComfyUI kept using the old one" is one of the classic loader gotchas, this is a genuinely thoughtful touch.

    Installing it

    Same deal as the whole pack - it's tiny and dependency-free:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Z-yaofang/ZF-ComfyUI-Helper
    

    Restart ComfyUI. Or use ComfyUI Manager → search ZF-ComfyUI-Helper → Install. No models, no requirements.txt, nothing extra to download. The node appears under ZF Helper/Latent.

    Where people get burned

    • The /root/Latent default on address_1. That's the author's Linux path. On your machine, set it to a folder that actually exists or validation will fail on queue.
    • Confusing this with a file picker. This loads by local path, not through the browser upload dialog. If you're on a different machine or want portability, hardcoded absolute paths in a shared workflow will break for anyone who opens it. Fine for your own box; annoying to share.
    • Feed a list to a node that expects one latent. A list output connects fine to list-aware nodes, but you can't just plug it into a sampler's single latent input. If you need per-item processing, that's what an Any Switch or a batch-splitter is for - which is the same plumbing layer this node lives in.
    CategoryZF Helper/Latent

    Inputs (13)

    NameTypeDefaultDescription
    wan_has_refBOOLEANtrue
    wan_drop_lastBOOLEANfalse
    wan_loopedBOOLEANfalse
    address_1STRING/root/Latent
    address_2STRING
    address_3STRING
    address_4STRING
    address_5STRING
    address_6STRING
    address_7STRING
    address_8STRING
    address_9STRING
    address_10STRING

    Outputs (10)

    NameTypeDescription
    latent_1LATENT
    latent_2LATENT
    latent_3LATENT
    latent_4LATENT
    latent_5LATENT
    latent_6LATENT
    latent_7LATENT
    latent_8LATENT
    latent_9LATENT
    latent_10LATENT