π€ Dataset Skip
Skip the first N rows β the boring node that keeps showing up in real graphs
- dataset
- dataset
Every dataset has a front that you don't want. The first few rows are boilerplate, or the corpus is ordered by quality and the start is where all the near-duplicates live, or you already consumed rows 0β499 and now you want the next chunk. π€ Dataset Skip drops the first n rows and hands back the rest - no conditions, no cleverness, just the front of the queue moved out of the way.
How it works
It's datasets.Dataset.skip (and IterableDataset.skip) as a node. Two inputs:
dataset- what to trim.n- how many leading rows to drop (default1).
One output: the dataset without its first n rows. Set n to 0 and it's a no-op passthrough - a handy way to bypass the node by value rather than deleting it from the graph.
It works on both fully-loaded and streaming datasets, which is exactly where Skip earns its keep. On a lazy streaming dataset, skip is your friend for peeking past the first rows: combine it with Take and you can pull "rows 500β600 of a huge corpus" without downloading anything except the rows you actually materialize. Skip(500) then Take(100), then convert.
The mental model
Skip and its mirror image Take (keep the first N) are the two blunt instruments of the pack - you use them constantly in small ways and forget they're there. The classic combo is Skip + Take to extract a middle window: Skip for the offset, Take for the count. Anything position-based is streaming-safe with these two, while the fancier index-based Select is loaded-only - so for big streaming data, Skip/Take are not just simpler, they're the only option.
One honest caveat: Skip is positional and blind. If you want to drop rows because of their content, that's Filter's job; Skip only knows about position. And on a shuffled dataset, "the first N" is just whatever the shuffle produced - so decide whether Skip belongs before or after your Shuffle based on which order you're trimming.
Installing it
Part of StableLlama/ComfyUI-huggingface_dataset. ComfyUI-Manager β search "Hugging Face dataset", or:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-huggingface_dataset
pip install -r requirements.txt
Restart ComfyUI. Only runtime dependency is datasets, installed for you by Manager.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| dataset | HUGGINGFACE_DATASET | Input dataset to drop rows from (from the π€ Dataset Loader or another dataset node). | |
| n | INT | 10β2147483647 | Number of leading rows to drop. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| dataset | HUGGINGFACE_DATASET | The dataset without its first n rows. |