Nodes/comfyui-watdafox-nodes/Unique Text (watdafox)
ComfyUI Node

Unique Text (watdafox)

Paste your prompt list, get the unique tags in one hand and the duplicates in the other

By postosh·Created 9 months ago·Updated 8 months ago· 0
Unique Text (watdafox)
    • unique_text
    • duplicate_text
    text

    You paste in a comma-separated blob of tags or prompts, and Unique Text hands you back two strings: the items that appeared only once, and the items that appeared more than once. It's a dedupe node with a forensic streak - it doesn't just clean your list, it tells you what was dirty.

    That second output is the sleeper. If you're assembling prompt batches, cleaning tag lists scraped from somewhere, or merging prompts from several sources, you usually care about the deduped result. But knowing which tags repeated is surprisingly useful when the duplicates are the problem: your seed prompt got its trigger tags pasted in twice, or a wildcard list has a tag that's making the sampler over-emphasize it. duplicate_text surfaces exactly that.

    How it works

    Straightforward string logic, and the corner cases are where it shows its personality. It splits on commas, then for each item: if it contains BREAK it's always treated as unique and passed through untouched (that's deliberate - BREAK is ComfyUI's line-break token for prompt structure, and you don't want the dedupe logic collapsing your prompt layout). Whitespace-only items are also preserved in the unique output, again so structure doesn't vanish. Everything else is deduped by stripped text, first occurrence wins in unique_text, repeats accumulate in duplicate_text. Both outputs are comma-joined strings.

    The inputs and outputs

    • text - multiline STRING. Paste your comma-separated list here.
    • unique_text - the deduped, comma-joined string.
    • duplicate_text - everything that repeated, comma-joined.

    Both are plain STRING, so they'll flow into any text node, a prompt encoder, or a wildcard-aware loader. Category: watdafox/string.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/OhSeongHyeon/comfyui-watdafox-nodes.git
    

    Restart ComfyUI, or install via ComfyUI Manager ("comfyui-watdafox-nodes"). No dependencies beyond what ComfyUI ships, no model downloads.

    When to use the advanced sibling instead

    This is the no-options version. If you need whitespace collapsing (so cat , cat and cat count as the same thing) or underscore normalization (so red_eyes and red eyes dedupe together), grab Unique Text Advanced from the same pack - it has remove_whitespaces and remove_underscore toggles for exactly those cases. Also note the matching is case-sensitive here; Cat and cat are treated as distinct. If your lists are messy, the Advanced node is usually the better first stop.

    Categorywatdafox/string

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING

    Outputs (2)

    NameTypeDescription
    unique_textSTRING
    duplicate_textSTRING