ComfyUI Node Runs on cloud

Anime Face Segmentor

Region maps for anime faces, plus a free character mask

By Fannovel16·Created 3 years ago·Updated 4 months ago· 4,134
Anime Face Segmentor
  • image
  • IMAGE
  • ABG_CHARACTER_MASK (MASK)
remove_background_using_abgtrue
resolution512

A specialist tool: it segments an anime face into labeled regions - hair, eyes, skin, mouth, and so on - and outputs a colored map you can drive an anime-face segmentation ControlNet with. It also strips the background and hands you a character mask as a bonus. If you're doing anime work and want structural control over facial regions specifically, this is the node. For anything photographic or scene-level, look elsewhere; this model only understands anime faces.

How it works

It runs an anime-face segmentation model (the weights come from bdsqlsz's qinglong_controlnet-lllite collection) that's trained to recognize the parts of a stylized anime face and paint each one a distinct color. That colored region map is the conditioning signal: a matching segmentation ControlNet reads "hair goes here, eyes go here, skin goes here" and generates accordingly, giving you layout control over the face without dictating its appearance. Segmentation in general gives the model a map of what goes where without specifying how it looks, and this is the anime-face-tuned flavor of that idea.

The second half is background removal. With remove_background_using_abg on, it runs an anime background-segmentation model (isnetis) to isolate the character, which both cleans up the face segmentation and gives you a usable character mask.

The inputs and outputs

Inputs:

  • image - your anime source, ideally a face or portrait.
  • remove_background_using_abg (default true) - strip the background before segmenting and emit the character mask. Leave it on unless you specifically want the background included.
  • resolution - note this one is locked to 512 (min and max are both 512), so there's nothing to tune here.

Outputs, and both are useful:

  • IMAGE - the colored face-region segmentation map. This is what feeds an anime-face segmentation ControlNet via a ControlNet Apply node.
  • ABG_CHARACTER_MASK (a MASK) - the character cutout. Genuinely handy on its own for compositing, isolating the character, or masking an inpaint even if you never touch the segmentation half.

Installing it

ComfyUI Manager: search ComfyUI's ControlNet Auxiliary Preprocessors, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/Fannovel16/comfyui_controlnet_aux
pip install -r requirements.txt

Restart ComfyUI. First run downloads two weights from HuggingFace - the anime-face segmentation UNet and the isnetis anime-segmentation checkpoint for background removal.

Where people get burned

The first trap is feeding it the wrong kind of image. This model is trained on anime faces. Give it a photo, a full-body wide shot, or a non-face subject and the segmentation will be nonsense - it has no idea what it's looking at. Keep the input to anime portraits where a face is the main event.

Second, the segmentation output needs a matching segmentation ControlNet to do anything. On its own it's a pretty colored picture with no effect on your render. If you don't have an anime-face seg ControlNet loaded, the most valuable thing this node gives you is actually the character mask, which stands alone.

Third, a note on the wider landscape: segmentation is one of the ControlNet conditions that mostly stayed in the SD1.5/SDXL era and never got rebuilt for the newest base models. So this is comfortably an SD1.5-flavored anime workflow tool. That's not a knock - it's just where it lives.

CategoryControlNet Preprocessors/Semantic Segmentation

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
remove_background_using_abgoptBOOLEANtrue
resolutionoptINT512512–512

Outputs (2)

NameTypeDescription
IMAGEIMAGE
ABG_CHARACTER_MASK (MASK)MASK