Ultralytics Enhancer (CRT)
Ultralytics Enhancer (CRT)
- image
- model
- positive
- negative
- vae
- enhanced_image
- enhanced_face
- cropped_face_before
- enhanced_face_alpha
- base_face_alpha
Ultralytics Enhancer (CRT) is a one-node face detailer: detect every face with a YOLO segmentation model, crop each one, upscale the crop, run a fresh low-step sampling pass on it, and composite the result back with a feathered mask and color matching. If you've used Impact Pack's FaceDetailer or A1111's ADetailer, you know the pattern - this is the CRT take on it, wrapped into a single node with the detect-crop-refine loop hidden inside.
It exists because of the same structural problem the KB documents for detailing: a face occupying 80×80 pixels of a 1024² render gets 80×80 worth of model attention, so it comes out soft or mangled no matter how good your checkpoint is. The fix is always to give that region its own pass at proper resolution. What distinguishes this node is how opinionated it is about that pass. Defaults are tuned for low-step distilled models - sampler_name lcm, cfg 1.0, steps 2 - which is the FLUX-era workflow: a two-step refine with the model's own distill schedule, not a heavy SD1.5-style ten-step re-render.
Mechanically it's a pipeline you can almost read off the input list. First it runs your segmentation model over the image (face_segm_model from models/ultralytics/segm, segm_threshold for confidence). Each detection becomes a crop, tightened by pre_crop_factor, expanded by grow_crop, and upscaled to upscale_megapixel (default 1.5 MP) so the sampling pass has real pixel budget. The refine itself is a two-stage schedule (stage1_sigma_start/stage2_sigma_end, details_amount_stage1/2) with optional noise injection mid-schedule (enable_noise_injection, injection_point, injection_strength) - the "injection" in the class name. Then the enhanced face is blended back with enhancement_mix (0.0 = keep original, 1.0 = full enhancement) and color_match_strength, with post_mask_expand, post_mask_blur and post_mask_taper_borders controlling how the patched region feathers into the original so there's no hard clipping line.
Inputs a beginner actually sets: image, model (your checkpoint), positive (keep it short - a face prompt), face_segm_model (pick the YOLO segm file you've dropped in), segm_threshold, upscale_megapixel, enhancement_mix, and color_match_strength. resize_back_to_original is worth knowing: on by default it puts the refined crop back at the original size; turn it off and the whole input gets upscaled so the refined crops keep extra detail - with multi_face_resolution_strategy deciding the global scale for multi-face shots. edit_model_flux2klein switches on per-crop reference-latent conditioning if you're using an edit model. Optional negative and vae plug in if your setup uses them.
Outputs: enhanced_image (the composited result - the one you actually use), plus enhanced_face, cropped_face_before, and the two alpha layers (enhanced_face_alpha, base_face_alpha) if you want to build your own composite instead of trusting the default.
Install is the pack's, with one extra step: the detection path needs a YOLO segmentation .pt model sitting in models/ultralytics/segm (the folder CRT registers at startup) - the node's dropdown is empty until you put one there, and the bbox-format models/ultralytics/bbox folder is used by related nodes. That brings the dependency you should actually care about: ultralytics. Beyond it being in the pack's requirements, the KB flags the December 2024 Ultralytics supply-chain compromise that reached ComfyUI via Impact Pack. Pin ultralytics to a post-incident version and install through trusted channels, not random wheels.
Troubleshooting, grounded in the code: if you see "No detections found" in the console, either the model path is wrong, the folder's empty, or segm_threshold is too strict - drop it toward 0.3. Defaults assume a distilled/flow-matching model at cfg 1; if you're running a standard SDXL checkpoint, raise steps and cfg or the faces will look unfinished. And if the patch is visible, bump post_mask_blur and post_mask_taper_borders before you touch enhancement_mix.
Inputs (34)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| face_segm_model | COMBO | 0 options: | |
| segm_threshold | FLOAT | 0.500–1 | — |
| grow_crop | INT | 00–512 | Expands each detected crop region by this many pixels before enhancement |
| model | MODEL | — | |
| positive | CONDITIONING | — | |
| sampler_name | COMBO | lcm | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 |
| scheduler | COMBO | simple | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 |
| cfg | FLOAT | 1.00–100 | Classifier Free Guidance scale. Higher values follow the prompt more closely. |
| steps | INT | 21–100 | — |
| denoise | FLOAT | 1.000–1 | Amount of denoising to apply. 1.0 = full denoising (txt2img), 0.5-0.8 typical for img2img. |
| seed | INT | 10–18446744073709550000 | — |
| edit_model_flux2klein | BOOLEAN | false | Enable per-crop reference latent conditioning for edit models like flux2klein |
| upscale_megapixel | FLOAT | 1.50.1–16 | Target megapixels used to upscale each crop before enhancement |
| resize_back_to_original | BOOLEAN | false | If disabled, the whole input is upscaled so refined crops can keep higher detail |
| multi_face_resolution_strategy | COMBO | optimal | Used only when resize_back_to_original is False to decide global upscale for multi-face inputs |
| pre_crop_factor | FLOAT | 1.000.1–1 | Tightens each SEGS crop around its center before enhancement. Lower is tighter. |
| post_mask_expand | INT | 10-64–64 | — |
| post_mask_blur | FLOAT | 12.00–64 | — |
| post_mask_taper_borders | INT | 80–128 | Fades the mask edges to black to prevent hard clipping lines |
| stage1_sigma_factor | FLOAT | 1.0100–100 | — |
| stage2_sigma_factor | FLOAT | 0.9900–100 | — |
| stage1_sigma_start | FLOAT | 0.1000–1 | — |
| stage2_sigma_end | FLOAT | 1.0000–1 | — |
| details_amount_stage1 | FLOAT | 0.05-5–5 | — |
| details_amount_stage2 | FLOAT | 0.10-5–5 | — |
| enable_noise_injection | COMBO | enable | Enable noise injection during sampling |
| injection_point | FLOAT | 0.500–1 | Percentage of steps after which to inject noise |
| injection_strength | FLOAT | 0.05-20–20 | Strength of injected noise |
| normalize_injected_noise | COMBO | enable | Normalize injected noise to match latent statistics |
| enhancement_mix | FLOAT | 1.000–1 | Mix between original (0.0) and enhanced (1.0) face. 0.5 = 50/50 blend |
| color_match_strength | FLOAT | 1.000–2 | Strength of color matching between original and enhanced face. 0.0 = disabled, 1.0 = full matching |
| negativeopt | CONDITIONING | — | |
| vaeopt | VAE | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| enhanced_image | IMAGE | — |
| enhanced_face | IMAGE | — |
| cropped_face_before | IMAGE | — |
| enhanced_face_alpha | IMAGE | — |
| base_face_alpha | IMAGE | — |