Nodes/ComfyUI-huggingface_dataset/πŸ€— Dataset Skip
ComfyUI Node

πŸ€— Dataset Skip

Skip the first N rows β€” the boring node that keeps showing up in real graphs

By StableLlamaΒ·Created a day agoΒ·Updated a day agoΒ· 1
πŸ€— Dataset Skip
  • dataset
  • dataset
β—„n1β–Ί

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 (default 1).

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.

CategoryHugging Face πŸ€—

Inputs (2)

NameTypeDefaultDescription
datasetHUGGINGFACE_DATASETInput dataset to drop rows from (from the πŸ€— Dataset Loader or another dataset node).
nINT10–2147483647Number of leading rows to drop.

Outputs (1)

NameTypeDescription
datasetHUGGINGFACE_DATASETThe dataset without its first n rows.