K3NK Save Latent (Pass-Through)
Checkpoint Your Latent Without Breaking the Wire (Yes, the Typo Is in the Name)
- samples
- samples
ComfyUI has a Save Latent node built in, and if you've used it mid-pipeline you know the annoyance: it's an output node, so it sits at the end of the line, and it doesn't give the latent back to you. K3NK Save Latent (Pass-Through) is the version that lets you snapshot a latent in the middle of a workflow and keep using it - hence the name, and yes, the "PassThrought" typo is in the node class itself, so it's your problem too if you ever wire it by hand.
The use case is long generation. On Wan video extends and multi-chunk pipelines, a single run can take twenty minutes or more. If the machine hiccups, or you want to try a different continuation from the same point, you don't want to redo the whole thing. Drop this node on the latent line, and every run leaves a .latent file on disk you can reload later.
How it works
The mechanism is almost boring, which is the point. It takes your samples latent, writes it out as a safetensors file, and returns the exact same latent unmodified as its output. That pass-through is the entire trick - you splice it inline between, say, your KSampler and a second sampling pass, and the graph still flows while a checkpoint lands on disk.
Files go to ComfyUI's output directory as {filename_prefix}_{counter:05d}_.latent, using the same counter scheme as the built-in save nodes, so you won't collide with existing files. The latent is stored with the samples key plus any extra metadata the latent dict carries (like noise_mask), which is what lets a plain latent loader pick it back up.
Because it uses folder_paths.get_save_image_path under the hood, the filename_prefix supports subfolders - backups/scene2 writes into an output subfolder cleanly. In the K3NK video workflow this is how each generated segment's latent gets parked next to its PNG frames, which is exactly what the pack's Image Loader (Blending) looks for to find its seams.
The inputs and output
samples(LATENT) - the latent to snapshot.filename_prefix- prefix, defaultComfyUI. Subfolders likesubdir/namework.
Output is samples, the identical LATENT - wire it straight on to whatever consumes the latent next.
Installing it
It's part of the K3NK pack. Easiest: ComfyUI Manager, search ComfyUI-K3NKImageGrab. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/K3NK3/ComfyUI-K3NKImageGrab
Restart ComfyUI. No extra dependencies - it uses safetensors, which ComfyUI ships.
Where people get burned
Two things. First, this node always writes - every queue run produces a file, and they accumulate. In a long iterating session you'll generate dozens of .latent files; sweep them periodically or you'll wonder where your disk went.
Second, remember it's a pass-through, not a fork. Whatever happens downstream, the file on disk is frozen at the moment this node ran. If you need the result of later processing saved as a latent, this isn't the node for that - that's the stock Save Latent at the end. Use this one as a deliberate checkpoint, and your multi-hour extends become resumable instead of all-or-nothing.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| samples | LATENT | — | |
| filename_prefix | STRING | ComfyUI | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| samples | LATENT | — |