Nodes/tri3d-comfyui-nodes/Skip Head Mask and add neck v5.1.0
ComfyUI Node

Skip Head Mask and add neck v5.1.0

Skip the head but keep a neck — the try-on way

By TRI3D-LC·Created 3 years ago·Updated about a year ago· 27
Skip Head Mask and add neck v5.1.0
  • image
  • head_mask
  • IMAGE
keypoints_json
ratio_aggression0.50
neck_width_factor0.80

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:

  1. finds the chin - the lowest point of the head mask's contour,
  2. measures the face - center of gravity and width from the mask's bounding box,
  3. pulls the neck keypoint (index 1 in the COCO/DWPose layout) out of the pose JSON,
  4. computes a weighted point between neck and chin,
  5. 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

  • image and head_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's tri3d_SaveFlattenedPoseKpsAsJsonFile node, 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.

CategoryTRI3D

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
head_maskIMAGE
keypoints_jsonSTRING
ratio_aggressionFLOAT0.500–1
neck_width_factorFLOAT0.800.1–1.5

Outputs (1)

NameTypeDescription
IMAGEIMAGE