Load Training Dataset
Skip the re-encode and get straight back to training
- latents
- conditioning
Load Training Dataset is the reload button for ComfyUI's built-in trainer. The first time through, you encode your images and captions with Make Training Dataset, then cache them with Save Training Dataset. Every run after that, this node pulls the cached latents and conditioning back off disk in seconds, so you can tweak the learning rate, crank the steps, or try a different rank without re-running the VAE and CLIP over your whole set again.
It ships with ComfyUI core (the whole training family landed late 2025 and is still officially experimental). It has exactly one input and two outputs, and it does one job well.
How it works
The input is folder_name - but unlike most string fields, it's a dropdown. ComfyUI scans its datasets directory and lists every saved dataset folder, so you pick rather than type. When the node runs, it reads every shard_*.pkl file in that folder, concatenates their contents, and hands you back the full list of latents and the matching list of conditioning, ready for training.
Under the hood it's torch.load with weights_only=True - a deliberate hardening so a tampered dataset file can't execute code on your machine. A companion metadata.json records how many samples and shards are there, though the node mostly ignores it and just loads everything.
The inputs and outputs
Just the one input, and two outputs:
folder_name- dropdown of saved datasets, from ComfyUI'sdatasetsfolder.latents- list of latent dicts, one per training image.conditioning- list of conditioning lists, aligned one-to-one with the latents.
Wire them into Train LoRA's latents and positive inputs exactly as you would from Make Training Dataset - the node exists precisely so that downstream wiring never changes. If you bucket, send them through Resolution Bucket first and flip on the trainer's bucket_mode.
Where people trip up
- Empty dropdown means nothing's saved. The combo only lists folders in
datasets/. If it's blank, run Save Training Dataset once - it creates the folder and the shards. - "No shard files found." If you pick a folder that's there but missing its shards (say you deleted them or copied only the metadata), you'll get this error. Save again, or check the folder.
- The dataset is baked. Latents were encoded by a specific VAE and captions by a specific CLIP. If you train a dataset on a different model family, you're training on the wrong latent space and the result will be mush. Load a dataset only into the trainer you intended it for.
- It's not image files. The
.pklshards only make sense to Load Training Dataset - don't expect to browse them like a photo folder. If you want to tweak individual images, change them upstream in Make Training Dataset and re-save.
Why bother caching at all
Dataset encoding isn't expensive per image, but it's pure repetition: the same VAE pass, the same CLIP tokenization, every single time you rerun the trainer. On a big set, that's minutes tacked onto every experiment, and the trainer is a node you'll run many times while you find the right settings. Cache once, load fast, iterate on what actually matters - the training itself. The one thing it doesn't save you from is curation, which you should be doing anyway.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_name | COMBO | Saved dataset to load, from the datasets directory. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| latents | LATENT | List of latent dicts |
| conditioning | CONDITIONING | List of conditioning lists |