重复检查
The node that counts tags you pasted twice
- 提示词
- 重复项
The problem it's solving
Nothing in ComfyUI complains about a repeated tag. Paste a prompt from a gallery, tack on four tags you liked from another one, and 1girl is now in there twice, long hair twice, looking at viewer three times. The sampler doesn't error, the image still looks like an image, and you have no idea you did it.
That matters because attention isn't free. Every duplicate is a slice of the prompt's budget spent saying the same thing again instead of saying something new - the "prompt soup" failure mode where each keyword dilutes the others. It's worst on tag-based models, where the prompt is a list and duplicates are invisible by construction. And it's worst of all on something like Anima, whose whole pitch is that it obeys you more literally than the SDXL anime models did: strong adherence means your sloppy prompt gets faithfully executed rather than quietly ignored.
重复检查 (Duplicate Check in the English UI) is a small lint node from the Bilingual Prompt Inspector pack that counts those repeats for you, tints the node amber when it finds any, and - if you want - strips the extras. It touches no pixels. It's plumbing, in the same family as the primitive and text nodes, just with an opinion.
How it decides what counts as a duplicate
Everything is split on top-level commas and newlines. Delimiters inside (...), [...], {...}, <...> and escapes are protected, so a weighted group or a <lora:...> isn't chopped in the wrong place.
Then each segment is boiled down to a comparison key:
(tag:1.3)weights are stripped, so(long hair:1.3)collides with a barelong hair.((emphasis))brackets are peeled off the same way.- Lowercased, whitespace collapsed, and underscores treated as spaces.
That last one is the useful bit. long_hair and long hair are the same tag to this node, and so are Long Hair and long hair. Those are exactly the duplicates you'd never spot by eye, and they're the ones the community keeps telling people to fix anyway - underscores are a Danbooru affectation that most models read worse than plain spaces.
Two things are deliberately exempt: pure syntax segments like <lora:...>, and the operators BREAK and AND. Repeat BREAK as much as you like; it won't be flagged. Same rules run in the frontend and the backend, so the count on the node and the count after execution agree.
Inputs, outputs, and what to wire where
The only required input is text (shown as 提示词). Heads up: it's a forced input, not a widget - there's no text box to type into. You have to feed it a STRING from something upstream: the sibling Prompt Translator & Manager node's 英文提示词 output, a Primitive String, whatever text node you already have. If you don't own one, the pill on the node just reads "Waiting for prompt" and nothing happens.
The optional keep_first toggle (labeled 只保留第一个) is the only knob:
- Off (default) - the 提示词 output is your text, byte for byte. Not trimmed, not reformatted, not touched at all. The node is a pure diagnostic.
- On - only the first occurrence of each duplicated tag survives, and the rest are removed in place. The surviving segments get re-joined using the original separators, so
standing, sittingdoesn't turn intostanding,sitting, and blank lines between prompt blocks stay blank. It doesn't rewrite your formatting.
The second output, 重复项, is a plain newline-joined report - long hair ×2, 1girl ×3 - and an empty string when you're clean. Wire it into any text preview node to read it. (It's also what fills the tooltip on the amber pill.)
On the canvas you get a status pill plus a translucent amber node background whenever the node is connected and found something. The check runs live as you edit the upstream text, debounced a quarter second - you don't have to queue a prompt to see the count. With the new Nodes 2.0 frontend enabled, that live path doesn't run, so the count falls back to updating when you reconnect or when a run finishes.
Installing it
Same repo as the big bilingual node, so one install gets you both under text/prompt.
cd ComfyUI/custom_nodes
git clone --depth 1 https://github.com/mengshengzhijie/ComfyUI-Bilingual-Prompt-Inspector.git
Or search Bilingual Prompt Inspector in ComfyUI Manager, or comfy node install prompt-translator-manager from comfy-cli. No pip dependencies (the project's dependency list is empty) and no models to download, though it wants ComfyUI ≥ 0.3.40 and Python ≥ 3.10. Restart ComfyUI, then Ctrl+F5 the browser tab - the pack ships frontend JS, and ComfyUI's cache will happily keep serving you the old frontend after an upgrade.
Coming from the original Qiongyi44/ComfyUI-Bilingual-Prompt-Inspector? Overwrite the directory in place; your personal dictionary and settings survive.
Where people get tripped up
You can't type into it. By far the most common confusion. There's no widget to convert either, so if you want a scratchpad, drop a Primitive String upstream and wire that in.
"Keep first is on and my output didn't change." That means no duplicates were found in the text this node received. Check that the upstream node's text is what you think it is.
Your duplicates aren't the kind it counts. Two identical <lora:weight> entries, repeated BREAKs, or the same word repeated inside one segment (very very detailed) all pass clean, on purpose. It's a tag-level checker, not a text de-duplicator.
It doesn't edit your prompt. This is a pass-through on a wire. Deduping here doesn't change the text in the node you actually typed into - the cleaned output has to go downstream into your text encoder, which means you either route 提示词 into the encoder instead of the original text, or use it as a QA tap and go fix the source yourself. Honestly, for most people the QA-tap setup is the right one: duplicates are a symptom of sloppy authoring, and a node silently deleting tags you can't see is how you end up with a workflow whose output doesn't match its prompt.
Failure is quiet by design. If the live check request fails, the node keeps its last state rather than flashing "No duplicates" at you - so a stale amber tint is a "the check didn't run", not a "you're fine". When in doubt, queue a prompt and read the 重复项 output.
Set your expectations on the pack itself: it's a solo project with a small user base, so there's no wall of forum threads behind it. But this is a two-input node with no dependencies and no network calls, so the blast radius is small.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| keep_firstopt | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| 提示词 | STRING | — |
| 重复项 | STRING | — |