Nodes/ComfyUI-huggingface_dataset/πŸ€— Dataset To LIST
ComfyUI Node

πŸ€— Dataset To LIST

Turn a dataset into one flat Python LIST that every Basic node can eat

By StableLlamaΒ·Created a day agoΒ·Updated a day agoΒ· 1
πŸ€— Dataset To LIST
  • dataset
  • list
β—„columnβ–Ί
β—„limit-1β–Ί

The πŸ€— dataset nodes talk to each other in an opaque HUGGINGFACE_DATASET type. The rest of ComfyUI - and especially the generic list/dict/string nodes of the Basic data handling pack - doesn't speak that language. πŸ€— Dataset To LIST is the translator: it materializes your dataset into one plain Python list, which is the exact shape Basic's LIST β†’ length, LIST β†’ get item, and friends expect.

How it works

Three inputs, one output:

  • dataset - anything the pack produced: the loader's dataset output or the result of a whole transform chain.
  • column - leave it empty and each list item is a whole row dict; set it (e.g. text) and each item is that column's value. The "one column out as a list" mode is the one you'll use constantly - it's how you feed a corpus of review texts or prompts into string nodes.
  • limit - cap how many rows get materialized (-1 = all). On a streaming dataset this is your download brake: To LIST (column=text, limit=100) pulls exactly 100 values off the lazy stream.

The output list is a LIST in the Basic-data-handling sense: one Python list value, delivered whole. That distinction matters because the pack ships two converters for two shapes - To LIST for whole-list nodes (length, get item, first, join), and πŸ€— Dataset To Data List for per-row processing where Basic runs a node once per item. Pick based on what you're wiring into: flat operations want the LIST, row-wise transforms want the Data List.

A recipe that shows the point

Load (path=stanfordnlp/imdb) β†’ πŸ€— Dataset To LIST (column=text, limit=100) β†’ Basic/LIST β†’ length

That's "how many review texts do I actually have" in three nodes, no Python. Add a Filter before the converter and you're counting only the rows that passed the condition.

Gotchas

Materializing is the moment the graph stops being lazy - with limit = -1 on a non-streaming load you're already paying for the full download, and To LIST then builds the whole Python list in memory. For big data, set limit or put a Take first. Also keep column spelling exact: a typo means a missing-key error on the first row rather than a friendly warning. And be aware row values become plain Python - numpy scalars are converted, but image/audio objects pass through as-is, so a "list of images" is only useful to nodes that handle that type.

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 Basic data handling pack is a separate install but well worth it - these converters are built around its list types.

CategoryHugging Face πŸ€—

Inputs (3)

NameTypeDefaultDescription
datasetHUGGINGFACE_DATASETDataset to materialize (from the πŸ€— Dataset Loader or another dataset node).
columnSTRINGWhen set, each list item is that column's value instead of a whole row dict.
limitINT-1-1–2147483647Max rows to materialize; -1 = all.

Outputs (1)

NameTypeDescription
listLISTOne Python list of all rows (or of a column's values), as a Basic-data-handling LIST.