JDCN_BatchLatentLoadFromDir
Re-open your saved latents straight from a folder
- Latent
- Latent_Names
- Latent_Paths
- Load_Cap
- Skip_Frame
- Count
JDCN_BatchLatentLoadFromDir loads latent files - the .latent format written by this pack's JDCN_BatchSaveLatent - from a folder, as a batch. It's the read side of a save/load pair, and its whole reason to exist is the animation/video workflow: VAE-encode your frames once, save the latents, then sample again and again without re-encoding.
Why the pair exists
In video and animation work, the VAE encode of a frame sequence is real, repeated cost - you're pushing every frame through the encoder each time you want to try a different prompt or sampler. Encoding once, dumping the result to disk, and reloading later sidesteps that entirely. The trade-off is disk space (latents are chunky), but for iterative anim work it's often the difference between "fiddle with the prompt for five minutes" and "fiddle for twenty."
How it works
Three inputs, same shape as the image loader:
Directory- where the.latentfiles live.Load_Cap- how many latents to load.Skip_Frame- skip the first N files.
It scans the folder for .latent files only (this format is this pack's own - comfy.utils.save_torch_file with a latent_tensor key, so don't expect it to read arbitrary checkpoint latents), then loads the slice after Skip_Frame, up to Load_Cap.
Outputs mirror the image loader: Latent (list of LATENT), Latent_Names, Latent_Paths, plus Load_Cap, Skip_Frame, and Count. Wire Latent straight into your sampler's latent input (it expects a latent dict, which is what gets saved/loaded).
The honest caveats
Same unsorted OS order gotcha as every folder node in this pack - if your _0001, _0002 ... _0010 latents load out of order, it's the folder walk, not you. And the Skip_Frame/Load_Cap slicing is positional over whatever order the walk produced. Zero-padded names are your friend.
Also, a loaded latent carries no metadata about the source image - you get the latent and its name/path, not the prompt that made it. Keep your own naming conventions sane (the saver's FilenamePrefix helps here) or you'll be guessing which batch is which later.
Installing it
Part of ComfyUI-JDCN:
- ComfyUI Manager β Install Custom Node β search JDCN β install ComfyUI-JDCN β restart.
- Or:
cd ComfyUI/custom_nodes
git clone https://github.com/daxcay/ComfyUI-JDCN.git
cd ComfyUI-JDCN
pip install -r requirements.txt
Restart; under π΅ JDCN π΅. Only dependency is piexif, no models to download.
Common issues
Point it at a folder with no .latent files and you get empty outputs plus a console note - the UI stays quiet, so check the log. Corrupt or mismatched latent files (e.g. saved by a different tool with a different tensor layout) can error during load; the node catches per-file errors and skips them, but verify one load end-to-end before running a big batch. And don't forget the VAE rule that applies to everything latent-related: the decode will only look right if the checkpoint you sample with matches the latent's origin. If colors come back weird, the model you loaded doesn't match what you encoded - not a bug in this node.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| Directory | STRING | directory path | β |
| Load_Cap | INT | 11β9999 | β |
| Skip_Frame | INT | 00β9999 | β |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| Latent | LATENT | β |
| Latent_Names | STRING | β |
| Latent_Paths | STRING | β |
| Load_Cap | INT | β |
| Skip_Frame | INT | β |
| Count | INT | β |