Nodes/ComfyUI-Inference-Core-Nodes/[Inference.Core] Anime Face Segmentor
ComfyUI Node

[Inference.Core] Anime Face Segmentor

Per-part face segmentation, with background removal built in

By LykosAI·Created 2 years ago·Updated about a year ago· 33
[Inference.Core] Anime Face Segmentor
  • image
  • IMAGE
  • ABG_CHARACTER_MASK (MASK)
remove_background_using_abgtrue
resolution512

Semantic segmentation tells a model "here's exactly what goes where," pixel by pixel, without specifying appearance - sky here, building there, in this pack's case: skin here, hair there, eyes here. Anime Face Segmentor does that specifically for anime-style faces, giving you a colored region map you can feed to a segmentation ControlNet for tight control over an anime character's facial layout - useful when you want to lock composition (eye placement, hair silhouette, mouth position) while letting the prompt and checkpoint decide the actual style and coloring.

How it works

The node runs a semantic segmentation model trained specifically on anime facial features, assigning each pixel to a category (hair, skin, eyes, mouth, and similar anime-specific regions) and rendering that as a flat-colored map. It bundles a second, related capability: an anime-tuned background remover (the "ABG" option) that produces a clean character mask alongside the segmentation, in the same family as the isnet-anime models used elsewhere in anime background-removal tooling.

The inputs and outputs that matter

  • image - required, your source anime-style face or portrait.
  • remove_background_using_abg (default true) - when on, also runs the anime background remover and gives you a clean character mask as a second output. Turn it off if you only want the segmentation map and don't need background removal.
  • resolution - a quirk worth knowing: it's locked at 512 (min and max are both 512), so this isn't actually an adjustable setting despite looking like one in the UI. Don't spend time trying to change it.

Two outputs: IMAGE, the colored segmentation map for a segmentation ControlNet, and ABG_CHARACTER_MASK, a MASK output isolating the character from the background - handy on its own for compositing or cropping, independent of whatever you do with the segmentation map.

How to install it

ComfyUI Manager: search ComfyUI-Inference-Core-Nodes, install, restart. By hand:

cd ComfyUI/custom_nodes
git clone https://github.com/LykosAI/ComfyUI-Inference-Core-Nodes

then run install.py, or pip install -e .[cuda12] (or .[cuda] / .[rocm] / .[directml] / .[cpu]). Restart ComfyUI. The segmentation and background-removal models download from Hugging Face the first time you run the node.

Common issues & troubleshooting

If you're staring at the resolution slider wondering why changing it does nothing visible, that's not a bug - it's genuinely fixed at 512 in this node's schema, unlike every other preprocessor in the pack where it's adjustable. If you need a different working resolution, resize your source image before it hits this node instead.

This model is trained specifically on anime-style faces, so pointing it at a photorealistic or non-anime-stylized face will give you unreliable, often nonsensical segmentation - it's not a general face-parsing tool, it's an anime-specific one, and that specificity is the whole value proposition. Finally, remember the segmentation ControlNet you pair this with needs to actually be trained on this same category scheme; a generic segmentation ControlNet trained on real-world categories (sky, road, person) won't understand anime-face region labels correctly.

CategoryControlNet Preprocessors/Semantic Segmentation

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
remove_background_using_abgoptBOOLEANtrue
resolutionoptINT512512–512

Outputs (2)

NameTypeDescription
IMAGEIMAGE
ABG_CHARACTER_MASK (MASK)MASK