SEGSOrderedFilterDetailerHookProvider
Rank-and-slice filtering, wired straight into a detailer
- DETAILER_HOOK
SEGS Filter (ordered) is a standalone node: SEGS in, ranked-and-sliced SEGS out. SEGSOrderedFilterDetailerHookProvider packages that exact same ranking logic as a DETAILER_HOOK instead, so you can apply it inside a detailer or detector node's own hook slot rather than as a separate filtering step earlier in your graph. Per the README, this is one of a small family of wrapper nodes - alongside the range and label variants - "that provides SEGSFilter nodes to be applied in FaceDetailer or Detector by creating DETAILER_HOOK."
The practical difference from the standalone filter: this runs as part of the detailer's own processing rather than as a node you wire in before it, which matters for nodes like FaceDetailer that don't give you an easy point to insert a separate filter between detection and detailing.
How it works
Same ranking rule as the standalone SEGS Filter (ordered): every SEG gets ranked by whatever target you pick, in the direction order sets, and the hook keeps a window of that ranking - starting at take_start, take_count long. Wired into a detailer or detector's hook slot, that filtering is applied automatically as part of its run, rather than you needing a separate filter node upstream feeding it a pre-trimmed SEGS.
The inputs and output
target- what to rank by:area(=w*h)(the common choice),width,height, or the box coordinatesx1/y1/x2/y2(position-based ranking).order(default on) - sort direction. Flips which end of the ranking "take the first" refers to.take_start(default 0) - where the kept window begins in the ranking. 0 is the top.take_count(default 1) - how many SEGs the window keeps. Default of 1 keeps just the single top-ranked detection.
Output is a single DETAILER_HOOK - wire it into a detector or detailer node's hook input, the same slot other detailer hooks use.
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 or extra dependencies - pure filtering logic.
Common issues & troubleshooting
Wrong detections kept. Same fix as the standalone filter: flip order. It's the single most common mix-up with any ranked filter - easy to toggle and rerun.
All detections got filtered out. If take_start sits past the number of detections you actually have, the window is empty. With four detections, a take_start of 6 keeps nothing.
You wanted a hard size threshold, not a rank. "Keep the top 2 by size" is what this hook does; "keep everything bigger than 100px" is a different rule. For that, reach for SEGSRangeFilterDetailerHookProvider instead, which filters by absolute value.
Not sure whether to use this hook or the standalone SEGS Filter (ordered) node. If you can freely insert a node between detection and detailing, the standalone filter is simpler to reason about and debug. Reach for the hook version specifically when you're inside a node like FaceDetailer that doesn't expose that seam, and filtering has to happen as part of its own internal detect-then-detail loop.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| target | COMBO | 7 options: area(=w*h), width, height, x1, y1, x2, +1 | |
| order | BOOLEAN | true | — |
| take_start | INT | 00–9223372036854776000 | — |
| take_count | INT | 10–9223372036854776000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DETAILER_HOOK | DETAILER_HOOK | — |