HSWQ Batched Detailer (SEGS)
Face detailing without the model-swap whiplash
- image
- segs
- model
- clip
- vae
- positive
- negative
- detailer_hook
- scheduler_func_opt
- IMAGE
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:
- Phase 1 (VAE): crop + upscale + encode all segments - VAE loads once.
- Phase 2 (UNet): run KSampler on all the encoded latents - UNet loads once.
- 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:
imageandsegs- the source image and the segments to refine. You getsegsfrom a detector node. The README is clear that Impact Pack itself is not required at runtime - the node bundles its ownbatched_detailer_libhelpers - 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 anImpactDummyInputintomodel, 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.denoisedefaults 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.
Inputs (27)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| segs | SEGS | — | |
| model | MODEL | If the `ImpactDummyInput` is connected to the model, the inference stage is skipped. | |
| clip | CLIP | — | |
| vae | VAE | — | |
| guide_size | FLOAT | 51264–16384 | — |
| guide_size_for | BOOLEAN | true | — |
| max_size | FLOAT | 102464–16384 | — |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 201–10000 | — |
| cfg | FLOAT | 8.000–100 | — |
| sampler_name | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| scheduler | COMBO | 17 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +11 | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| denoise | FLOAT | 0.500.0001–1 | — |
| feather | INT | 50–100 | — |
| noise_mask | BOOLEAN | true | — |
| force_inpaint | BOOLEAN | true | — |
| wildcard | STRING | — | |
| cycle | INT | 11–10 | — |
| detailer_hookopt | DETAILER_HOOK | — | |
| inpaint_modelopt | BOOLEAN | false | — |
| noise_mask_featheropt | INT | 200–100 | — |
| scheduler_func_optopt | SCHEDULER_FUNC | — | |
| tiled_encodeopt | BOOLEAN | false | — |
| tiled_decodeopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |