Skip Head Mask and add neck v5.1.0
Skip the head but keep a neck — the try-on way
- image
- head_mask
- IMAGE
A plain head-removal node is easy to write; getting a natural one is the hard part. If you black out the head and stop there, the inpaint pass has to invent a neck that leads nowhere - and the result is a floating torso with a weird collar gap. Skip Head Mask and add neck (from the tri3d-comfyui-nodes pack, v5.1.0) handles the whole thing: it cuts the head out, then carves a tapered triangle of neck so the region below the chin actually looks like a person, not a cutout.
How it works
It's tri3d_Skip_HeadMask with pose intelligence bolted on. Given image, head_mask, and a DWPose/OpenPose keypoint file, it:
- finds the chin - the lowest point of the head mask's contour,
- measures the face - center of gravity and width from the mask's bounding box,
- pulls the neck keypoint (index 1 in the COCO/DWPose layout) out of the pose JSON,
- computes a weighted point between neck and chin,
- blackens everything above the chin, then fills a neck triangle - apex at the weighted point, base at chin level, width scaled off the face - down into the kept region.
Net effect: head gone, but a gently tapering neck silhouette remains as a guide for whatever inpaints the region next.
The inputs that matter
imageandhead_mask- same as the plain Skip Head Mask node.keypoints_json- a STRING containing the path to a keypoint JSON. The node reads the file directly, so this must be a real file on disk. Format:{"height": H, "width": W, "keypoints": [[x,y], ...]}- 130 flattened points (body, face, hands). Easiest source: the same pack'stri3d_SaveFlattenedPoseKpsAsJsonFilenode, which takes a POSE_KEYPOINT from DWPose and writes the file for you.ratio_aggression(FLOAT, default 0.5, 0–1) - weights the neck vs the chin. 0 hugs the chin (short neck), 1 reaches for the actual neck keypoint (longer).neck_width_factor(FLOAT, default 0.8, 0.1–1.5) - the neck triangle's width as a fraction of face width. Go higher for a beefier neck.
Output is one IMAGE: the headless photo with the sculpted neck region blacked in.
Install and gotchas
ComfyUI Manager → search tri3d-comfyui-nodes, or git clone https://github.com/TRI3D-LC/tri3d-comfyui-nodes into custom_nodes, then restart. No model downloads for this node.
Two things to know. First, if the neck keypoint is missing or invalid (y ≤ 0), it silently falls back to the chin, and the neck triangle degenerates - your pose needs a detected neck for the "add neck" part to do anything. Second, the face-width measurement comes from the mask, so a mask that includes hair reads wide and gives you a too-fat neck. If the neck looks wrong, check the mask before blaming the sliders.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| head_mask | IMAGE | — | |
| keypoints_json | STRING | — | |
| ratio_aggression | FLOAT | 0.500–1 | — |
| neck_width_factor | FLOAT | 0.800.1–1.5 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |