abyz22_drawmask
A mask for the body region the detector found
- segs
- person_SEGS
- mask
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 (likeBBOX Detector (SEGS)orFaceDetailer's providers). The node converts it to a mask via Impact'sImpactSEGSToMaskBatch, 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.dxwidens,dysets the vertical extent;dy2/dy3move the top/bottom cutoffs. Start from defaults and nudge - these are surprisingly sensitive.person_SEGS(optional) - only used bypussy-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.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| segs | SEGS | — | |
| dx | FLOAT | 0.200–1 | — |
| dy | FLOAT | 0.500–2 | — |
| dy2 | FLOAT | 0.50-2–2 | — |
| dy3 | FLOAT | 0.50-2–2 | — |
| mode_type | COMBO | 3 options: Waist-detect, pussy-detect, tits-detect | |
| person_SEGSopt | SEGS | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |