Detailer KSampler ⚡
The inpainting KSampler that fixes one region, not the whole frame
- model
- positive
- negative
- vae
- crop_image
- crop_mask
- crop_data
- refiner_model
- refiner_positive
- refiner_negative
- refined_crop_image
- crop_mask
- crop_data
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_ratiomust 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.
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| vae | VAE | — | |
| crop_image | IMAGE | — | |
| crop_mask | MASK | — | |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 201–10000 | — |
| cfg | FLOAT | 3.50–100 | — |
| sampler_name | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| scheduler | COMBO | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 | |
| denoise | FLOAT | 0.500–1 | — |
| cycles | INT | 11–10 | — |
| noise_mask_feather | INT | 20–64 | — |
| inpaint_blend_feather | INT | 80–64 | — |
| refiner_ratio | FLOAT | 1.000–1 | — |
| crop_dataopt | CROP_DATA | — | |
| refiner_modelopt | MODEL | — | |
| refiner_positiveopt | CONDITIONING | — | |
| refiner_negativeopt | CONDITIONING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| refined_crop_image | IMAGE | — |
| crop_mask | MASK | — |
| crop_data | CROP_DATA | — |