π BV Impact Detector Mask
Grade a face without ever touching a brush
- image
- bbox_detector
- segm_detector
- sam_model
- mask
- info
Want to apply a LUT to just the person in the frame, or just the sky, without hand-painting a mask every time the subject moves? This node is the bridge: it takes an Impact Pack detector result - the same SEGS machinery behind FaceDetailer and its cousins - and converts it into a plain full-image MASK you can feed straight into BV Apply LUT.
It exists because the two worlds don't naturally connect. Impact detectors output SEGS (a set of detected segments with boxes, masks and confidence); the LUT system wants a single MASK tensor aligned to the image. This node does the conversion, and while it's doing it, lets you filter which instance you care about and tidy the mask up.
How it works
For each image in your batch it runs the detector you supplied, gets back SEGS, keeps the instances you asked for, then rasterizes them into a mask. In bbox_sam mode it goes the extra step of running the supplied SAM model over the boxes for a proper silhouette mask; in plain bbox mode you get rectangular masks, which is why the info output warns you when that's what you're looking at. Finally the mask gets refined with your grow/feather/threshold settings.
The important catch is in the first sentence: this node requires ComfyUI-Impact-Pack to be installed. It imports impact.core lazily and raises a clear RuntimeError if the pack isn't there. Install it via Manager first - it's standard infrastructure for most people anyway.
The inputs that matter
Most of the ten inputs are passed through to the detector, so the ones you actually tune are:
detector_mode-autopicks for you (segmentation if you have a SEGM detector, else bbox+SAM if you have both, else bbox).segmentationis the quality choice;bbox_samneeds both a BBOX and a SAM model;bbox_debugis the quick-and-rough look.instance_mode-combinedmerges everything detected into one mask,largestkeeps only the biggest,indexkeeps the nth (instance_index).mask_feather(default 8) andmask_grow- how soft and how inflated the final mask is. This is where you avoid harsh grade edges.
The detector inputs - bbox_detector, segm_detector, sam_model - come from Impact Pack's own detector loader nodes (UltralyticsDetectorProvider, SAMLoader, etc.). threshold/dilation/crop_factor/drop_size are passed straight through to the detector's detect() call, so use Impact's usual values.
Outputs: mask (the MASK, wire it into Apply LUT's mask input) and info (a report of mode and per-instance selections - handy when largest picked the wrong face and you need to know why).
How to install
Two installs, not one:
cd ComfyUI/custom_nodes
git clone https://github.com/BlackVortexAI/bv_nodepack.git
# plus the Impact Pack it leans on - easiest via ComfyUI Manager
Search "BV Node Pack" and "Impact Pack" in ComfyUI Manager, restart, hard-refresh. No extra model downloads beyond whatever detector and SAM models you already use for detailing.
Common issues
- "requires ComfyUI-Impact-Pack" - the pack's not installed (or ComfyUI wasn't restarted after installing it).
- Wrong instance selected - switch
instance_modetoindexand raise/lowerinstance_index; theinfooutput tells you what each index held. - Square-edged grade where a person should be - you're in
bbox_debugmode with no SAM; the warning ininfois literally there for this. Add a SAM model or use a segmentation detector. - Mask looks blocky / misaligned - if you're using this in a LUT loop, the node runs on the current accumulated image each iteration; batch or size changes between iterations will bite.
It's one of those "small node, big convenience" things: subject-isolated color grading that keeps working when the frame changes.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| threshold | FLOAT | 0.500β1 | β |
| dilation | INT | 0-512β512 | β |
| crop_factor | FLOAT | 1.51β20 | β |
| drop_size | INT | 101β8192 | β |
| detector_mode | COMBO | 4 options: auto, segmentation, bbox_sam, bbox_debug | |
| instance_mode | COMBO | 3 options: combined, largest, index | |
| instance_index | INT | 00β999 | β |
| mask_threshold | FLOAT | 0.000β1 | β |
| mask_grow | INT | 0-256β256 | β |
| mask_feather | INT | 80β256 | β |
| bbox_detectoropt | BBOX_DETECTOR | β | |
| segm_detectoropt | SEGM_DETECTOR | β | |
| sam_modelopt | SAM_MODEL | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| mask | MASK | β |
| info | STRING | β |