Nodes/ComfyUI_RP_Cast/RP Regional Detailer (SDXL)
ComfyUI Node

RP Regional Detailer (SDXL)

The detailer pass where per-region LoRAs finally do their job

By AISeDam·Created 4 months ago·Updated 4 months ago· 4
RP Regional Detailer (SDXL)
  • image
  • model
  • clip
  • vae
  • regional_prompts_nolora
  • regional_lora_map
  • regional_col_n_row
  • negative
  • divide_mode
  • divide_ratio
  • image
  • debug_image
seed0
steps20
cfg5.0
sampler_name
scheduler
denoise0.50
feather0
noise_masktrue
force_inpainttrue
bbox_model
detect_threshold0.30
drop_size10
mask_padding32
mask_blur8
mask_dilation4
scale_to_pixel1024
use_basefalse
use_commontrue
debugfalse

What it is

The sampler gives you a good draft; this node makes each character look right. RP Regional Detailer (SDXL) is the pack's detect-and-inpaint refinement stage, in the direct lineage of ADetailer and Impact Pack's FaceDetailer: run a detector over the finished image, then give every found subject its own full-resolution inpainting pass. For regional prompting it's the payoff - this is where each region's LoRA actually gets applied in isolation, something the sampler fundamentally can't do.

How it works

Since v0.6.00 the flow is one clean YOLO pass:

  1. Run YOLO once over the full image, detecting people.
  2. Assign each bbox to a region by comparing its center coordinate against the divide_ratio boundaries - Horizontal, Vertical, and 2D grids all work.
  3. Two people land in the same region? The largest area wins; the rest get fallback inpainting using the base prompt (COMMON + BASE).
  4. For each assigned bbox: mask dilation + blur → upscale the crop (LANCZOS) → VAE encode → inpaint with that region's own prompt (COMMON + BASE + DIV) and its own LoRA → blend back through the mask.

That last point is the whole reason this node exists. Each region's LoRA is loaded independently before inpainting, so the blonde character's LoRA stays on the left and the other's stays on the right. Real isolation, at the cost of one inpaint pass per person.

The inputs you'll actually set

  • model, clip, vae, negative: your checkpoint plus a CONDITIONING negative.
  • regional_prompts_nolora, regional_lora_map: from the parser. regional_col_n_row: from RPRatioParser. divide_mode: from the parser.
  • bbox_model: bbox/person_yolov8m-seg.pt or the segm/ variant - the dropdown scans models/ultralytics/.
  • detect_threshold: 0.3 default YOLO confidence; lower it if people are being missed.
  • denoise: how much each region changes from the draft, 0.5 default.
  • scale_to_pixel: upscales small crops to this target (1024 default) before inpainting - this is what gives a 60px face real generation budget instead of a smudge.
  • mask_padding / mask_blur / mask_dilation / feather: the mask surgery dials; the defaults are sane, tweak only when edges misbehave.
  • use_base / use_common: match the parser.

Outputs

image (IMAGE) → your finished render. debug_image (IMAGE) overlays the detected bboxes and region assignment - invaluable when a person keeps getting assigned to the wrong region.

Dependencies and gotchas

This node is where the pack stops being dependency-light: it needs ultralytics and opencv-python (both in requirements.txt, marked optional - install them if the node complains). Put the YOLO .pt file in ComfyUI/models/ultralytics/bbox/; the dropdown auto-detects from that folder, so an empty dropdown means a wrong path. It's the standard detect-crop-refine pattern, so expect a first-run model download and, if you're on a small card, patience while each person gets their own pass.

CategoryRegional Prompter

Inputs (29)

NameTypeDefaultDescription
imageIMAGE
modelMODEL
clipCLIP
vaeVAE
regional_prompts_noloraRP_SUBPROMPTS
regional_lora_mapRP_LORA_MAP
regional_col_n_rowRP_REGIONS
negativeCONDITIONING
divide_modeRP_DIV_MODEHorizontal
seedINT00–18446744073709550000
stepsINT201–200
cfgFLOAT5.00–30
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
featherINT00–64Feather (soft edge) radius in pixels. Blends mask edges smoothly. Applied after dilation.
noise_maskBOOLEANtrueApply noise mask to latent before sampling. Helps preserve areas outside the inpainting region.
force_inpaintBOOLEANtrueForce inpainting mode regardless of model type. Recommended for best inpainting results.
bbox_modelCOMBO2 options: bbox/person_yolov8m-seg.pt, segm/person_yolov8m-seg.pt
detect_thresholdFLOAT0.300.1–1YOLO detection confidence threshold.
drop_sizeINT101–16384Minimum detection size (px). Bboxes with short side below this are ignored.
mask_paddingINT320–256Mask padding in pixels (image space).
mask_blurINT80–64Blur radius for mask edges.
mask_dilationINT40–64Mask dilation in pixels. Expands the mask boundary to widen the inpainting area.
scale_to_pixelINT102464–4096Target pixel size for upscaling. Masks smaller than this are upscaled before inpainting. Masks larger than this are processed as-is.
use_baseBOOLEANfalsePrepend BASE prompt to each COL prompt during processing.
use_commonBOOLEANtrue
debugBOOLEANfalsePrint debug log when enabled.
divide_ratiooptRP_DIV_RATIO1,1Connect divide_ratio from RPPromptParser.

Outputs (2)

NameTypeDescription
imageIMAGE
debug_imageIMAGE