Nodes/ikki Pack/Detailer Processor ⌨️
ComfyUI Node

Detailer Processor ⌨️

Turn detector output into one crop you can actually detail

By RedsAnalysis·Created 2 months ago·Updated about a month ago· 0
Detailer Processor ⌨️
  • image
  • segs
  • override_mask
  • crop_image
  • crop_mask
  • crop_data
  • full_preview_mask
target_index-1
crop_factor1.5
padding32
mask_dilation0
mask_blur4
invert_maskfalse

A detector hands you a pile of detections - a set of segments, each with a bounding box, a mask, and a label. That's not directly usable by a sampler. IkkiDetailerProcessor is the node that sits between detection and sampling: it takes those segments (SEGS) plus the original image and produces the one crop, one mask, and one coordinate payload that the rest of the pipeline needs.

In Impact Pack terms, this is the "extract the region" step that DetailerForEach does internally, exposed as its own node. It's useful precisely because Impact's version hides this behind a monolithic node - here you can see exactly what crop is going to get re-rendered, feed it into a visual mask editor, or override the mask before it ever reaches the sampler.

How it works

It reads the SEGS payload (the same shape Impact Pack uses: (image_shape, [segments])), then either combines all segments into a single bounding region or picks one by index. It expands that region by crop_factor and padding, rounds to multiples of 8 (model-friendly), and crops the image and mask accordingly. The mask can be dilated, blurred, or inverted before it's returned. If there are zero segments, it deliberately returns the whole image with an all-black mask - so downstream sampling runs but changes nothing, instead of crashing on an empty crop.

Inputs that matter

  • image - the original full image.
  • segs - the SEGS / detection data from IkkiUltralyticsDetector (or any SEGS producer). This is the only input type that isn't a plain tensor, so expect the weird wire color.
  • target_index - which segment to crop. The key one: -1 (default) means combine all segments into one bounding crop. Use 0, 1, 2… to target the nth detection individually (the processor clamps out-of-range indexes to 0).
  • crop_factor (1.5) - how much context around the detection to include. More context helps the sampler, but too much dilutes the detail pass. This is the input people actually tune.
  • padding (32) - extra fixed pixels around the crop, beyond the factor.
  • mask_dilation (0), mask_blur (4), invert_mask (off) - post-process the mask. Blur is your friend for avoiding seams; invert if you're detailing the background instead of the subject.
  • override_mask (optional) - replace the detected mask entirely with your own. Wire an IkkiMaskEditor output here to detail a hand-drawn region.

Outputs: crop_image, crop_mask, crop_data, and full_preview_mask (the mask at full image size, for previewing what got selected before you burn sampling time on it).

Installing

The whole pack installs 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 for this node itself. scipy is optional (falls back to torch blur if missing).

Common issues

  • Nothing gets detailed - you likely hit the "empty mask" path: the detector found zero segments. Check the detector's dropdown (if it says NO_MODELS_FOUND, that's the real problem - see IkkiUltralyticsDetector) and lower its threshold.
  • The crop is huge and the detail pass does nothing visible - crop_factor and padding are eating your resolution budget. A face detected at 70px with a 2.5× factor gives the sampler a 175px subject to fix, which is barely more than it had before.
  • I want to detail one face out of five - set target_index to that face's index and use the full_preview_mask output to confirm you got the right one before sampling.
  • Seams around the patch - this is downstream (compositing) but the fix starts here: keep the mask blur non-zero.

Fair warning that applies to the whole pipeline: this pack's README documents only six of its twelve nodes and the detailer chain isn't among them. The code is solid and Impact-compatible in spirit, but you're on your own for a tutorial - read the node names, they describe the loop.

CategoryIkki/Detailer Pipeline

Inputs (9)

NameTypeDefaultDescription
imageIMAGE
segsSEGS,DETECTION_DATA
target_indexINT-1-1–100
crop_factorFLOAT1.51–5
paddingINT320–512
mask_dilationINT0-100–100
mask_blurINT40–64
invert_maskBOOLEANfalse
override_maskoptMASK

Outputs (4)

NameTypeDescription
crop_imageIMAGE
crop_maskMASK
crop_dataCROP_DATA
full_preview_maskMASK