Nodes/BV Node Pack/πŸŒ€ BV Impact Detector Mask
ComfyUI Node

πŸŒ€ BV Impact Detector Mask

Grade a face without ever touching a brush

By BlackVortexAIΒ·Created 8 months agoΒ·Updated a day agoΒ· 6
πŸŒ€ BV Impact Detector Mask
  • image
  • bbox_detector
  • segm_detector
  • sam_model
  • mask
  • info
β—„threshold0.50β–Ί
β—„dilation0β–Ί
β—„crop_factor1.5β–Ί
β—„drop_size10β–Ί
β—„detector_modeβ–Ύβ–Ί
β—„instance_modeβ–Ύβ–Ί
β—„instance_index0β–Ί
β—„mask_threshold0.00β–Ί
β—„mask_grow0β–Ί
β—„mask_feather8β–Ί

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 - auto picks for you (segmentation if you have a SEGM detector, else bbox+SAM if you have both, else bbox). segmentation is the quality choice; bbox_sam needs both a BBOX and a SAM model; bbox_debug is the quick-and-rough look.
  • instance_mode - combined merges everything detected into one mask, largest keeps only the biggest, index keeps the nth (instance_index).
  • mask_feather (default 8) and mask_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_mode to index and raise/lower instance_index; the info output tells you what each index held.
  • Square-edged grade where a person should be - you're in bbox_debug mode with no SAM; the warning in info is 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.

CategoryπŸŒ€ BV Node Pack/regional/LUT

Inputs (14)

NameTypeDefaultDescription
imageIMAGEβ€”
thresholdFLOAT0.500–1β€”
dilationINT0-512–512β€”
crop_factorFLOAT1.51–20β€”
drop_sizeINT101–8192β€”
detector_modeCOMBO4 options: auto, segmentation, bbox_sam, bbox_debug
instance_modeCOMBO3 options: combined, largest, index
instance_indexINT00–999β€”
mask_thresholdFLOAT0.000–1β€”
mask_growINT0-256–256β€”
mask_featherINT80–256β€”
bbox_detectoroptBBOX_DETECTORβ€”
segm_detectoroptSEGM_DETECTORβ€”
sam_modeloptSAM_MODELβ€”

Outputs (2)

NameTypeDescription
maskMASKβ€”
infoSTRINGβ€”