DatasetToDataloader
Wrap your dataset in a DataLoader, and know what that buys you
- dataset
- TORCH_DATALOADER
In PyTorch, a Dataset holds your data and a DataLoader is what actually feeds it to a model in batches. DatasetToDataloader is the pack's one-node wrapper: it takes a TORCH_DATASET and returns torch.utils.data.DataLoader(dataset) - a TORCH_DATALOADER. It's the "get this data ready to iterate" step of an ML workflow, sitting naturally after PyTorchDatasetDownloader or DatsetSplitter.
But read the defaults before you get excited, because this is where the node shows its limits. DataLoader(dataset) with no arguments means batch_size=1, shuffle=False, no parallel workers. That's the most naive possible loader - fine for feeding single samples, useless as a real training harness. There's no batching, shuffling, or worker-count input exposed here, which is unusual for a DataLoader wrapper.
The bigger gotcha
Nothing in this pack consumes a TORCH_DATALOADER. The pack's TrainModel node takes a TORCH_DATASET (or separate features/labels tensors), not a dataloader, and PyTorchInferenceNode takes a dataset too. So the output of this node has nowhere to go within this pack. It'll wire into another pack that understands the type, or you'll use it for inspection. For actually training, skip this node and feed the raw dataset straight into TrainModel - and note that TrainModel's own default batch_size is 1, so if you want real batching you set it there, not here.
Input and output
- dataset (
TORCH_DATASET) - a dataset from the downloader, splitter, orTensorsToDataset. - Output: one
TORCH_DATALOADER.
Install
ComfyUI Manager, search "EternalKernel PyTorch Nodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/TashaSkyUp/EternalKernelPytorchNodes
cd EternalKernelPytorchNodes
pip install -r requirements.txt
Restart ComfyUI; node under ETK/pytorch. No model files. Requirements are the standard ComfyUI stack plus scipy, scikit-learn, transformers, einops.
Common issues
- "What do I plug this into?" Within this pack: nothing. It's a dead end unless another pack speaks
TORCH_DATALOADER. Don't fight it - use datasets directly withTrainModel. - Batch size 1. The wrapper exposes no batching controls. If you were expecting a
(batch, ...)shaped stream, you'll get single samples. For batched training, configurebatch_sizeonTrainModelinstead. - No shuffle. Default loader doesn't shuffle. For a training loop that matters (order bias), but since you can't configure it here, this is another reason to prefer datasets.
Honest take: this node looks like a step you should take in a training pipeline, and mostly it isn't. It's a thin, default-arguments wrapper whose useful output another pack has to consume. The pack itself is small and tutorial-free, and it patches ComfyUI's validator to ignore return_type_mismatch - so a dataloader wired into a dataset input may not error, it'll just misbehave. Know your types.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| dataset | TORCH_DATASET | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| TORCH_DATALOADER | TORCH_DATALOADER | — |