BD Head Cutout
Cut the head off — no neck, no angle selector, same result every time
- image
- head_cutout
- head_mask
- status
Isolating just a head is a deceptively fiddly job. Cut too high and you lose the jaw; cut too low and you drag the neck and shoulders in; and every image seems to need different settings. BD_HeadCutout is the BrainDead pack's attempt to make it one node that does the same thing for every image - front-facing or profile, no angle selector. You feed it a person image and it returns the head on a transparent (or black/white) background plus a head mask you can apply to any downstream output.
It sits in the segmentation family alongside the SAM3 multi-prompt and parts nodes, and it's the natural answer to "strip the neck that Qwen added" or "get a consistent head plate for a flipbook/face socket pipeline."
How it works
Two segmentation passes, layered:
- SAM3, prompt-driven. It unions the
head_prompts(default:head,face,hair,ear) as positives, then subtracts theexclude_prompts(default:neck,shirt,clothing,shoulder) as negatives.mask_threshold(0.5) controls the SAM3 text-segmentation confidence. - A SegFormer neck pass. If
neck_cutis on (default), an in-house face-parser pass removes the neck chin-safely - it bridges and then drops the disconnected neck via connected components, so it never slices a flat line through the chin. The chin stays part of the head.
Then smooth (default 12) rounds the lumpy boundary into an S-type jaw/chin curve - it's normalized at 1536px, so it auto-scales with resolution. Higher = smoother and rounder; 0 = raw silhouette.
The inputs that matter
- jaw_mode - the interesting one.
neck_parser(default) lets the SegFormer pass do its chin-safe removal, best when hair/clothing is complex.landmark_jawlinecuts along the MediaPipe jawline instead - under-ear → jaw → chin - for a tight, consistent anatomical S-curve regardless of what's below. Both respectsmooth. - edge_refine - optional edge snapping:
off(raw),guided(fast),matting(soft hair), orvitmatte(best, but downloads a model). Hair is the case where you'll want matting or vitmatte; on a clean cutout, leave it off and save the runtime. - cutout_bg -
transparent(RGBA),black, orwhite.
Outputs: head_cutout (the IMAGE), head_mask (the MASK, for wiring onto other images), and status.
Where it fits
The "why bother" is the flipbook/face-socket corner of the pack: a head cutout on a transparent plate is exactly what those texture pipelines want, and the pack's FaceWrap flow uses the mask to keep neck out of downstream compositing. If you only need this once, it's arguably overkill vs. a quick manual SAM3 mask - but if you're processing a sheet of character images that all need the same head treatment, "same way every time" is the whole selling point.
Install
Part of the BrainDead pack:
cd ComfyUI/custom_nodes
git clone https://github.com/BizaNator/ComfyUI-BrainDead
cd ComfyUI-BrainDead
pip install -r requirements.txt
Or search "BrainDead" in ComfyUI Manager and restart. It leans on the pack's SAM3 infrastructure (which auto-downloads the official SAM3 checkpoint on first use), so the first run downloads weights.
Troubleshooting
- Neck still creeping in - make sure
neck_cutis on, and add neck-ish words toexclude_prompts(e.g.collar,turtleneck). - Chin cut flat - that's
smoothtoo high orneck_parsermisjudging; trylandmark_jawlinemode or dropsmooth. - Frizzy hair looks chopped - turn on
edge_refinewithmattingorvitmatte. - Head comes back with jaw too round - lower
smoothtoward 4–8.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| head_promptsopt | STRING | head face hair ear | SAM3 positives — one per line. Their union = the head. |
| exclude_promptsopt | STRING | neck shirt clothing shoulder | SAM3 negatives — subtracted from the head (peels off neck / clothing / body). |
| neck_cutopt | BOOLEAN | true | Remove the neck via the SegFormer face parser (chin-safe: it never cuts a flat line into the chin — the chin stays as part of the head component). Off = keep whatever exclude_prompts left. |
| cutout_bgopt | COMBO | transparent | Background for the head_cutout image: transparent = RGBA; black/white = baked RGB. |
| smoothopt | INT | 120–64 | Smooth the head boundary into an S-type jaw/chin curve (1536px-normalised, auto-scales with resolution). Rounds the lumpy SegFormer edge + the sharp neck-sever corners. 0 = raw silhouette; higher = smoother/rounder. |
| edge_refineopt | COMBO | off | Snap the head edge to the image: guided (fast), matting (soft hair), vitmatte (best, downloads a model). off = the raw SAM3 + close silhouette. |
| refine_radiusopt | INT | 81–64 | — |
| refine_epsopt | FLOAT | 0.00010.000001–0.1 | — |
| refine_thresholdopt | FLOAT | 0.500–1 | — |
| vitmatte_modelopt | COMBO | small | 2 options: small, base |
| mask_thresholdopt | FLOAT | 0.500–1 | SAM3 text-segmentation threshold. |
| jaw_modeopt | COMBO | neck_parser | How to cut the bottom of the head: neck_parser — SegFormer face-parser removes the real neck/clothing (chin-safe, default). Best when hair/clothing is complex. landmark_jawline — cut along the MediaPipe jawline (under-ear → jaw → chin) for a clean anatomical S-curve regardless of what's below. Best for a tight, consistent jaw cut. Both respect the smooth setting. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| head_cutout | IMAGE | — |
| head_mask | MASK | — |
| status | STRING | — |