Nodes/ikki Pack/Detailer KSampler ⚡
ComfyUI Node

Detailer KSampler ⚡

The inpainting KSampler that fixes one region, not the whole frame

By RedsAnalysis·Created 2 months ago·Updated about a month ago· 0
Detailer KSampler ⚡
  • model
  • positive
  • negative
  • vae
  • crop_image
  • crop_mask
  • crop_data
  • refiner_model
  • refiner_positive
  • refiner_negative
  • refined_crop_image
  • crop_mask
  • crop_data
seed0
steps20
cfg3.5
sampler_name
scheduler
denoise0.50
cycles1
noise_mask_feather2
inpaint_blend_feather8
refiner_ratio1.00

This is the heart of the Ikki detailer pipeline: the node that actually re-renders a cropped region. If you've used Impact Pack's Detailer or FaceDetailer, you know the shape of the job - take a small crop that a model couldn't resolve, give it a full-resolution sampling pass, and put it back. IkkiDetailerKSampler is that re-render step, written as a standalone KSampler that only ever touches the pixels you fed it as a crop.

Why reach for it over a plain KSampler? Because a stock KSampler runs on a full latent and happily redraws your whole image. This one takes a crop and a mask, and treats the mask as a noise mask - the region inside the mask gets redrawn, the region outside is denoised into a copy of the original. The end result is that only the masked area actually changes, which is the whole point of "only masked" inpainting and the entire reason a detail pass doesn't destroy the rest of the frame.

How it works

The crop image gets VAE-encoded into a latent. Your mask is resized down to latent resolution and applied as a noise mask, so sampling replaces the masked region while preserving the surrounding latent. After sampling, it decodes and - this is the nice touch - softly blends the refined pixels back with the original crop pixels using a feathered alpha, instead of pasting hard. That's the difference between a detail pass that looks baked in and one that looks painted on.

Inputs that matter

  • model, positive, negative, vae - your checkpoint and conditioning, exactly like a normal KSampler. Wire positive/negative from a CLIP Text Encode.
  • crop_image, crop_mask - the crop and mask from IkkiDetailerProcessor (or the previous cycle's output). Don't hand it a full image expecting it to crop for you.
  • seed - defaults to 0. Note the seeds increment per cycle (seed + 1000 per cycle), which is the anti-clone fix the detailing KB warns about: same seed per region across a crowd makes everyone look the same.
  • steps (20), cfg (3.5), sampler_name, scheduler, denoise (0.5) - the standard dials. The default denoise of 0.5 is a good middle ground for fixing details; drop to 0.3–0.4 if the crop comes back looking repainted.
  • cycles (1) - run the whole sample-and-blend loop multiple times, feeding each cycle's output back in. More cycles = more aggressive refinement, at linear cost.
  • noise_mask_feather (2) and inpaint_blend_feather (8) - feather the noise mask and the final blend respectively. Raise the blend feather if you see seams.
  • refiner_ratio (1.0) - set below 1.0 and supply the optional refiner_model/refiner_positive/refiner_negative to hand off the back half of sampling to a refiner, SD1.5-style.

Outputs are refined_crop_image, crop_mask, and crop_data - feed the first straight into IkkiCompositeBack along with the original image.

Installing and dependencies

Install via ComfyUI Manager (search "ikki") or:

cd ComfyUI/custom_nodes
git clone https://github.com/RedsAnalysis/comfyui-ikki-pack
# restart ComfyUI

No extra pip packages - this node only uses torch and ComfyUI internals. scipy is imported optionally and falls back to a torch blur if absent, so you're fine without it.

Common issues

  • The crop comes back grey or washed out - the classic VAE round-trip problem from the KB's detailing essay. Lower denoise, confirm you're feeding the right VAE for your model, and check CFG isn't wildly off from the base generation.
  • The whole crop changes, not just the masked area - your mask was probably all-white (maybe the processor returned the "empty mask" sentinel because detection found nothing). Give the sampler an actual mask with some black in it.
  • Refiner never runs - refiner_ratio must be strictly below 1.0 and you must supply a refiner model. Both conditions are required; the code checks both.

One caveat about the pack: the README documents only six of its twelve nodes, and the detailer pipeline isn't among them. This node works - the source is clean and standard common_ksampler under the hood - but you're learning it without the author's own tutorial, which is why the pipeline naming (Detector → Processor → Mask Editor → KSampler → Composite Back) matters.

CategoryIkki/Detailer Pipeline

Inputs (20)

NameTypeDefaultDescription
modelMODEL
positiveCONDITIONING
negativeCONDITIONING
vaeVAE
crop_imageIMAGE
crop_maskMASK
seedINT00–18446744073709550000
stepsINT201–10000
cfgFLOAT3.50–100
sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
denoiseFLOAT0.500–1
cyclesINT11–10
noise_mask_featherINT20–64
inpaint_blend_featherINT80–64
refiner_ratioFLOAT1.000–1
crop_dataoptCROP_DATA
refiner_modeloptMODEL
refiner_positiveoptCONDITIONING
refiner_negativeoptCONDITIONING

Outputs (3)

NameTypeDescription
refined_crop_imageIMAGE
crop_maskMASK
crop_dataCROP_DATA