Nodes/SAX Bridge/SAX Detailer
ComfyUI Node

SAX Detailer

One node that crops, redraws, and blends your problem areas back in

By so16tm·Created 6 months ago·Updated 3 months ago· 0
SAX Detailer
  • pipe
  • mask
  • PIPE_LINE
  • IMAGE
denoise0.45
cycle1
crop_factor3.0
noise_mask_feather5
blend_feather5
steps_override0
cfg_override0.0
guidance_modeoff
guidance_strength0.50
pag_strength0.00
positive_prompt

A face occupying 80 pixels of a 1024px frame comes out a smear no matter how good your checkpoint is - the latent simply has no budget to spend on it. The fix has always been the detect-crop-refine loop the KB's detailing doc describes: crop the region, run a fresh sampling pass on it at proper resolution, paste it back. SAX Detailer does that whole loop in one node. You feed it a pipe and a mask, it crops, redraws at denoise 0.45, and blends the result back with no visible seam. Append it to the end of a workflow and the soft faces, hands, and text that every generation leaves behind get their own private re-render.

The important difference from Impact Pack's FaceDetailer: that node detects the region with a YOLO. This one takes a mask you give it - from SAM 3 text segmentation, a hand-painted mask, or anywhere else. That's the right design for the SAX pipeline, because the pack leans on text-prompt segmentation rather than trained detectors, but it does mean the mask is your job. No mask connected? It details the whole image, which is a legitimate i2i pass and occasionally exactly what you want.

The inputs that matter

  • denoise (default 0.45) - how hard the redraw reimagines the region. 0.3–0.5 is the detailing sweet spot per the KB's inpainting rules: high enough to add detail, low enough to keep the subject. Above 0.5 you're rewriting, not refining.
  • cycle (default 1) - passes over the same region. More cycles = more refinement, linearly more time.
  • crop_factor (default 3) - how much context surrounds the crop. Too tight and the redraw has nothing to work with; 3 gives the sampler room.
  • noise_mask_feather and blend_feather (both default 5) - the seam controls. The first blurs the mask boundary in latent space, the second in image space. Raised together, they're the cure for visible patch edges.
  • Optional steps_override / cfg_override (0 = inherit from the loader) and positive_prompt (a per-detail override so you can, say, inject "detailed eyes").

The mechanism

The crop box is computed from the mask's bounding box and expanded by crop_factor. The pack encodes the cropped image to latent once, applies Differential Diffusion for the noise mask - that's the bit that makes boundary blending work without you hand-tuning mask blur, because the noise schedule itself varies with the mask - runs the i2i loop, and decodes once. Across multiple cycles, VAE encode/decode happens only once each and the latent is preserved between passes, so cycles aren't three times the encode overhead.

Guidance, built in

The same guidance_mode / guidance_strength / pag_strength trio as SAX Guidance appears here as optional inputs, so the detail pass can carry AGC (spike suppression for high CFG) or PAG (detail boost that works at any CFG) without a separate node. Set the mode on the detailer, not as an extra stage.

Where it goes - and the one rule

The KB's detailing doc is blunt about ordering, and SAX plays along: detail at native resolution before you upscale. The README's own pipeline is Loader → Prompt → KSampler → Upscaler → Enhanced Detailer → Output, which puts upscaling first - but that works because the Upscaler's i2i pass is gentle and the detailer still gets a full-res source to work from. If you upscale first with a strong denoise, you bake the mangled face into more pixels and then pay more to fix it. When in doubt: fix the face first, scale second.

Install is the pack clone:

cd ComfyUI/custom_nodes
git clone https://github.com/so16tm/SAX_Bridge

Then SAX/Bridge/Enhance → SAX Detailer. And if the basic version isn't enough, the Enhanced Detailer adds shadow/edge/latent-noise controls on top of everything here.

CategorySAX/Bridge/Enhance

Inputs (13)

NameTypeDefaultDescription
pipePIPE_LINE
denoiseFLOAT0.450–1
cycleINT11–10
crop_factorFLOAT3.01–10
noise_mask_featherINT50–100
blend_featherINT50–100
maskoptMASK
steps_overrideoptINT00–2000 = inherit steps from loader_settings. Values ≥1 override it.
cfg_overrideoptFLOAT0.00–1000.0 = inherit CFG from loader_settings. Values > 0 override it.
guidance_modeoptCOMBOoffCFG guidance enhancement. agc=spike suppression, fdg=detail emphasis, agc+fdg=both, post_fdg=low CFG.
guidance_strengthoptFLOAT0.500–1Guidance effect intensity. 0.0=none, 1.0=maximum.
pag_strengthoptFLOAT0.000–1Perturbed Attention Guidance. Works at any CFG. 0.5=standard. Adds one extra forward pass per step.
positive_promptoptSTRING

Outputs (2)

NameTypeDescription
PIPE_LINEPIPE_LINE
IMAGEIMAGE