ZF Load Single Tensor Latent
Load .pt latents from disk — and read the pickle warning before you do
- latent
- file_path
If you've saved latents through certain video tooling - most notably kijai's WAN wrapper, which dumps .pt files named like ComfyPickle_latent_00001 - you've hit the wall where ComfyUI's built-in loaders won't touch them. LoadTensorLatentFromPath (display name "ZF Load Single Tensor Latent") is the pack's answer: it loads one PyTorch .pt or .pth latent straight from a folder path. The default file name is even ComfyPickle_latent_00001, which is a dead giveaway that WAN latent-continuation workflows are the intended audience.
What it does under the hood
The node runs torch.load on the file and then figures out what shape the content is in, so you don't have to:
- A dict with a
sampleskey - i.e. a full ComfyUI latent dict - is preserved as-is (and converted to float). - A dict with a
latent_tensorkey - the safetensors-style layout - gets wrapped as{"samples": ...}. - A bare tensor gets wrapped the same way:
{"samples": tensor}.
Either way you get a normal LATENT out of it, which is the whole trick - this node exists to normalize whatever weird-but-legit way someone saved the tensor into the one shape ComfyUI samplers and decoders expect. The WAN flags (wan_has_ref, wan_drop_last, wan_looped) get written into the latent dict too, same as the safetensors sibling node. Leave them at defaults unless your pipeline says otherwise.
The safety note, stated plainly
.pt files are Python pickles. Pickle can execute arbitrary code when loaded. This node deliberately loads with weights_only=False, which means a maliciously crafted file could run code on your machine. The README says it, and it's not lawyer-cover: only load tensor latents you created yourself or fully trust. Downloading a random .pt from a stranger's Google Drive and loading it here is how you get owned. This isn't FUD - it's the same warning that comes with any pickle-based loader in the ecosystem.
The inputs and outputs that matter
Inputs are minimal: file_name (extension optional, .pt is appended if you omit it), folder_path (defaults to /root/Latent - change it; that's a Linux-root path that won't exist on most machines), and the three WAN booleans. Outputs are latent and file_path (the resolved absolute path). The loader hashes the file for change-detection, so editing the file on disk and re-running picks up the new content without you having to bypass the node.
Installing it
Same story as the whole pack - this is a zero-dependency utility:
cd ComfyUI/custom_nodes
git clone https://github.com/Z-yaofang/ZF-ComfyUI-Helper
Restart ComfyUI, or install via ComfyUI Manager by searching ZF-ComfyUI-Helper. No models, no requirements.txt. It's listed under ZF Helper/Latent.
Where people trip
The biggest confusion is the extension rule: if you type ComfyPickle_latent_00001.pt the node is fine, but if you leave the extension off it appends .pt automatically - it does not try .pth as well. If your file is .pth, type the extension or the node can't find it. And again: that pickle warning isn't a footnote, it's the actual risk this node's one real downside.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| file_name | STRING | ComfyPickle_latent_00001 | — |
| folder_path | STRING | /root/Latent | — |
| wan_has_ref | BOOLEAN | true | — |
| wan_drop_last | BOOLEAN | false | — |
| wan_looped | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| file_path | STRING | — |