Nodes/ComfyUI Impact Pack/Detailer (SEGS)
ComfyUI Node Runs on cloud

Detailer (SEGS)

The crop-resample-paste engine behind FaceDetailer

By ltdrdata·Created 3 years ago·Updated 4 months ago· 3,242
Detailer (SEGS)
  • image
  • segs
  • model
  • clip
  • vae
  • positive
  • negative
  • detailer_hook
  • scheduler_func_opt
  • IMAGE
guide_size512
guide_size_fortrue
max_size1024
seed0
steps20
cfg8.00
sampler_name
scheduler
denoise0.50
feather5
noise_masktrue
force_inpainttrue
wildcard
cycle1
inpaint_modelfalse
noise_mask_feather20
tiled_encodefalse
tiled_decodefalse

Detailer (SEGS) is the actual workhorse of the Impact Pack. FaceDetailer gets the fame, but under the hood FaceDetailer is a detector bolted onto this node. Once you have SEGS - a bundle of detected regions from a BBOX or SEGM detector - this is what crops each one, runs a fresh sampling pass at full resolution, and pastes it back onto the image. Detect somewhere else, refine here.

The reason to reach for this instead of the all-in-one FaceDetailer is control. FaceDetailer bundles detection and refinement into one box with two dozen inputs; splitting them means you can detect once and feed the same SEGS to different refiners, filter the detections before refining, or intersect a bbox with a SAM silhouette first. It's the composable half of the pack, and it's the piece that makes the "detect, crop, resample, paste" loop - the same idea as ADetailer in A1111 - into something you can rewire.

How it works

For each region in the incoming SEGS, the node crops that area (with padding), scales it up to around guide_size, runs a normal img2img sampling pass on just that crop using the model and prompt you give it, then composites the result back into the original frame under a feathered mask. A 64px eye gets a 512px generation budget and comes back sharp. Because it samples each region independently, you can push detail into faces and hands without touching the rest of the picture - the whole point of masked, only-the-region refinement.

The inputs and outputs that matter

This node takes the sampler's ingredients directly rather than through a pipe:

  • image, segs (required) - the picture and the detected regions to refine.
  • model, clip, vae, positive, negative (required) - the checkpoint and conditioning for the refinement pass. Reuse your main generation's model and prompt as a starting point.
  • guide_size (default 512) - the target size each crop is scaled to before resampling. This is where the extra detail comes from; roughly match it to your model's native resolution (512 for SD1.5, ~1024 for SDXL/Flux).
  • denoise (default 0.5) - how far the region departs from the original pixels. The dial you tune most. 0.3–0.4 for a gentle cleanup that stays on-model; higher regenerates more and risks drifting the face's identity.
  • feather (default 5) - softens the paste edge so the fix blends instead of showing a border.
  • cycle (default 1) - how many refine passes to run per region. 2 gives a stronger effect; watch for over-cooking.
  • wildcard - an optional prompt applied per detection, handy for steering all faces at once.

There's an optional inpaint_model toggle (flip it on only when your model is a dedicated inpainting checkpoint) and tiled_encode/tiled_decode for VRAM relief. The single output is IMAGE - your original with every detected region refined and composited back.

How to install it

Install the pack via ComfyUI Manager (search ComfyUI Impact Pack, install, restart), or 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. This node itself needs no extra models - but the detector that produces its SEGS input does, which in practice means the Impact Subpack for UltralyticsDetectorProvider. Linux: libgl1-mesa-glx and libglib2.0-0 for OpenCV.

Common issues & troubleshooting

The face changed instead of just sharpening. denoise is too high. Drop it to 0.3–0.4. High denoise turns a detail pass into a full regeneration, which is why over-detailed faces stop looking like the person.

A crowd came back as a room of clones. Every region samples from the same base seed, so a bunch of small faces converge into near-identical ones - a well-known failure of automated detailers. Vary the prompt via the wildcard input, or refine fewer faces per pass.

Visible seam or a grey box around the fix. Raise feather, and make sure the vae you fed matches the model - a mismatched VAE is the classic source of a colour-shifted patch. Bbox-shaped seams also ease up if you feed the SEGS through SAMDetector (combined) first so the mask follows the silhouette.

Nothing happens. Empty SEGS. The detector upstream found nothing - check its threshold and that its model matches your subject.

CategoryImpactPack/Detailer

Inputs (27)

NameTypeDefaultDescription
imageIMAGE
segsSEGS
modelMODELIf the `ImpactDummyInput` is connected to the model, the inference stage is skipped.
clipCLIP
vaeVAE
guide_sizeFLOAT51264–16384
guide_size_forBOOLEANtrue
max_sizeFLOAT102464–16384
seedINT00–18446744073709550000
stepsINT201–10000
cfgFLOAT8.000–100
sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBO17 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +11
positiveCONDITIONING
negativeCONDITIONING
denoiseFLOAT0.500.0001–1
featherINT50–100
noise_maskBOOLEANtrue
force_inpaintBOOLEANtrue
wildcardSTRING
cycleINT11–10
detailer_hookoptDETAILER_HOOK
inpaint_modeloptBOOLEANfalse
noise_mask_featheroptINT200–100
scheduler_func_optoptSCHEDULER_FUNC
tiled_encodeoptBOOLEANfalse
tiled_decodeoptBOOLEANfalse

Outputs (1)

NameTypeDescription
IMAGEIMAGE