EasyPortrait Segment
Portrait cutouts and face parsing in one node — no mmseg required
- image
- mask
- preview
Let's be honest about what this node is for. Portrait-only background removal is a solved problem in 2026 - BiRefNet ships in ComfyUI core and it'll beat this thing on flyaway hair every time. The reason you care about EasyPortrait Segment is the other half of it: face parsing. Feed it a face and it hands you separate masks for the skin, the left and right brows, the eyes, the lips, the teeth. No other node in the default stack does that, and it's exactly what you need when you want to fix "AI teeth" or smooth skin without touching the rest of the portrait.
What it is
A single node that runs ONNX exports of the EasyPortrait checkpoints - a real research project that does portrait segmentation (background vs person) and face parsing (eight regions) in one model family. The pack exists so you don't have to install the ancient mmsegmentation / mmcv-full stack the original code needed. Runtime deps are just onnxruntime, Pillow, and requests. That's it. No key, no API, all local.
The mechanism is boring in a good way. Your image gets resized to the model's native resolution, normalized, run through onnxruntime, and the class map gets argmaxed and resized back to your original dimensions. Models are downloaded once from the sadzip/EasyPortrait-ONNX repo on Hugging Face into ComfyUI/models/easyportrait/onnx on first use, then cached per model in memory.
The inputs that matter
The node has a lot of widgets, but a beginner really sets three things:
model_name- 26 choices across two families. The portrait segmentation models give youbackgroundandperson; the face parsing models give youbackground,skin, brows, eyes,lips, andteeth. Resolution is baked into the name: 224/384/512/1024. Higher res means sharper edges and slower runs; the 384s are the sane default, 1024 when edges matter.mode-binarymerges your selected labels into one combined mask per image.layersreturns each selected label as its own mask in the output batch. If you want skin, lips, and teeth as separate masks, that'slayers; if you just want "the person",binary.- The label checkboxes -
person,skin,left_brow,right_brow,left_eye,right_eye,lips,teeth,background. Set what you want; thelabelstext field overrides them if you type a comma-separated list likeskin,lips,teeth(it's forgiving about spaces and case).
Two outputs: mask (a MASK batch) and preview (your image with each label overlaid in its own color, so you can see what you actually got without digging through the graph).
Installing it
Easiest path is ComfyUI Manager - search "EasyPortrait" and install. Otherwise:
cd ComfyUI/custom_nodes
git clone https://github.com/preposition17/ComfyUI-EasyPortrait
cd ComfyUI-EasyPortrait
# into the same Python env ComfyUI uses
pip install -r requirements.txt
Restart ComfyUI. First run of the node downloads its ONNX file, so give it a moment and don't panic at a stall.
Where people get burned
- It runs on CPU until you make it not. The default
onnxruntimepip package is the CPU build, and the node only uses CUDA if onnxruntime reports it available. If you want GPU inference, installonnxruntime-gpuinto the same environment. On CPU the 1024 models are genuinely slow. - The
layersmode reshapes your mask batch. One mask per label per input image gets stacked together, so three labels on two images gives you a batch of six. If you wired it to a node expecting one mask per image, it'll look wrong - that's the mode, not a bug. - Silent fallback. If nothing ends up selected, it quietly falls back to
personfor portrait models andskinfor face parsing. Confusing previews often trace back to this.
Where it fits
The mask output wires straight into anything mask-based: inpainting, compositing, or a Set Mask feeding a local pass - and face-parsing masks are the backbone of skin-enhancement and relight workflows people genuinely run in this community. One honest caveat, straight from the KB: this is a segmentation model, not a matting model. Semi-transparent hair and veils will come out wrong, and no amount of model switching fixes that - for hard cutouts, keep BiRefNet in the graph. Use EasyPortrait Segment for the parts.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| model_name | COMBO | Portrait Segmentation / BiSeNet-V2 / 384 | 26 options: Portrait Segmentation / BiSeNet-V2 / 384, Portrait Segmentation / DANet / 384, Portrait Segmentation / DeepLabv3 / 384, Portrait Segmentation / Fast SCNN / 384, Portrait Segmentation / FCN + MobileNetv2 / 384, Portrait Segmentation / FPN + ResNet50 / 1024, +20 |
| mode | COMBO | binary | 2 options: binary, layers |
| person | BOOLEAN | true | — |
| skin | BOOLEAN | false | — |
| left_brow | BOOLEAN | false | — |
| right_brow | BOOLEAN | false | — |
| left_eye | BOOLEAN | false | — |
| right_eye | BOOLEAN | false | — |
| lips | BOOLEAN | false | — |
| teeth | BOOLEAN | false | — |
| background | BOOLEAN | false | — |
| labels | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |
| preview | IMAGE | — |