EmAySee Remove Duplicates From String
Dedupe a word list — and accept that it's going to sort itself
- unique_list_string
Comma-separated words in, deduplicated words out. This node splits your string, keeps only unique entries, and returns them as a fresh comma-separated string. It's the first version of the pack's dedup pair - and it comes with a quirk you need to know before you use it for anything order-sensitive.
How it works
- input_string (multiline, defaults to
apple, banana, apple, orange, banana, grape) - your word list. - Output unique_list_string - the deduped, comma-joined result.
The mechanism is a Python set. That's great for uniqueness and terrible for ordering: sets don't preserve insertion order, so the author sorts the result alphabetically to make it deterministic. banana, apple, banana doesn't come back as banana, apple - it comes back as apple, banana. Every time. Consistent, but your original ordering is gone.
The order problem, spelled out
For prompt tags this is usually fine - tag order barely matters to most CLIP encoders, and alphabetical is as good as anything. But if you were hoping to keep "the first tag I wrote stays first," this node can't do it. That's precisely the difference between the two dedup nodes in this pack:
- RemoveDuplicatesFromString (this one): dedupes via a set, then sorts alphabetically. Order is always lost.
- RemoveDuplicatesFromStringV2: preserves first-seen order by default, with a
sort_outputtoggle if you do want sorting.
If order matters, go straight to the V2. If you just want a tidy unique list, this one is fine - just don't fight it.
Other honest caveats
Case-sensitive: Apple and apple survive as two entries. And like the CSV sibling in this pack, it only understands commas as separators - newlines or spaces won't split.
Installing it
Part of ComfyUI_EmAySee_CustomNodes. ComfyUI Manager → search the pack title → Install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/EmAySee/ComfyUI_EmAySee_CustomNodes
# restart ComfyUI
Under EmAySee_Text, no dependencies. The display name in the menu is "EmAySee Remove Duplicates From String" - the V2 goes by the same title, which makes them easy to grab the wrong one. Check the widget count (V1 has one input, V2 has two).
Bottom line
It dedupes and it sorts, and it does both reliably. Need order kept? That's what the V2 is for - this one is the "I don't care about sequence" version.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| input_string | STRING | apple, banana, apple, orange, banana, grape | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| unique_list_string | STRING | — |