EmAySee Remove Duplicates From StringV2
The dedup node that actually respects your order
- unique_list_string
The fixed version of the pack's dedup node. Where the V1 silently sorts your deduped list alphabetically, this one keeps your original order by default and only sorts if you ask it to. If you're deduping prompt tags and want the first term to stay first - which matters more than people think for CLIP-weighted prompts - this is the one to reach for.
How it works
- input_string (multiline, same default as V1:
apple, banana, apple, orange, banana, grape) - your word list. - sort_output (default true) - here's the trap. The toggle defaults to sorting, so out of the box it behaves exactly like V1: alphabetical. Flip it off and you get true first-seen order preservation.
- Output unique_list_string - the deduped, comma-joined result.
The order-preserving trick is dict.fromkeys(), which dedupes while keeping insertion order. Clean, deterministic, and exactly what "keep my sequence" means.
The default toggle will get you
The author shipped sort_output defaulting to true, so unless you uncheck it, this node is indistinguishable from the V1. Most people grab the V2 precisely for order preservation, then never touch the toggle, and quietly get alphabetical output anyway. Uncheck it once, save the workflow, done. (This is also the tell for telling the two apart in the menu: V1 has one input, V2 has the sort toggle.)
Same caveats as the family
Case-sensitive - Apple and apple stay distinct. Comma-only splitting - newlines or spaces won't split your list. But if your input is a well-formed comma list, that's all you need.
Where it fits
Stick it after a tag generator or LLM captioner that loves repeating itself, before the CLIP encode, and your prompt keeps its intended emphasis order instead of alphabetizing into a mush. It's the "right" choice over the V1 for anything where ordering carries meaning.
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.
Bottom line
Same job as V1, with the order question actually answered: flip sort_output off and your sequence survives. It's the version you want for real prompt work.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| input_string | STRING | apple, banana, apple, orange, banana, grape | — |
| sort_output | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| unique_list_string | STRING | — |