Detail SEGS by Scale Factor
The FaceDetailer-Style Crop-Refine Loop, with Per-Region Prompts
- image
- segs
- model
- vae
- positive
- negative
- image
The detect-crop-refine-paste loop is the most load-bearing idea in modern image generation: a face that only occupies 80×80 pixels of a big frame gets 80×80 pixels worth of model attention and comes out mangled, so you crop it, sample the crop at proper resolution, and blend it back. Impact Pack made that standard practice in ComfyUI. Detail SEGS by Scale Factor is SimpleSyrup's take on the same loop, with one genuine upgrade: it accepts a CONDITIONING_BATCH for positive and negative, so each detected region can carry its own prompt instead of every region being refined with the same one.
How it works
The node takes the image, the segs regions (Impact-compatible, so anything from SimpleSyrup or Impact detectors works), a model and vae, and conditioning. For each region it: enlarges the crop by scale_factor (default 1.5), samples it with the standard sampler controls (seed, steps 20, cfg 8, sampler_name, scheduler, denoise 0.5), shrinks it back, and composites it into the source image. The conditioning batch is matched one-to-one against SEGS order - region 0 pairs with batch entry 0, region 1 with entry 1, and so on. If you want each region to keep its own identity during the pass, that per-region batch is where you say so.
Key controls for the composite:
- upscale_method (lanczos): the crop resize filter. Sharper methods keep more detail but can ring.
- clamp_size (0): caps the crop size in pixels after scaling. Set it when a huge region would otherwise blow past your VRAM.
- feather (5): mask-edge softness for the blend-back.
- noise_mask (on) + noise_mask_feather (20): keep sampling noise inside the region so untouched pixels don't drift.
- tiled_encode / tiled_decode (off): tile the VAE for very large crops - saves memory, costs time.
Output is one image with the detailed regions composited back.
The honest guidance
This is the node to reach for when regions are small and the rest of the image is fine - faces, hands, eyes in an otherwise-finished render. It's the direct descendant of the ADetailer/FaceDetailer pattern, and the same rules apply: fix regions at native resolution before upscaling (upscaling bakes defects in), don't chain pass after pass (each one round-trips the VAE and degrades the canvas), and don't expect a miracle on a face that's already large and sharp - a second pass mostly costs time. And the classic crowd trap: if you detail several similar regions in one batch, they can converge toward looking alike; varied per-region prompts help.
For scene-wide refinement where regions should stay aware of the whole image, the sibling node Detail SEGS as Regions does a full-canvas regional pass instead of isolated crops.
Install
Part of the SimpleSyrup pack. ComfyUI Manager → search SimpleSyrup → Install → restart, or:
Set-Location ComfyUI\custom_nodes
git clone https://github.com/Artificial-Sweetener/SimpleSyrup.git
Set-Location SimpleSyrup
..\..\venv\Scripts\python.exe -m pip install -r requirements.txt
Restart ComfyUI. Needs a current build (v3 extension API). The pack's requirements add TorchLanc, Ultralytics, ONNX Runtime and Segment Anything.
Common issues
- Grey or mismatched box around a fixed region - the classic VAE round-trip seam. Raise
feather, confirm the right VAE is loaded. - Region gets the wrong prompt - batch order vs. SEGS order. Count both.
- Out of memory - raise
clamp_sizeand/or turn ontiled_encode/tiled_decode. - Regions all start to look the same - per-region prompts + seed variety, not a single shared prompt.
It's the workhorse detailer - nothing exotic, just the standard loop done well, with per-region prompting as the differentiator.
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Source image containing the regions to improve. Detailed crops are blended back into this image. | |
| segs | SEGS | SEGS regions that choose which parts of the image are detailed. | |
| model | MODEL | Diffusion model used to resample each detailed crop. | |
| vae | VAE | VAE used to encode crops to latents and decode the edited crops. | |
| positive | CONDITIONING,CONDITIONING_BATCH | Positive conditioning for detailing. A conditioning batch is matched to SEGS order. | |
| negative | CONDITIONING,CONDITIONING_BATCH | Negative conditioning for detailing. A conditioning batch is matched to SEGS order. | |
| scale_factor | FLOAT | 1.51–5 | Crop enlargement multiplier. Larger values give the sampler more detail room but use more memory. |
| upscale_method | COMBO | lanczos | Resize method for scaled crops. Sharper methods preserve detail but can show more ringing. |
| clamp_size | INT | 00–16384 | Maximum crop size in pixels after scaling. Use 0 to leave crop size unclamped. |
| seed | INT | 00–18446744073709550000 | Seed used to create sampling noise. Reusing it with matching settings makes results repeatable. |
| steps | INT | 201–10000 | Number of denoising steps. More steps can add refinement but take longer. |
| cfg | FLOAT | 8.00–100 | Prompt guidance strength. Higher values follow the positive prompt more strongly but can look overcooked. |
| sampler_name | COMBO | Sampling algorithm. It affects the image's look, speed, and stability. | |
| scheduler | COMBO | Noise schedule used during sampling. It changes how quickly structure and detail form. | |
| denoise | FLOAT | 0.500–1 | Sampling strength. Lower values preserve the input more; higher values allow larger changes. |
| feather | INT | 50–512 | Mask edge softness in pixels. Higher values blend edits more gently into the image. |
| noise_mask | BOOLEAN | true | Limit sampling noise to the selected mask area so unchanged pixels stay more stable. |
| noise_mask_feather | INT | 200–512 | Noise mask edge softness in pixels. Higher values make the sampled area fade out more gradually. |
| tiled_encode | BOOLEAN | false | Encode large crops in tiles. This lowers memory use but is usually slower. |
| tiled_decode | BOOLEAN | false | Decode large crops in tiles. This lowers memory use but is usually slower. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Image with the detailed regions blended back into place. |