Nodes/SimpleSyrup/Detail SEGS by Scale Factor
ComfyUI Node

Detail SEGS by Scale Factor

The FaceDetailer-Style Crop-Refine Loop, with Per-Region Prompts

By Artificial-Sweetener·Created 3 months ago·Updated 12 days ago· 2
Detail SEGS by Scale Factor
  • image
  • segs
  • model
  • vae
  • positive
  • negative
  • image
scale_factor1.5
upscale_methodlanczos
clamp_size0
seed0
steps20
cfg8.0
sampler_name
scheduler
denoise0.50
feather5
noise_masktrue
noise_mask_feather20
tiled_encodefalse
tiled_decodefalse

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_size and/or turn on tiled_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.

CategorySimpleSyrup/Detailing

Inputs (20)

NameTypeDefaultDescription
imageIMAGESource image containing the regions to improve. Detailed crops are blended back into this image.
segsSEGSSEGS regions that choose which parts of the image are detailed.
modelMODELDiffusion model used to resample each detailed crop.
vaeVAEVAE used to encode crops to latents and decode the edited crops.
positiveCONDITIONING,CONDITIONING_BATCHPositive conditioning for detailing. A conditioning batch is matched to SEGS order.
negativeCONDITIONING,CONDITIONING_BATCHNegative conditioning for detailing. A conditioning batch is matched to SEGS order.
scale_factorFLOAT1.51–5Crop enlargement multiplier. Larger values give the sampler more detail room but use more memory.
upscale_methodCOMBOlanczosResize method for scaled crops. Sharper methods preserve detail but can show more ringing.
clamp_sizeINT00–16384Maximum crop size in pixels after scaling. Use 0 to leave crop size unclamped.
seedINT00–18446744073709550000Seed used to create sampling noise. Reusing it with matching settings makes results repeatable.
stepsINT201–10000Number of denoising steps. More steps can add refinement but take longer.
cfgFLOAT8.00–100Prompt guidance strength. Higher values follow the positive prompt more strongly but can look overcooked.
sampler_nameCOMBOSampling algorithm. It affects the image's look, speed, and stability.
schedulerCOMBONoise schedule used during sampling. It changes how quickly structure and detail form.
denoiseFLOAT0.500–1Sampling strength. Lower values preserve the input more; higher values allow larger changes.
featherINT50–512Mask edge softness in pixels. Higher values blend edits more gently into the image.
noise_maskBOOLEANtrueLimit sampling noise to the selected mask area so unchanged pixels stay more stable.
noise_mask_featherINT200–512Noise mask edge softness in pixels. Higher values make the sampled area fade out more gradually.
tiled_encodeBOOLEANfalseEncode large crops in tiles. This lowers memory use but is usually slower.
tiled_decodeBOOLEANfalseDecode large crops in tiles. This lowers memory use but is usually slower.

Outputs (1)

NameTypeDescription
imageIMAGEImage with the detailed regions blended back into place.