EmAySee Remove Duplicate CSV
Dedupe a comma-separated string without touching a spreadsheet
- unique_csv_string
If you've ever had a prompt or tag string full of doubled-up entries - red hair, blue eyes, red hair, portrait - you know the cleanup chore. This node takes a comma-separated string, keeps the first occurrence of each entry, and returns a cleaned string with duplicates gone. Despite the "CSV" in the name, it never touches a file: it's a pure string-in, string-out text utility.
How it works
One input, csv_string (multiline), one output, unique_csv_string. It splits on commas, strips whitespace around each entry, and dedupes while preserving the order things first appeared. a, b, a, c becomes a, b, c. Order matters here - this node keeps first-seen order, which is usually what you want for prompt tags where the leading terms carry the most weight.
The two gotchas that will actually bite
Whitespace-sensitivity. red hair and red hair (double space) are different entries after stripping, and red,blue vs red, blue both parse, but the input is assumed to be a clean comma list. If your string uses other separators (semicolons, newlines, spaces), the node won't split them - you'll get one giant "unique" entry and wonder why nothing happened.
Case-sensitivity. Red and red are treated as different. For booru-style tag cleanup where case is already normalized, that's fine. For free-text dedup it means you may still see near-duplicates.
There's also the failure fallback: if anything throws while processing, it returns the original string unchanged and prints an error, rather than crashing your graph.
Where it fits
This is the classic "clean your generated tags" step. Put it after a captioning or tag-generating node (LLM outputs love to repeat tags) and before a wildcard/CLIP encode, and your prompts get leaner without any manual editing. It also pairs with the pack's RemoveDuplicatesFromString siblings - this one is the order-preserving "CSV" variant; those two are the sort-oriented text ones.
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_Utils, no dependencies - it's just Python string handling with a set for dedup.
Bottom line
A small, honest text utility that does exactly one job well: kill duplicates in a comma-separated string while keeping your order. Feed it clean input and it never surprises you.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| csv_string | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| unique_csv_string | STRING | — |