Nodes/image_control/abyz22_drawmask
ComfyUI Node

abyz22_drawmask

A mask for the body region the detector found

By abyz22·Created 3 years ago·Updated 2 years ago· 17
abyz22_drawmask
  • segs
  • person_SEGS
  • mask
dx0.20
dy0.50
dy20.50
dy30.50
mode_type

This is the node that explains why the pack exists. abyz22_drawmask takes a human-detection result - Impact Pack's SEGS, the same detection data FaceDetailer uses - and turns it into a mask over a specific part of the body, sized and positioned by sliders. The three modes are Waist-detect, pussy-detect, and tits-detect. You're not inventing the region yourself; you're taking what a detector already found and telling it "grab the waist here" and getting a MASK you can feed an inpaint.

It comes from abyz22/image_control, the Impact Pack fork aimed at body editing. Set aside the explicit use cases and it's actually a neat pattern: detection-driven masking where the geometry is parameterized instead of hard-coded. And it's what the pack's README features like "Lowrise pants" and "see-through clothes" are built on - detect, mask the garment region, inpaint it.

Inputs that matter

  • segs - the required SEGS from an Impact Pack detector (like BBOX Detector (SEGS) or FaceDetailer's providers). The node converts it to a mask via Impact's ImpactSEGSToMaskBatch, so Impact Pack must be installed - this will crash with a mapping error otherwise.
  • mode_type - the region selector: Waist-detect, pussy-detect, tits-detect.
  • dx, dy, dy2, dy3 - ratio sliders (not pixels) that scale and position the mask geometry relative to the detected bounding box. dx widens, dy sets the vertical extent; dy2/dy3 move the top/bottom cutoffs. Start from defaults and nudge - these are surprisingly sensitive.
  • person_SEGS (optional) - only used by pussy-detect; a full-person SEGS used as a reference for where the waist region sits.

Output is a single mask (MASK).

How it works

The mask comes from the detected segmentation, then the code rebuilds it geometrically per mode - drawing an ellipse and rectangle anchored to the detection's bounding box for the waist, cropping and re-anchoring around the person mask for the other modes. It's OpenCV geometry on top of a detector's output, no machine learning inside the node itself.

Install and caveats

cd ComfyUI/custom_nodes
git clone https://github.com/abyz22/image_control

or ComfyUI Manager → "image_control", restart. Also install Impact Pack - this node and the detector feeding it depend on it. The pack's own requirements (openpyxl, pytorch-lightning, kornia) don't cover that.

Practical notes: the sliders are ratios of the bounding box, so on a small detection the same 0.5 means a small region - tune per image, don't expect one setting to generalize. The tits-detect mode deliberately keeps the larger of two detections when the model finds a pair, so don't fight it if only one region comes out. And because the output is a raw MASK, you'll usually want to feather or dilate it before it goes into an inpaint, or the boundary will be hard-edged. If you came here from the pack's README wanting the "change breast size" behavior, note this node only produces the mask - the actual regeneration is a downstream sampler with that mask.

Categoryabyz22

Inputs (7)

NameTypeDefaultDescription
segsSEGS
dxFLOAT0.200–1
dyFLOAT0.500–2
dy2FLOAT0.50-2–2
dy3FLOAT0.50-2–2
mode_typeCOMBO3 options: Waist-detect, pussy-detect, tits-detect
person_SEGSoptSEGS

Outputs (1)

NameTypeDescription
maskMASK