Read CSV → Dataset
Read CSV → Dataset is the front door to ComfyDL's tabular half — get the path right or nothing else works
- dataset
What this node actually is
ComfyDL is Cynthia-lxx's attempt to make ComfyUI do deep learning instead of diffusion - the pack's own tagline is "DeepLearning is just a few clicks away," and it's built on the d2l (Dive into Deep Learning) codebase, so the nodes map onto textbook recipes: linear regression, Squared Loss, mini-batch SGD, CNNs, eventually BERT. It ships ~207 nodes across 35 categories, 109 of them its own.
Read CSV → Dataset is where you come in. It takes a path to a .csv and hands you the pack's DATASET object - a single teal socket that carries a feature tensor, an optional label tensor, the column names, and some metadata, passed by reference between nodes. Every other data node in the pack speaks that type: the adapters, the trainers, the writers, the preview. So this node is the door: read a CSV, and you're inside.
Reach for it when your data lives anywhere sane - a pandas pickle you exported, a Google Sheets download, a metrics dump - and you want to train on it inside the graph rather than in a notebook.
How it works
It's a thin, honest wrapper over pandas. The node calls pd.read_csv(file, sep=delimiter, header=0 if header else None, low_memory=False) - that last flag is there to stop pandas silently upcasting dtypes on mixed files - then hands the DataFrame to CdlDataset.from_dataframe. That function pops the target column off the frame and turns it into the labels tensor, converts every remaining column to float32/float64 through torch.from_numpy (a zero-copy view when the dtype already matches), and keeps the column names as feature_names. So the pipeline is: file → DataFrame → features + labels.
One thing to internalise: everything that isn't the target becomes a float feature. There's no "ignore this column" switch.
Inputs and outputs
Required: file (default cdl_dataset.csv) and target - a column name, matched exactly, and empty means "unlabelled dataset" (fine for writing, useless for training). Optional: delimiter (default ,), dtype (float32/float64, default float32), and header (default True). Output is a single dataset.
In practice you set two things: the absolute path, and the name of the column you're predicting. Then wire dataset into Dataset → Preview to eyeball it, Dataset → Tensors to feed the trainers, or straight into Linear Regression Train.
Install
Search the pack title ComfyDL in ComfyUI Manager, or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Cynthia-lxx/ComfyDL
pip install -r ./ComfyDL/requirements.txt
Restart ComfyUI. The console prints [ComfyDL] Loaded <n> deep learning nodes. if it worked. Note the pack's requirements.txt is only matplotlib, IPython and matplotlib-inline - pandas is not in it, even though every reader and writer imports it. Usually it's already in your venv from other packs; if not, pip install pandas. If you don't have ComfyUI at all, the author also ships ComfyDL_UI, a ComfyUI fork with the pack built in.
Where people get burned
Relative paths. The file widget is a plain string handed to pandas, so cdl_dataset.csv resolves against ComfyUI's process working directory - your ComfyUI folder - not the folder you launched from in your head. Use a full path and this class of bug disappears.
A stray text column. An ID column, an ISO date, a category name: any of those makes the float conversion blow up with a numpy error. Drop them in the CSV, or split the file.
target typos. The name is matched literally; a mismatch raises target column not found in DataFrame. With header = False the columns have no names at all, so target can never match - leave it empty in that case.
NaNs. Nothing in the chain drops them. A blank cell survives as NaN, becomes NaN in the tensor, and your loss goes NaN a few steps into training. Clean the CSV first.
Multi-character delimiters. delimiter is a single-character separator here (;, |, tab are all fine). Semicolon-separated European exports work great; \s+ does not - that's what Read Text is for.
Finally, remember the pack is young: the author archived the shipped example workflows because a node refactor made them stale, so there are no templates to crib from. You're wiring this by hand, which is exactly why the path and target fields matter so much.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| file | STRING | cdl_dataset.csv | — |
| target | STRING | — | |
| delimiteropt | STRING | , | — |
| dtypeopt | COMBO | float32 | 2 options: float32, float64 |
| headeropt | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| dataset | DATASET | — |