Nodes/ComfyUI Gender Tag Filter/Gender NL Filter πŸ³οΈβ€πŸŒˆ
ComfyUI Node

Gender NL Filter πŸ³οΈβ€πŸŒˆ

The node that fixes female-biased prose prompts without mangling your grammar

By senjinthedragonΒ·Created 6 months agoΒ·Updated 5 months agoΒ· 0
Gender NL Filter πŸ³οΈβ€πŸŒˆ
  • spacy_nlp
  • filtered_text
β—„textβ–Ί
β—„modestrip_female_languageβ–Ί
β—„filter_anatomytrueβ–Ί
β—„replace_anatomytrueβ–Ί
β—„filter_presentationtrueβ–Ί
β—„swap_clothingtrueβ–Ί
β—„handle_pronounstrueβ–Ί
β—„rewrite_referencestrueβ–Ί
β—„map_neopronounstrueβ–Ί
β—„handle_negationstrueβ–Ί

Tag filters have a blind spot: a lot of people don't prompt in Danbooru tags at all. If you're writing natural language prompts, pasting in a SillyTavern character card, or running a chain where your tag expander sprinkles prose into the mix, the whole "remove breasts" approach falls apart - the word breasts never appears, but the text still says "she sat down, her dress riding up." Gender NL Filter is the sibling node that handles exactly that. It reads sentences, finds the gendered vocabulary, and rewrites it into the opposite gender's vocabulary while leaving the actual sentence structure alone.

It's the second stage in the pack's recommended chain (Gender Tag Filter cleans the tags, then this cleans the prose), but it works standalone too - feed it a plain prompt, a tag list, or a mess of both, and it sorts out what's what.

What it actually rewrites

The headline party trick is pronoun handling. handle_pronouns swaps she/her/hers/herself ↔ he/him/his/himself, and when spaCy is connected it gets the her case right: possessive her becomes his, object her becomes him. That's the sort of detail that separates this from a sloppy find-and-replace. Alongside that:

  • replace_anatomy (on) - cross-gender pairs: Her breasts bounced β†’ His pecs bounced, pussy ↔ cock, vagina ↔ penis. Words without a clean match still get removed.
  • rewrite_references (on) - woman/girl/lady ↔ man/boy/guy, plus the furry set: vixen/doe/mare/tigress and their male counterparts.
  • swap_clothing (on) - dress β†’ suit, skirt β†’ trousers, bra β†’ removed. Turn off filter_presentation entirely for crossdressing characters so clothing stays put while anatomy still gets corrected.
  • map_neopronouns (on) - shi/hir, xe/xem, ze/zir, ey/em, fae/faer get mapped to binary equivalents the image model actually recognises. If your character is furry-flavoured, this is the setting you care about.
  • handle_negations (on) - the safety net. no breasts and without a vagina stay untouched, because a rewrite here would do the exact opposite of what you asked.

The mode dropdown flips the whole thing between strip_female_language (default), strip_male_language, and off. Output is a single filtered_text STRING that wires straight into your CLIP encode, or into the next node in the chain.

Why spaCy matters here

This is the one node in the pack where the optional backend genuinely changes the results. The filter ships with 128 female→male and 118 male→female word swaps, but without spaCy it's running on a regex fallback that gets the easy cases and fumbles the hard ones. Plural they/them gets remapped to he even when it shouldn't; negation detection falls back to a 4-token proximity scan that misses longer sentence structures. With a spaCy model connected to the spacy_nlp input, you get dependency parsing for negations, proper plural they/them preservation, and multi-word span matching.

So install it:

pip install spacy
python -m spacy download en_core_web_sm

One warning: spaCy still doesn't build on Python 3.13/3.14 (pydantic v1 and blis break), so if your ComfyUI venv is on those, the node quietly drops to regex mode and logs it in the console. If NL accuracy is the whole point for you, recreate the venv under Python 3.12 - the README has the exact commands. On the flip side, the regex fallback means this node is genuinely usable out of the box, which is more than most "NLP-powered" ComfyUI nodes can claim.

Installing

It's all one pack - install via ComfyUI Manager (search "Gender Tag Filter") or git clone https://github.com/senjinthedragon/comfyui-gender-tag-filter into custom_nodes, then restart. You'll find it under utils/tags. Chain it after Gender Tag Filter for mixed tag+prose prompts, or use it solo for character-card-driven workflows where your whole prompt is prose.

Categoryutils/tags

Inputs (11)

NameTypeDefaultDescription
textSTRINGNatural language prompt, tag list, or mixed content. Chain after GenderTagFilter for full tag+NL coverage. Standalone tags are detected and skipped automatically.
modeCOMBOstrip_female_language'strip_female_language' -> rewrite female-coded vocabulary 'strip_male_language' -> rewrite male-coded vocabulary 'off' -> pass through unchanged
filter_anatomyBOOLEANtrueProcess anatomy words at all. Turn off to leave all anatomy language completely untouched.
replace_anatomyBOOLEANtrueReplace anatomy words with gender-appropriate counterparts rather than removing them entirely. e.g. 'Her breasts bounced' -> 'His pecs bounced' 'His cock throbbed' -> 'Her pussy throbbed' Words with no clean equivalent are still removed. Has no effect when filter_anatomy is off.
filter_presentationBOOLEANtrueProcess clothing and accessory language at all. Turn off to leave all clothing language completely untouched. Useful for crossdressing characters.
swap_clothingBOOLEANtrueReplace clothing terms with gender-appropriate equivalents rather than removing them. e.g. dress -> suit, skirt -> trousers, bra -> removed, bikini -> swim trunks Has no effect when filter_presentation is off.
handle_pronounsBOOLEANtrueSwap binary gendered pronouns. she/her/hers/herself <-> he/him/his/himself spaCy correctly disambiguates 'her' between possessive (-> his) and object (-> him).
rewrite_referencesBOOLEANtrueSwap gendered nouns and adjectives. woman/girl/lady/feminine <-> man/boy/guy/masculine Also covers furry terms: vixen/doe/mare/tigress etc. Plus titles, family terms, and mythological figures.
map_neopronounsBOOLEANtrueMap neopronouns to binary equivalents image models recognise. Covers: shi/hir (Chakat/furry), they/them, xe/xem, ze/zir, ey/em (Spivak), fae/faer, ve/ver, per. Plural they/them preserved by spaCy (regex is approximate). When off, all neopronouns pass through unchanged.
handle_negationsBOOLEANtrueProtect negated anatomy terms from removal or replacement. e.g. 'no breasts' and 'without a vagina' are left untouched. spaCy uses dependency parsing; regex uses 4-token heuristic.
spacy_nlpoptSPACY_NLPConnect a SpaCy Model Loader node to enable spaCy-backed NLP processing with accurate negation detection, pronoun disambiguation, and multi-word span matching. Leave disconnected to use the regex fallback instead.

Outputs (1)

NameTypeDescription
filtered_textSTRINGβ€”