Anima 标签仲裁器(防覆盖)
Anima Tag Arbiter
- source_1
- source_2
- source_3
- source_4
- text
- wardrobe
Here's the problem this node exists for. A STRING wire in ComfyUI carries characters and nothing else. When three different nodes each add something to your prompt, the last one in the chain has no way to know that black leotard was the outfit you deliberately picked and red dress is the one an upstream pack added by accident. Both arrive as text; both go into CLIP. You get either a silent overwrite, or the opposite failure - some pack locks everything and swapping characters no longer changes the hair colour.
The arbiter is the fix. Wire up to four sources into it, put it at the end of your prompt chain, and let it decide who wins.
The mechanism, which is the interesting part
Every token gets classified into a slot: artist, count, character, appearance, relation, clothing, pose, expression, scene, free. The classification comes from a dictionary of roughly 2,700 tags indexed out of the pack's own preset libraries, plus patterns for count words (2girls, solo) and appearance words (long white hair, orange eyes, and a long alternation of body/face traits), plus a rule that anything starting with @ is an artist tag. That's the same slot vocabulary Danbooru-trained models already think in - clothing and pose are general tags, the character name and its series are their own categories.
Then the arbitration runs over claims, and a claim carries slot, tags, tier, force, seq, source. Four rules, applied in order:
- force wins - that's the explicit override switch on the Studio node.
- Then tier:
locked>explicit>derived>default. Structured claims come in as plugin-level (explicit) and plain text as body-level (default), so a claim beats loose prose from any pack. - Then, within a tier: sticky slots (artist, clothing, pose, expression, scene) go to the lowest
seq- first writer locks the slot, later arrivals only get registered. Replaceable slots (count, character, appearance, relation, free) go to the highestseq, so changing the character recalculates everything that follows from it. - Losers aren't deleted, they're marked
shadowed- which is exactly what you see in the report when you ask "why didn't my change take effect".
strict_shadow decides whether shadowed tags really get dropped (on, the default) or whether each slot keeps one fallback. order_mode defaults to normalize here - a deliberate difference from the other nodes in the pack, which default to preserve. Normalize reorders the output by slot order, which is the sane choice when you're consolidating four sources; preserve keeps your original word order and just deletes the tokens that lost.
Inputs and outputs
source_1 through source_4 are wildcard (*) sockets, which is how one input accepts both a structured ANIMA_WARDROBE declaration and a bare string from some unrelated pack. Unwired ones simply arrive as nothing. That's engine behaviour, not magic - the plumbing layer docs cover it, and it's why this shape works at all.
Two outputs: text, which goes to your CLIP text encode, and wardrobe, the merged declaration, which you can chain into another arbiter or hand to a downstream Studio/Roll node. The arbitration report renders in the node's own UI panel.
Install
Same as the rest of the pack, no dependencies:
cd ComfyUI/custom_nodes
git clone https://github.com/lingdongbudong/Comfyui-Anima-Wardrobe
# restart ComfyUI (new packs never appear without one)
Manager users: search Anima-Wardrobe, install, restart.
Where it bites
It can only protect what it can classify. Only the four sticky slots are indexed in the dictionary, so a character name in plain text lands in free - replaceable, never defended. appearance and artist come from patterns, not the dictionary. If you want fine-grained protection on character identity, you need a structured claim (this pack's, or another pack that implements the protocol), not just a string.
First writer wins cuts both ways. If an upstream pack declares clothing before yours at the same tier, the arbiter will faithfully keep the upstream one and shadow yours. That's the contract working as designed; the escape hatch is override on the Studio node's policy widgets, which promotes your claim to force, or protect on the appearance slot to lock upstream traits.
Four sources per node. Chain two arbiters if you have more, and give the second one a fresh seq window - don't expect it to read minds across a bypassed link.
Fair warning: this pack has almost no Reddit footprint (searching the phrase "anima wardrobe" across r/comfyui, r/StableDiffusion and r/civitai returns nothing at all), so there's no crowd-sourced troubleshooting to lean on. But the protocol is documented in docs/COORDINATION.md inside the repo, and the arbiter class itself is about sixty lines of readable Python in nodes.py. When a tag disappears, the report tells you which source won and which got shadowed, and that's usually the whole answer.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| order_mode | COMBO | normalize | 2 options: normalize, preserve |
| strict_shadow | BOOLEAN | true | — |
| source_1opt | * | — | |
| source_2opt | * | — | |
| source_3opt | * | — | |
| source_4opt | * | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| wardrobe | ANIMA_WARDROBE | — |