Nodes/ComfyUI Gender Tag Filter/SpaCy Model Loader πŸ”¬
ComfyUI Node

SpaCy Model Loader πŸ”¬

The tiny node that decides whether your gender filter is running on brains or on duct tape

By senjinthedragonΒ·Created 6 months agoΒ·Updated 5 months agoΒ· 0
SpaCy Model Loader πŸ”¬
    • spacy_nlp
    β—„modelβ–Ύβ–Ί

    SpaCy Model Loader is the most honest node in the comfyui-gender-tag-filter pack, in a good way. It's not a filter - it's a backend. It loads a spaCy language model and hands it to the two filter nodes so they can actually understand your text instead of pattern-matching it. What makes it worth having in your graph is that it makes the backend decision visible: if the loader is wired in, you're getting spaCy accuracy; if it isn't, the filters are running on their built-in regex/heuristic fallback. No guessing from console logs, no "did it work?" - it's right there in front of you.

    Why you'd bother

    The two filters work without it, and the author is upfront about that. But for Gender NL Filter specifically, spaCy is the difference between "mostly right" and "actually right." With the regex fallback, plural they/them gets remapped when it shouldn't, and her can't be told apart as possessive vs. object. With spaCy running dependency parsing, negations like no breasts survive, plural they/them is preserved, and multi-word phrases match properly. Gender Tag Filter also benefits: spaCy makes its detection of natural-language fragments mixed into TIPO tag output more accurate than the stop-word heuristic it falls back to.

    How it works

    Drop the node in and the model dropdown is already populated with every spaCy model installed in your current Python environment - the node reads spacy.util.get_installed_models() at startup, so there's no folder management and no manual paths. If nothing's installed, the dropdown shows (no spaCy models installed) and the node raises a clear error with the exact fix, rather than failing silently. That's a small thing and it's the right design.

    The single output, spacy_nlp, is a custom SPACY_NLP type that only plugs into the spacy_nlp inputs on GenderTagFilter and GenderNLFilter - the ComfyUI type system enforces it, so you can't wire it somewhere meaningless. One loader can feed both filters if you chain them.

    Installing the model

    The loader node itself comes with the pack (Manager, search "Gender Tag Filter", or git clone https://github.com/senjinthedragon/comfyui-gender-tag-filter into custom_nodes). The model is the separate step, and it's tiny:

    pip install spacy
    python -m spacy download en_core_web_sm
    

    Then restart ComfyUI so the dropdown refreshes. On the Windows portable build, use python_embeded\python.exe for both commands. Model sizes if you want to upgrade: en_core_web_sm is ~12MB and fine for prompt-length text, md ~43MB for better word vectors, lg ~560MB for longer character descriptions. The README's comparison lands well: your checkpoint is six gigabytes, the model is twelve megabytes - install spaCy.

    The gotcha

    Python version. spaCy doesn't support 3.13 or 3.14 yet - pydantic v1 and blis won't build - so if your ComfyUI venv is on a modern Python, pip install spacy fails with a wall of build errors and the whole loader is dead weight. The filters still run on their fallback, so you're not blocked, but you're not getting the accuracy either. Fix it once by recreating the venv under Python 3.12 (python3.12 -m venv venv), and this node quietly becomes the most under-appreciated part of the pack. Worth the one-time setup if gender-correct prose is the point of your workflow.

    Categoryutils/tags

    Inputs (1)

    NameTypeDefaultDescription
    modelCOMBOspaCy model to load. Lists all models installed in the current Python environment. Install a model with: python -m spacy download en_core_web_sm Then restart ComfyUI. Common models: en_core_web_sm ~12 MB - recommended for most cases en_core_web_md ~43 MB - better word vectors en_core_web_lg ~560 MB - best statistical accuracy en_core_web_trf ~400 MB - transformer-based, highest accuracy (requires: pip install spacy-transformers)

    Outputs (1)

    NameTypeDescription
    spacy_nlpSPACY_NLPβ€”