Gender Tag Filter π³οΈβπ
Your prompt expander keeps adding breasts. This node stops it.
- spacy_nlp
- filtered_tags
If you generate male or all-male scenes with a tag prompt, you know the drill: you type 1boy, muscular, ... and the output still shows up with breasts. The blame usually lands on the prompt expander in the middle of your chain. Tools like TIPO are trained on giant tag datasets that skew hard toward female anatomy, so when you hand them a male scene they quietly feminise it - adding anatomy tags you never asked for. Telling the image model to fix it in the negative prompt doesn't really work either, because breasts is a token that grabs the model's attention even when it appears negated. The tag simply shouldn't be there at all.
Gender Tag Filter is the node that takes it out before CLIP ever sees it. It sits between your prompt expander and your CLIPTextEncodeSDXL, eats a tag string, and strips or rewrites every gendered token that doesn't match your scene. It's the flagship of the comfyui-gender-tag-filter pack, and it's the most thorough thing of its kind I've found: the author ships 145 female anatomy tags, 118 male anatomy tags, 152 female presentation tags, and 112 clothing-swap pairs in one shared data file.
How it works
Drop it in and the defaults already do the sensible thing. mode defaults to strip_female_tags; switch to strip_male_tags for the mirror image, format_only if you just want tag formatting with zero filtering, or off for a passthrough. The anatomy list is the star here - it doesn't just match exact tags, it scans compound tags for root words, so huge_breasts, breast_grab, and hanging_breasts all get caught even though nobody individually listed them.
The inputs you'll actually touch, in rough order of importance:
filter_anatomy(on by default) - the core removal pass.replace_anatomy(off by default) - swaps instead of deletes:large_breastsβmuscular_chest,1girlβ1boy,yuriβyaoi,cameltoeβbulge. Turning this on is usually the difference between "clean" and "actively useful."filter_presentation(off by default) - handles clothing, accessories, and makeup. Keep it off unless you want a crossdressing character; that's the one switch that stops the node from "helpfully" deleting a skirt.swap_clothing(on when presentation is on) -skirtβtrousers,bikiniβswim_trunks,braβ removed (no clean equivalent).use_underscores(on) - outputsbig_breastsfor Danbooru/e621-style models. Some fine-tunes want spaces; flip it.map_neopronounsandrewrite_references(both on) -shi/hirβ binary equivalents,womanβman,vixenβfox,doeβbuck.
Two things are worth knowing about how it parses. It's fully A1111/Forge emphasis-aware: (tag:1.3), ((tag)), and [tag] are parsed, filtered, and re-wrapped with their original weights intact. And it passes LoRA, hypernetwork, and BREAK syntax through untouched, so nothing breaks. One honest caveat: if your tag string has natural-language fragments mixed in (TIPO does this), this node detects them and passes them through for the NL filter to handle - it's not the node for rewriting prose.
Wiring it up
Both inputs and outputs are plain STRING, so it chains with no adapters:
TIPO β DanbooruTagSnakeCaseFixer β StringConcatenate β [Dedupe Tags]
β [Gender Tag Filter] β [Gender NL Filter] β CLIPTextEncodeSDXL
The single output, filtered_tags, feeds either the NL filter or straight into your CLIP encode. Wire a SpaCy Model Loader into the optional spacy_nlp input if you want spaCy-backed detection of those NL fragments; leave it disconnected and it uses a stop-word heuristic fallback that's fine for most tag lists.
Installing and gotchas
Install the whole pack via ComfyUI Manager (search "Gender Tag Filter") or:
cd ComfyUI/custom_nodes
git clone https://github.com/senjinthedragon/comfyui-gender-tag-filter
Then restart ComfyUI - the node lives under utils/tags. spaCy is optional but recommended; the real trap is Python 3.13/3.14, which spaCy can't build on, so it'll silently run in reduced mode. If a tag still slips through, the blocklists in gender_shared.py are plain Python sets - extend them and restart. That's the whole maintenance story, and it's a good one.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | Tag string to filter. NL fragments are detected and preserved automatically. | |
| mode | COMBO | strip_female_tags | 'strip_female_tags' -> remove female anatomy/presentation tags 'strip_male_tags' -> remove male anatomy/presentation tags 'format_only' -> no filtering; apply use_underscores only 'off' -> pass through completely unchanged |
| filter_anatomy | BOOLEAN | true | Remove explicit anatomical tags for the unwanted gender. Also scans compound tags for anatomy root words, so huge_breasts, breast_grab, hanging_breasts etc. are all caught even if not individually listed. |
| replace_anatomy | BOOLEAN | false | Replace removed anatomy tags with gender-appropriate counterparts instead of just deleting them. e.g. large_breasts -> muscular_chest, breasts -> pecs 1girl -> 1boy, yuri -> yaoi, cameltoe -> bulge Has no effect when filter_anatomy is off. |
| filter_presentation | BOOLEAN | false | Remove gendered clothing, accessory, and makeup tags. Disable for crossdressing characters. |
| swap_clothing | BOOLEAN | true | When filter_presentation is on, replace clothing tags with gender-appropriate equivalents instead of just removing. e.g. skirt -> trousers, bikini -> swim_trunks, evening_gown -> tuxedo, bra -> removed (no equivalent) Has no effect when filter_presentation is off. |
| use_underscores | BOOLEAN | true | Output word separator style. On -> big_breasts (Danbooru/e621, most SDXL models) Off -> big breasts (some fine-tuned models) Input tags are always accepted in either style. Natural language fragments bypass this setting entirely. |
| rewrite_references | BOOLEAN | true | Swap standalone gendered noun tags. woman -> man, girl -> boy, vixen -> fox, doe -> buck etc. Covers the same word set as the NL Filter's rewrite_references for consistent behaviour across both nodes. |
| map_neopronouns | BOOLEAN | true | Map neopronoun tags to binary equivalents that image models are likely to recognise from their training data. Covers: shi/hir (Chakat/furry), they/them, xe/xem, ze/zir, ey/em (Spivak), fae/faer, ve/ver, per. When off, neopronoun tags pass through unchanged. |
| handle_negations | BOOLEAN | true | Protect tags that appear in a negated context from removal. e.g. in a mixed prompt, 'no breasts' will leave the tag untouched rather than removing it. Uses a 4-token proximity heuristic. |
| spacy_nlpopt | SPACY_NLP | Connect a SpaCy Model Loader node to enable spaCy-backed NL fragment detection. Leave disconnected to use the stop-word heuristic fallback instead. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| filtered_tags | STRING | β |