SEGSRangeFilterDetailerHookProvider
Threshold filtering, wired straight into a detailer
- DETAILER_HOOK
The hook-flavored sibling of SEGS Filter (range), and part of the same small family as SEGSOrderedFilterDetailerHookProvider. Where the ordered filter keeps detections by rank ("the top N by size"), SEGSRangeFilterDetailerHookProvider keeps them by absolute value - "everything between this size and that size" - and does it as a DETAILER_HOOK you attach directly to a detailer or detector node, rather than a separate filter step earlier in the graph. Per the README, it's one of the wrapper nodes "that provides SEGSFilter nodes to be applied in FaceDetailer or Detector by creating DETAILER_HOOK."
Reach for this over the ordered variant when your rule is a genuine threshold rather than a relative comparison - "ignore anything under 40px, it's noise" is a range rule; "keep the two biggest" is an ordered one.
How it works
Every SEG gets measured against target (area, a dimension, a coordinate, or how far along the frame it sits) and kept only if that value falls between min_value and max_value. mode flips whether that's an inclusive keep-in-range or an exclude-in-range comparison. Anything outside your window is dropped before the detailer or detector does its actual work on the region.
The inputs and output
target- what to measure:area(=w*h),width,height, the box coordinatesx1/y1/x2/y2, orlength_percent(size relative to the source image, useful when you want a threshold that scales with resolution instead of a fixed pixel count).mode(default on) - whether the range is a keep-window or an exclude-window; flip it if your filter is doing the opposite of what you expect.min_value(default 0) andmax_value(default 67108864 - that's 8192×8192, effectively "no upper bound" for area) - the threshold window. Forarea(=w*h), remember you're comparing against width×height in pixels, not a linear dimension - a 200×200 region is 40,000, not 200.
Output is a single DETAILER_HOOK - wire it into a detector or detailer's hook slot.
How to install it
Via ComfyUI Manager: search ComfyUI Impact Pack, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack comfyui-impact-pack
cd comfyui-impact-pack
python -m pip install -r requirements.txt # ComfyUI's python; python_embeded on portable
then restart. No models - pure filtering logic, no extra dependency.
Common issues & troubleshooting
Nothing got filtered out and you expected some detections gone. Double check you're comparing the right units - area(=w*h) is width times height, so a threshold that looks small in pixel terms (say min_value: 200) barely excludes anything, since even a tiny 15×15 detection already clears it. Use length_percent if you'd rather reason in terms of the source image's scale instead of raw pixels.
Everything got filtered out. min_value/max_value window doesn't overlap with any of your actual detections' values. Loosen the range, or check mode - you may have an exclude-window when you meant a keep-window, or the reverse.
You wanted the N biggest or smallest, not a threshold. That's SEGSOrderedFilterDetailerHookProvider's job, not this one - rank-based selection rather than absolute value.
Do you need the hook version specifically? Only when you're inside a node like FaceDetailer that doesn't give you a seam to insert a standalone SEGS Filter (range) node between detection and detailing. If you do have that seam, the standalone filter is simpler to debug on its own.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| target | COMBO | 8 options: area(=w*h), width, height, x1, y1, x2, +2 | |
| mode | BOOLEAN | true | — |
| min_value | INT | 00–9223372036854776000 | — |
| max_value | INT | 671088640–9223372036854776000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DETAILER_HOOK | DETAILER_HOOK | — |