Face Fixer OpenCV (Mikey)
Face Fixer OpenCV (Mikey Nodes) — a self-contained face fix without a YOLO model
- image
- base_model
- vae
- positive_cond_base
- negative_cond_base
- image
Small, distant faces coming out mangled is one of the oldest, most structural problems in diffusion generation - the face just doesn't get enough latent pixels to resolve properly. The standard ComfyUI answer to that is Impact Pack's FaceDetailer, which detects faces with a trained YOLO model and inpaints each one at full resolution. This node solves the same problem with a much older, much lighter piece of tech: OpenCV's Haar cascade classifiers.
The mechanism, and how it differs from the usual approach
Haar cascades are a pre-deep-learning face detection algorithm that's shipped inside OpenCV for years - no separate model download required, because the classifier files come bundled with the library itself. This node runs one over your image, crops around each detection with your chosen padding and scale_factor headroom, resizes the crop to face_img_resolution, runs it through a full sampling pass with the model/vae/conditioning you feed in, and composites the result back onto the original image.
That's a meaningfully different trade-off from the YOLO-based route. YOLO detectors are trained specifically for the job and handle odd angles, partial occlusion, and stylized art much better - it's why Impact Pack's FaceDetailer is the community's default. Haar cascades are older, faster to run, need no extra model file, and can be noticeably less reliable at anything other than a roughly front-facing, well-lit face. The classifier dropdown reflects that heritage directly: alongside combined (the default, presumably layering several detectors) and an animeface option for stylized art, most of the choices are literal haarcascade_*.xml filenames - frontalface_default, profileface, frontalface_alt, even non-face options like upperbody, fullbody, frontalcatface, and hands. If detection quality on a specific image matters more than speed or simplicity, that's the honest reason to reach for Impact Pack's FaceDetailer instead.
The inputs that matter
image,base_model,vae,positive_cond_base,negative_cond_base- the same ingredients a normal KSampler pass needs, since this node is running a real inpainting sample internally, not just a filter.classifier- which detector to use;combinedis the sensible default,animefaceif your source is stylized art rather than photorealistic.padding(default 32) andscale_factor(default 1.2) - how much extra room the crop gets around the detected face box, which matters because too tight a crop clips hair or jaw and too loose wastes resolution on background.min_neighbors(default 8) - a Haar-cascade-specific detection strictness knob; higher values mean fewer false positives but a higher chance of missing a real face, lower values catch more faces but risk detecting things that aren't faces at all.denoise(default 0.5),steps,cfg,sampler_name(defaultdpmpp_2m_sde),scheduler(defaultkarras) - standard sampling controls for the inpaint pass itself.
Single output: a fixed image.
Installing
Comes with the full Mikey Nodes pack - ComfyUI Manager, search "Mikey Nodes," install, restart, or cd ComfyUI/custom_nodes && git clone https://github.com/bash-j/mikey_nodes and restart manually. Because it depends on OpenCV's face detection module, make sure opencv-python (or opencv-contrib-python) actually installed correctly alongside the pack - this is the one node in the pack most likely to complain on startup if that dependency is missing or conflicting with another node's OpenCV requirement.
Where it goes wrong
- Faces not detected at all. Haar cascades are genuinely weaker at side profiles, extreme angles, or low-contrast lighting than a modern YOLO detector - if
min_neighborsat default settings misses faces, try lowering it, or switch classifiers (frontalface_alt2behaves differently thanfrontalface_defaultin practice). - False positives on non-face regions. The flip side of a lenient
min_neighbors- texture or shadow patterns occasionally get flagged as faces. Raisemin_neighborsif this happens. cv2import errors on startup. A missing or broken OpenCV install is the most likely cause if this node (and only this node) fails to load - reinstallopencv-pythonin your ComfyUI environment if the console shows an import error pointing atcv2.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| base_model | MODEL | — | |
| vae | VAE | — | |
| positive_cond_base | CONDITIONING | — | |
| negative_cond_base | CONDITIONING | — | |
| seed | INT | 00–18446744073709550000 | — |
| face_img_resolution | INT | 1024512–2048 | — |
| padding | INT | 320–512 | — |
| scale_factor | FLOAT | 1.20.1–10 | — |
| min_neighbors | INT | 81–100 | — |
| denoise | FLOAT | 0.500–1 | — |
| classifier | COMBO | combined | 11 options: animeface, combined, haarcascade_frontalface_default.xml, haarcascade_profileface.xml, haarcascade_frontalface_alt.xml, haarcascade_frontalface_alt2.xml, +5 |
| sampler_name | COMBO | dpmpp_2m_sde | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 |
| scheduler | COMBO | karras | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 |
| cfg | FLOAT | 7.00–1000 | — |
| steps | INT | 301–1000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |