ListUnique (Yogurt Nodes)
Dedupe a list without scrambling the order
- list_data
- unique_list
Lists arrive dirty. Tag lists have duplicates, file lists from globs repeat, prompt batches accumulate the same entry twice - and most of the time you don't want the duplicates, but you do want the original order preserved. YogurtListUnique does exactly that: removes duplicate elements while keeping first-seen order. If you've ever used dict.fromkeys() in Python, that's the whole trick, packaged as a node.
It's part of ComfyUI-YogurtNodes, yogurt7771's 150+ node all-in-one pack. This one's genuinely obscure - no forum chatter, auto-generated README, MIT license - and its logic section is basically a remix of standard library one-liners. That sounds like faint praise until you need to dedupe a list mid-graph and realize core ComfyUI has no button for it.
How it works
One input, one output. list_data accepts any list-like object (typed *), and unique_list comes back with duplicates removed, every element appearing at its first position in the original. The stability is the point - a naive "convert to a set" would dedupe and scramble, which breaks anything where order carries meaning, like prompt sequences or frame lists.
Where you'll use it
- Cleaning a tag or prompt-token list before you join it back into a prompt.
- Deduping a glob of filenames so you don't process the same file twice.
- Removing duplicate seeds or model names from a batch you generated programmatically.
- Sanitizing list output from an LLM or API node before feeding it downstream.
The practical caveat is hashing. Strings and numbers dedupe cleanly and predictably. For complex objects, Python's equality and hash semantics apply, so keep this node pointed at scalar lists - if your elements are rich objects, dedupe on their string form first with YogurtListJoin-style stringification or just handle it upstream.
There's a natural pairing worth mentioning: run YogurtListUnique after YogurtListSlice or before YogurtListJoin in the same workflow, and you get a tidy pipeline of "slice → clean → join" that covers a surprising share of list chores.
Install
ComfyUI Manager, search ComfyUI-YogurtNodes, install, restart. Or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes
cd ComfyUI-YogurtNodes
pip install -r requirements.txt
Restart and it's under "Yogurt Nodes". No models, no heavy deps - the list nodes in this pack are plain Python and behave exactly like the functions they wrap.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| list_data | * | Any list-like object |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| unique_list | * | — |