Nodes/ComfyUI Impact Pack/FaceDetailer (pipe)
ComfyUI Node Runs on cloud

FaceDetailer (pipe)

The multipass face fixer that chains without re-wiring

By ltdrdata·Created 3 years ago·Updated 4 months ago· 3,242
FaceDetailer (pipe)
  • image
  • detailer_pipe
  • scheduler_func_opt
  • image
  • cropped_refined
  • cropped_enhanced_alpha
  • mask
  • detailer_pipe
  • cnet_images
guide_size512
guide_size_fortrue
max_size1024
seed0
steps20
cfg8.00
sampler_name
scheduler
denoise0.50
feather5
noise_masktrue
force_inpainttrue
bbox_threshold0.50
bbox_dilation10
bbox_crop_factor3.0
sam_detection_hint
sam_dilation0
sam_threshold0.93
sam_bbox_expansion0
sam_mask_hint_threshold0.70
sam_mask_hint_use_negative
drop_size10
refiner_ratio0.20
cycle1
inpaint_modelfalse
noise_mask_feather20
tiled_encodefalse
tiled_decodefalse

FaceDetailer (pipe) is FaceDetailer for when one pass isn't enough. It does the same thing - detect faces, crop them, resample at proper resolution, paste them back - but instead of accepting a model, VAE, prompt, and detector as separate wires, it takes them all bundled into a single DETAILER_PIPE, and it outputs that same pipe again so the next FaceDetailer can pick up where this one left off. That output-is-also-an-input design is the entire reason the node exists.

The problem it solves is the 2-pass detail restore. A severely mangled face sometimes needs two goes: a first pass at modest settings to recover the rough shape, then a second at higher settings to put the detail back. You can wire two full FaceDetailers in a row, but each one needs the model, clip, vae, positive, negative, and detector re-connected - a mess of a dozen duplicate wires. The pipe collapses all of that into one cable. Chain three FaceDetailer (pipe) nodes and you've re-plugged one wire between them, not twelve.

How it works

A DETAILER_PIPE is a bundle: model, CLIP, VAE, positive and negative conditioning, the BBOX detector, an optional SAM model, and wildcard settings, all packed together. You build one with ToDetailerPipe (or BasicPipe -> DetailerPipe), feed it in here, and the node unpacks it to run the same detect-crop-refine loop FaceDetailer runs. Then it re-emits the pipe on its output so the next stage inherits the identical setup. Everything past the pipe is standard sampling - the same masked, full-resolution regional resample that underpins every detailer in the pack, and the same idea as ADetailer over in A1111.

The inputs and outputs that matter

  • image (required) - the picture to fix.
  • detailer_pipe (required) - the bundle of model/clip/vae/conditioning/detector. Build it once with ToDetailerPipe upstream.
  • guide_size (default 512) - the size each detected face is scaled to before resampling. Where the detail comes from.
  • denoise (default 0.5) - how hard the pass rewrites the face. The main dial. In a 2-pass setup, keep the first pass low (rough recovery) and let the second do the detail; 0.3–0.4 is the safe band for staying on-model.
  • feather (default 5) - softens the paste edge.
  • bbox_threshold (default 0.5), bbox_dilation, bbox_crop_factor - detection tuning: confidence cutoff, mask growth, and how much context each crop keeps.
  • cycle (default 1) - refine passes per face within this node.

The sam_* inputs only do anything when the pipe carries a SAM model, in which case they steer how SAM tightens each mask to the silhouette. Outputs: image (the fixed frame), detailer_pipe (the same bundle, for the next stage - this is the one that makes chaining clean), plus mask (a visualization of what got detailed), cropped_refined and cropped_enhanced_alpha (per-face crops for inspection), and cnet_images.

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. The face detector inside the pipe comes from the Impact Subpack (UltralyticsDetectorProvider), which you install separately since v8.0. The bundled SAM model auto-downloads to ComfyUI/models/sams on first install. Linux: libgl1-mesa-glx and libglib2.0-0 for OpenCV.

Common issues & troubleshooting

Just starting out? Use plain FaceDetailer first. The pipe version earns its keep only when you're chaining passes. For a single face fix, the one-node FaceDetailer has fewer wires to get wrong; move to the pipe when you actually need 2-pass.

Both passes barely changed the face. If the face was already large and sharp, a detail pass mostly costs time and drifts the style - the most-upvoted reaction to a detailing demo was that the two versions looked identical. Detailers pay off on small faces; skip them on close-up portraits.

Second pass overcooked it. Lower the second stage's denoise. Stack two passes and their effect compounds - a 0.5 followed by another 0.5 is a lot of rewriting.

Nothing connects to detailer_pipe. You need to build the pipe upstream with ToDetailerPipe and give it a detector from the Subpack. Without a detector in the bundle, there's nothing to find faces with.

CategoryImpactPack/Simple

Inputs (31)

NameTypeDefaultDescription
imageIMAGE
detailer_pipeDETAILER_PIPEIf the `ImpactDummyInput` is connected to the model in the detailer_pipe, the inference stage is skipped.
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
denoiseFLOAT0.500.0001–1
featherINT50–100
noise_maskBOOLEANtrue
force_inpaintBOOLEANtrue
bbox_thresholdFLOAT0.500–1
bbox_dilationINT10-512–512
bbox_crop_factorFLOAT3.01–10
sam_detection_hintCOMBO9 options: center-1, horizontal-2, vertical-2, rect-4, diamond-4, mask-area, +3
sam_dilationINT0-512–512
sam_thresholdFLOAT0.930–1
sam_bbox_expansionINT00–1000
sam_mask_hint_thresholdFLOAT0.700–1
sam_mask_hint_use_negativeCOMBO3 options: False, Small, Outter
drop_sizeINT101–16384
refiner_ratioFLOAT0.200–1
cycleINT11–10
inpaint_modeloptBOOLEANfalse
noise_mask_featheroptINT200–100
scheduler_func_optoptSCHEDULER_FUNC
tiled_encodeoptBOOLEANfalse
tiled_decodeoptBOOLEANfalse

Outputs (6)

NameTypeDescription
imageIMAGE
cropped_refinedIMAGE
cropped_enhanced_alphaIMAGE
maskMASK
detailer_pipeDETAILER_PIPE
cnet_imagesIMAGE