Nodes/ComfyUI-HSWQ-Loader-and-Tools/HSWQ Batched Detailer (SEGS)
ComfyUI Node

HSWQ Batched Detailer (SEGS)

Face detailing without the model-swap whiplash

By ussoewwin·Created 9 months ago·Updated a day ago· 17
HSWQ Batched 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 nodes are the reason small faces stop being ruined - detect a region, crop it, run a fresh sampling pass at proper resolution, paste it back. Impact Pack's Detailer (SEGS) / DetailerForEach made that loop standard ComfyUI practice. The problem is the loop's shape: for every segment it does VAE encode → KSampler → VAE decode, which means the VAE gets loaded, then the UNet, then the VAE again, per segment. On a workflow using Dynamic VRAM loading, that's model-swap whiplash - with a dozen detected faces you're paying the load/unload tax a dozen times, and the stalls get brutal once CUDA graphs are in play.

This node keeps the Impact Pack SEGS interface but restructures the loop into three phases:

  1. Phase 1 (VAE): crop + upscale + encode all segments - VAE loads once.
  2. Phase 2 (UNet): run KSampler on all the encoded latents - UNet loads once.
  3. Phase 3 (VAE): decode everything and paste back - VAE loads once.

Model switches drop from O(3n) to O(2), full stop, regardless of how many segments get detected. The author built it specifically so the pattern stays usable with HSWQ-quantized UNets (ConvRot INT8/NVFP4, Dynamic VRAM, QuantizedTensor paths), which is where this pack lives.

The honest caveat

The README admits the one behavioral difference: the original DetailerForEach processes overlapping segments sequentially, cropping later segments from the already-pasted image. The batched version crops all segments from the original image before any pasting. For face detection - which is non-overlapping - the output is identical. For overlapping segments it can differ slightly. If you're doing overlapping region refinement, keep that in mind; for faces, don't worry about it.

The inputs that matter

It's the full Detailer (SEGS) parameter set, so a beginner only needs a handful:

  • image and segs - the source image and the segments to refine. You get segs from a detector node. The README is clear that Impact Pack itself is not required at runtime - the node bundles its own batched_detailer_lib helpers - but you still need some SEGS producer. Impact Pack's BBOX/SAM detector nodes are the obvious source, or any other pack that emits SEGS.
  • model, clip, vae - the model stack for the refinement pass. One useful trick from the tooltip: if you wire an ImpactDummyInput into model, the inference stage is skipped entirely - handy for testing the detection/pasting plumbing without sampling.
  • steps, cfg, sampler_name, scheduler, denoise, seed - the sampling settings for the detail pass. denoise defaults to 0.5, which is the classic detail-pass value: enough to clean up the region, not enough to rewrite it.
  • guide_size (512) / guide_size_for / max_size (1024) - how big the cropped region is scaled before sampling.
  • wildcard, cycle (1) - wildcard prompt support and how many refinement cycles to run.
  • Optional: detailer_hook, inpaint_model, noise_mask_feather, scheduler_func_opt, tiled_encode, tiled_decode - leave these alone until you know you need them.

Output is a single IMAGE with the refined segments pasted back in.

Installing it

Standard pack install - ComfyUI Manager (search "HSWQ"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/ussoewwin/ComfyUI-HSWQ-Loader-and-Tools

then restart. Expect the pack's heavy requirements.txt to install either way; it includes face-detection dependencies (insightface, facexlib, onnxruntime) that sit oddly with a loader pack but exist for exactly this node's ecosystem. One thing to note for the tinkering types: this node is GPL-3.0 derived work from ltdrdata's Impact Pack, which the README credits openly - the copyright isn't being hidden, it's being honored, and you should keep that notice if you redistribute it.

If you have very few segments, this node's advantage shrinks - at one segment it's just a Detailer (SEGS) with extra plumbing. Its payoff scales with how many faces (or hands, or whatever your detector finds) you're fixing per image and how much you care about Dynamic VRAM thrash.

CategoryHSWQ/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