NNT Time Series Data Loader
Classic forecasting datasets, preprocessed into sequences
- time_series_data
- features_targets
- dataset_info
- dataset_stats
Airline passengers, sunspots, co2 levels, gas prices - the classic time series every forecasting tutorial has used for fifty years, all built in and ready to load. NNT Time Series Data Loader is the pack's bridge to time series work: it pulls a named dataset (or your own CSV), slices it to a date range, applies preprocessing, and hands back windowed tensors you can feed into an RNN or LSTM stack. If the rest of the pack is your image-and-text playground, this node is the "sequence data" corner of the sandbox.
The headline feature is that it doesn't just dump a tensor on you. It does the stats-modeling housekeeping too - missing-value filling, stationarity and seasonality tests - and returns a stats dictionary alongside the data. For a learning tool, having a machine tell you "this series is non-stationary, so difference it" is worth a lot.
How it works
Pick a dataset from eleven built-in options (default airline_passengers), optionally narrow it with start_date/end_date (strings like 1949-01), set the frequency (M, D, W, Y, Q, H), and the node loads it from statsmodels, caching the raw CSV into ComfyUI/models/timeseries_datasets/ on first use. The preprocessing menu handles the classic moves - standardize, normalize, log, difference, box-cox - and fill_missing handles gaps with forward/backward/linear fills.
The return_type dropdown changes what you get:
- single_series - the raw series as a tensor.
- multi_series - multiple lagged series, for looking at the data as a set of shifted views.
- features_targets - actual training windows:
sequence_length(default 60) steps of history as features,prediction_horizon(default 12) steps ahead as targets. This is the one you want for training a forecaster.
custom_filepath lets you load any CSV (with a date column as index) instead of the built-ins.
Outputs: time_series_data, features_targets (empty unless you asked for windows), dataset_info (a string summary), and dataset_stats - a DICT holding original/processed shapes, missing-value count, stationarity test result, seasonality test result, and mean/std/min/max/skew/kurtosis. Wire dataset_stats into a string node or just read it in the console.
Where it fits and what bites
The natural companion here is the pack's NntDefineRNNLayer / LSTM layers: load airline_passengers with return_type=features_targets, feed features_targets into an LSTM model as your training/target data, train, and you've built a tiny forecasting demo end to end.
Gotchas worth knowing. The statsmodels datasets are small and old - that's the point (tutorial-grade), but don't expect modern data. box-cox needs strictly positive values; if your series has zeros the preprocessing throws, so reach for log or difference instead. And the start_date/end_date strings are parsed against the dataset's natural frequency, so mismatched granularity can silently give you a slice you didn't intend - check dataset_info before training on it.
Install
Pack-level install:
cd ComfyUI/custom_nodes
git clone https://github.com/inventorado/ComfyUI_NNT.git
cd ComfyUI_NNT
pip install -r requirements.txt
Restart ComfyUI (or Manager → "ComfyUI Neural Network Toolkit NNT"). This node specifically needs statsmodels and scipy, both in the pack requirements. Full install is heavy - torch, sklearn, transformers, onnx, shap pinned 0.41.0 - so budget a few minutes on first run. It's a niche node, but for anyone learning sequence models in ComfyUI, it's the easiest on-ramp available.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| dataset | COMBO | airline_passengers | 11 options: airline_passengers, sunspots, mortality_rates, livestock, electricity_consumption, gas_prices, +5 |
| start_date | STRING | 1949-01 | — |
| end_date | STRING | 1960-12 | — |
| frequency | COMBO | M | 6 options: M, D, W, Y, Q, H |
| preprocessing | COMBO | None | 6 options: None, standardize, normalize, log, difference, box-cox |
| fill_missing | COMBO | forward | 4 options: forward, backward, linear, none |
| return_type | COMBO | single_series | 3 options: single_series, multi_series, features_targets |
| sequence_length | INT | 601–1000 | — |
| prediction_horizon | INT | 121–100 | — |
| custom_filepathopt | STRING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| time_series_data | TENSOR | — |
| features_targets | TENSOR | — |
| dataset_info | STRING | — |
| dataset_stats | DICT | — |