Segs To Impact SEGS (NH)
Feed SAM 3's finds to Impact Pack's detailers
- segs
- segs
If you've spent any time in ComfyUI, you've probably used Impact Pack whether you know it or not. FaceDetailer - the node that detects faces in a finished render and repaints each one at full resolution - is Impact Pack, and it's the reason a lot of people's portraits stopped looking like thumbnails. Its whole family of detailers runs on a type called SEGS: a list of regions with boxes, crop areas and masks.
SAM 3 produces finds. Impact Pack detailers consume SEGS. Segs To Impact SEGS is the one-node bridge between them, and it's the only reason the two ecosystems need to meet at all - NH-Nodes uses Impact Pack for nothing else.
The workflow it unlocks
The detailer idea, from the ADetailer lineage onwards, is that a small region of an image has almost no pixel budget in a full-frame render, so you give that region its own generation pass and paste it back. Classic use: faces. Less classic and more interesting: anything you can now name.
Load Image → SAM3 Segment (concepts: logo, watch) → Segs To Impact SEGS → SEGSDetailer → … → Save
You point SAM 3 at a logo or a watch or a pair of shoes, convert, and Impact Pack's detailer re-renders just those regions at proper resolution. That's a capability the older detect-then-inpaint chains needed a custom detector for. Combining a concept segmenter with a detailer is one of the more useful things SAM 3 made newly easy.
The three inputs
segs is the NH_SEGS from SAM3 Segment, Garment Segment, Portrait Segment, Body Segment or Segs Select. Wire Segs Select in front and you can detail the biggest face only, or skip the doubtful detections - which is the practical way to keep a detailer from inventing detail inside a bad mask.
crop_factor (1–10, default 3) is Impact Pack's own setting, and the tooltip is honest about it: the region a detailer crops around each instance, as a multiple of its box. Higher gives the detailer more surrounding context to work with, which usually means better blending at the edges and more VRAM. The crop is shifted to stay inside the image and always contains the box, so a detection at the border doesn't produce a half-empty crop. If your detailer output has visible rectangular seams, raise crop_factor before you touch anything else.
batch_index exists because Impact Pack's SEGS hold exactly one image. This is the sharp edge: run a 10-image batch through SAM 3, convert, and you get the instances of image 0 by default. To do the whole batch you need one of these nodes per index, up to 4095. A number past the last image stops the node with a message rather than passing junk, at least.
What's inside the conversion
Each instance carries its label, score, box and mask into the Impact Pack structure, with the score becoming confidence and crop_factor defining the crop region. Nothing gets reinterpreted - the labels stay the words SAM 3 was asked for (or the part names from the people nodes), so anything downstream that reads labels sees the same strings.
The conversion itself doesn't import Impact Pack. NH-Nodes builds the structure itself, which means this node doesn't crash on a machine without Impact Pack installed. Actually using the output obviously does require Impact Pack.
Installing it
The pack, first. ComfyUI Manager, search NH-Nodes, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/jetthuangai/NH-Nodes.git
cd NH-Nodes
python -m pip install -r requirements.txt
Then Impact Pack, which you'd get from Manager by searching for it - it's one of the most-installed packs in the ecosystem, maintained by the same author as ComfyUI Manager itself, so it's usually already there if your workflow came from anywhere else. NH-Nodes needs none of Impact Pack's models or dependencies for anything else; if you don't use detailers, skip this node and its whole branch.
Common issues
Only the first image of the batch got processed. That's batch_index doing what it says. One node per image.
The detailer redraws things you didn't ask for. Usually a loose mask. SAM 3's threshold too low, or no Segs Select filtering, will hand the detailer a region that's half object and half background, and it will happily repaint the background. Run Segs Preview first.
Edges look pasted. Raise crop_factor, and consider growing the mask a few pixels before conversion with the pack's Mask Morphology. A detailer's output needs to overlap the original outline or you get a hard boundary.
You went looking for an NH_SEGS detailer. There isn't one - NH_SEGS is the pack's internal type and ComfyUI's nodes don't read it. All three of the pack's escape hatches (the mask outputs, Segs Compose and Segs To Masks) exist precisely so you don't need to care what type is flowing.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| segs | NH_SEGS | — | |
| crop_factor | FLOAT | 3.01–10 | Size of the region a detailer crops around each instance, as a multiple of its box (Impact Pack's crop_factor). |
| batch_index | INT | 00–4095 | Impact SEGS hold one image: which image of the batch to convert. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| segs | SEGS | — |