Nodes/comfyui_facetools/Jonathandinu Mask
ComfyUI Node

Jonathandinu Mask

The more accurate face-parsing mask that eats VRAM

By dchatel·Created 3 years ago·Updated about a year ago· 182
Jonathandinu Mask
  • crop
  • MASK
◄skintrue►
◄nosetrue►
◄eyeglassesfalse►
◄left_eyetrue►
◄right_eyetrue►
◄left_browtrue►
◄right_browtrue►
◄left_eartrue►
◄right_eartrue►
◄mouthtrue►
◄upper_liptrue►
◄lower_liptrue►
◄hairfalse►
◄hatfalse►
◄earringfalse►
◄necklacefalse►
◄neckfalse►
◄clothfalse►

If BiSeNet Mask is the workhorse face-parsing mask, Jonathandinu Mask is the upgrade - and the pack's own README says so in so many words. The author shipped it in the same 2024-05 update and flagged it plainly: it's more accurate than BiSeNet, but it takes more memory; you can get out of memory more easily with it. So the pitch is simple: when BiSeNet's segmentation is blurring the line between lips and skin and you have VRAM to spare, this is the better tool.

Like its sibling, it takes a face crop plus a row of per-part booleans and outputs a single MASK that's the union of every enabled region. Same idea, different engine underneath: instead of the old BiSeNet CNN, it runs a Segformer semantic segmentation model (jonathandinu/face-parsing) from Hugging Face. Segformer is a transformer-based segmenter, which is exactly why it's both more accurate and hungrier - attention costs memory.

What's different in practice

  • No manual model download. BiSeNet needs you to fetch 79999_iter.pth from a Google Drive link into models/bisenet. This node pulls its model automatically from Hugging Face the first time you run it, then caches it. If you've seen the pattern before: the first execution will stall while it downloads, then be normal forever after.
  • 18 classes instead of 19, with slightly different defaults - eyeglasses, earring, and necklace default to false here, where BiSeNet defaults eyeglasses and earring on. Glasses-wearing subjects are the classic place this bites; toggle eyeglasses on or the frames won't be masked.
  • GPU handling is slightly friendlier. The node picks cuda, then mps (Apple Silicon), then CPU for the model - though a chunk of its mask assembly still hardcodes CUDA, so don't count on it as a CPU escape hatch if you're fully GPU-less. And on modest cards, that OOM warning is real: a transformer segmenter plus your sampler on the same VRAM can tip you over.

When to reach for it

Same targeted-inpainting use case as BiSeNet Mask - mask just the mouth, just the eyes, or freeze everything but the region you want regenerated - but with cleaner region boundaries. If your mask edges are bleeding into neighboring features, swapping BiSeNet for jonathandinu in your CropFaces mask_type is a one-line experiment that often fixes it. If you're running out of memory, go the other way.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/dchatel/comfyui_facetools

or ComfyUI Manager → search facetools → restart. Needs the transformers package in your ComfyUI environment for the Segformer model - the pack ships no requirements file, so install it if you get a ModuleNotFoundError. No manual model files, just the first-run Hugging Face download.

One honest caveat for a node with zero search impressions: it's a niche tool for a specific workflow, and its only maintainer is the pack author. It does one thing well and it's worth knowing about - but it's not the node most people will build their pipeline around.

Categoryfacetools

Inputs (19)

NameTypeDefaultDescription
cropIMAGE—
skinBOOLEANtrue—
noseBOOLEANtrue—
eyeglassesBOOLEANfalse—
left_eyeBOOLEANtrue—
right_eyeBOOLEANtrue—
left_browBOOLEANtrue—
right_browBOOLEANtrue—
left_earBOOLEANtrue—
right_earBOOLEANtrue—
mouthBOOLEANtrue—
upper_lipBOOLEANtrue—
lower_lipBOOLEANtrue—
hairBOOLEANfalse—
hatBOOLEANfalse—
earringBOOLEANfalse—
necklaceBOOLEANfalse—
neckBOOLEANfalse—
clothBOOLEANfalse—

Outputs (1)

NameTypeDescription
MASKMASK—