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

πŸ€— Dataset Unique

What values actually exist in this column? Ask once, get a Data List

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

Half of data work is finding out what you're actually holding. "Does every row in this caption column have a real caption?" "What labels are even present?" πŸ€— Dataset Unique answers that class of question directly: it scans one column and hands back the distinct values as a ComfyUI Data List, ready for counting, inspecting, or feeding into a loop.

How it works

It calls datasets.Dataset.unique on the column you name and converts the result to the pack's standard output shape: a values Data List of plain values (strings, numbers - whatever the column holds). Two inputs, one output:

  • dataset - a fully-loaded dataset from the loader.
  • column - the column to inspect.
  • Output values - a Data List of the distinct values found.

Because it's a Data List and not a bare LIST, it plugs straight into the companion Basic data handling pack: Data List β†’ length gives you the distinct count, convert to Data List/LIST lets you pipe values onward. That "how many unique things are in here" number is often the whole point - it's your class count, your tag sanity check, your duplicate warning.

Read before you run it

Three things are worth flagging. First, loaded-only: like Sort and Flatten, unique requires a materialized datasets.Dataset, so a streaming input raises the pack's friendly "disable streaming" error. Second, the node is not a deduplicator - it reports unique values, it doesn't remove duplicate rows. If you want one row per value, you'll still be doing that work yourself. Third, unique values come back in whatever order the scan produced, not sorted - sort them downstream if order matters.

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. The only runtime dependency is datasets, installed automatically by Manager.

This is the node you'll reach for the moment a dataset misbehaves and you need to know whether the problem is a stray value in a column or a missing one. It turns "let me write a quick Python script to check" into a two-second graph edit.

CategoryHugging Face πŸ€—

Inputs (2)

NameTypeDefaultDescription
datasetHUGGINGFACE_DATASETFully-loaded dataset whose distinct values to collect (from the πŸ€— Dataset Loader).
columnSTRINGColumn whose unique values to return.

Outputs (1)

NameTypeDescription
values*Data List of the distinct values found in the column.