ZF Load Tensor Latent Folders
Batch-load every .pt latent in up to ten folders, in one pass
- latent_1
- latent_2
- latent_3
- latent_4
- latent_5
- latent_6
- latent_7
- latent_8
- latent_9
- latent_10
The single .pt loader in this pack is the right tool for "load this one tensor latent." This one, LoadTensorLatentsFromFolderPath (display name "ZF Load Tensor Latent Folders"), is the batch version: it scans up to ten folders of .pt/.pth files and returns every latent in each folder as a list. If you have a directory of saved WAN latent clips you want to resample, upscale, or re-decode in bulk, this is the node that turns a folder into a single wire.
How it maps out
Ten folder inputs (address_1 through address_10), ten matching list outputs (latent_1 through latent_10). Fill in only the folders you need - blanks are skipped. Each filled folder is scanned for .pt and .pth files, sorted alphabetically, and every file is loaded. The loading logic is the same as the single-file sibling: a full latent dict with samples is preserved, a latent_tensor dict gets wrapped, and a bare tensor gets wrapped as {"samples": ...}. So whatever flavor of "I saved it as a pickle" your pipeline produced, you get a normal LATENT list on the other side.
The wan_has_ref, wan_drop_last, and wan_looped booleans sit at the top and apply to every latent loaded from every folder. Defaults are True/False/False - leave them unless your video pipeline says otherwise.
Two validation behaviors are worth knowing before you queue:
- Every filled folder must contain at least one
.pt/.pthfile, or the node errors with "No tensor latent files found in folder: …". It won't silently load nothing. - At least one folder is required. All ten blank = error.
The loader also hashes every file for ComfyUI's change-detection, so dropping new pickles into a folder and re-running picks them up without bypassing the node - the same nice touch as the other loaders in this pack.
The pickle warning, unskippable
.pt files are Python pickles, and this node loads them with weights_only=False. Pickle can execute arbitrary code on load. That's not a hypothetical - it's the standard, well-documented risk of pickle-based formats, and it's why the README calls it out in bold. Only feed this node .pt/.pth files you created yourself or that come from a source you fully trust. A random file from a stranger's drive is how people get a nasty surprise. There's no way around it if you want to load these files at all; you just have to be careful about provenance.
Installing it
The whole pack is dependency-free, so this is a two-liner:
cd ComfyUI/custom_nodes
git clone https://github.com/Z-yaofang/ZF-ComfyUI-Helper
Restart ComfyUI, or use ComfyUI Manager and search ZF-ComfyUI-Helper. No models, no requirements.txt. The node shows up under ZF Helper/Latent.
Where it bites
Same /root/Latent default on address_1 - that's a Linux-root path, change it to a real folder on your machine or validation fails. And remember the outputs are lists: plug them into list-aware nodes, not into a sampler's single latent input. If you only want one specific pickle, this is overkill - grab the single-file node instead.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| wan_has_ref | BOOLEAN | true | — |
| wan_drop_last | BOOLEAN | false | — |
| wan_looped | BOOLEAN | false | — |
| address_1 | STRING | /root/Latent | — |
| address_2 | STRING | — | |
| address_3 | STRING | — | |
| address_4 | STRING | — | |
| address_5 | STRING | — | |
| address_6 | STRING | — | |
| address_7 | STRING | — | |
| address_8 | STRING | — | |
| address_9 | STRING | — | |
| address_10 | STRING | — |
Outputs (10)
| Name | Type | Description |
|---|---|---|
| latent_1 | LATENT | — |
| latent_2 | LATENT | — |
| latent_3 | LATENT | — |
| latent_4 | LATENT | — |
| latent_5 | LATENT | — |
| latent_6 | LATENT | — |
| latent_7 | LATENT | — |
| latent_8 | LATENT | — |
| latent_9 | LATENT | — |
| latent_10 | LATENT | — |