RP Regional Detailer (Z-Image)
The 16-channel detailer
- image
- model
- clip
- vae
- regional_prompts_nolora
- regional_lora_map
- negative
- divide_mode
- divide_ratio
- image
- debug_image
Why Z-Image needs its own detailer
Z-Image - Alibaba's 6B model that put near-Flux quality on 12GB cards - doesn't play by SDXL rules. It uses 16-channel latents, an AuraFlow-style sigma schedule, and a 32px latent grid, so you can't just reuse the SDXL detailer's VAE path. This node is the Z-Image/Qwen regional detailer, and for Z-Image workflows the README's division of labor is explicit: keep a plain ComfyUI KSampler for the base image, then run this node after. The pack removed its own Z-Image sampler entirely, so this detailer is the Z-Image half of the regional stack.
How it differs from the SDXL detailer
Same single full-image YOLO pass and bbox-center-to-region assignment, then the crop pipeline goes through Z-Image's 16-channel VAE with crop sizes auto-generated from the detection. Two genuinely new tricks:
- WD14 ONNX gender classification: a Danbooru tagger runs on each detected bbox (boy/girl scores) and auto-selects the best-matching region prompt. This is how "girl on the left, boy on the right" tends to land correctly without you babysitting masks. The ONNX model auto-downloads into the pack's
data/wd14/folder on first use - don't be surprised by a multi-hundred-MB download landing in a directory you didn't know existed. - AuraFlow
shift: the sigma shift lever. Z-Image Turbo is happiest around 3–6; too low and regions look undercooked, too high and the composition loses coherence.
Settings worth knowing
- steps: 6~10 for Z-Image Turbo (not the 20 you'd use on SDXL).
- cfg: 1.0 - distilled models don't want classifier-free guidance; this is the same rule that applies to Lightning/Turbo variants everywhere.
- denoise: 0.35–0.55, the pack's recommended range for the inpaint passes.
- force_inpaint: leave on - it forces inpainting mode regardless of model type, which the tooltip flags as best for results.
- bbox_model / detect_threshold / scale_to_pixel: same story as the SDXL detailer; YOLO file lives in
models/ultralytics/bbox/.
The wiring
The standard chain: RPPromptParser → RPRatioParser → KSampler → this node with model/clip/vae, the region data, and a negative CONDITIONING. Outputs are image and a debug_image with the detection overlay. Region prompts are encoded as COMMON + BASE + DIV - same as the SDXL node, no scene-narrative merging. Requires ultralytics, opencv-python, and onnxruntime (for the WD14 classifier), all in requirements.txt.
Inputs (29)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| model | MODEL | — | |
| clip | CLIP | — | |
| vae | VAE | — | |
| regional_prompts_nolora | RP_SUBPROMPTS | — | |
| regional_lora_map | RP_LORA_MAP | — | |
| negative | CONDITIONING | — | |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 81–50 | Recommended for Z-Image Turbo: 6~10. |
| cfg | FLOAT | 1.00–30 | Recommended for Z-Image Turbo: 1.0. |
| 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 | img2img denoise strength. 0.35~0.55 recommended. |
| feather | INT | 00–64 | Feather (soft edge) radius in pixels. Blends mask edges smoothly. Applied after dilation. |
| noise_mask | BOOLEAN | true | Apply noise mask to latent before sampling. Helps preserve areas outside the inpainting region. |
| force_inpaint | BOOLEAN | true | Force inpainting mode regardless of model type. Recommended for best inpainting results. |
| shift | FLOAT | 3.00–20 | AuraFlow sigma shift. Z-Image Turbo recommended: 3~6. |
| bbox_model | COMBO | 2 options: bbox/person_yolov8m-seg.pt, segm/person_yolov8m-seg.pt | |
| detect_threshold | FLOAT | 0.300.1–1 | — |
| drop_size | INT | 101–16384 | Minimum detection size (px). Bboxes with short side (min(w,h)) below this are ignored. Same criterion as Impact Pack FaceDetailer. |
| mask_padding | INT | 320–256 | — |
| mask_blur | INT | 80–64 | — |
| mask_dilation | INT | 40–64 | — |
| scale_to_pixel | INT | 102464–4096 | Target pixel size for upscaling. Masks smaller than this are upscaled before inpainting. Masks larger than this are processed as-is. |
| use_base | BOOLEAN | false | Prepend BASE prompt to each COL prompt during processing. |
| use_common | BOOLEAN | true | — |
| debug | BOOLEAN | false | Print debug log when enabled. |
| divide_modeopt | RP_DIV_MODE | Horizontal | Connect divide_mode from RPPromptParser. |
| divide_ratioopt | RP_DIV_RATIO | Connect divide_ratio from RPPromptParser. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| debug_image | IMAGE | — |