Image Crop Face
Find a face, square-crop it, and know where to put it back
- image
- IMAGE
- CROP_DATA
A face that's 70 pixels wide in a 1024 frame is going to come out a smear no matter how good your checkpoint is - the latent has no budget to spend there. The fix is the classic one: crop the face region, give it its own high-resolution pass, paste it back. Image Crop Face is the front half of that loop: it finds a face in your image, cuts a square around it, and hands you the crop window so the back half (Image Paste Face) can drop the fixed face into the same spot.
This is WAS Node Suite's modern, no-install face crop. The original Image Crop Face ran through OpenCV and needed the package installed; this v3 replacement runs the same idea but executes the classifiers in torch on the device ComfyUI already uses - the "native" in the class name. The menu name didn't change, old workflows load into it, and nothing extra gets pip-installed.
How the detection works
The detector is a classic Haar-style cascade set that ships inside the pack (you'll see mention of "eight face cascades" bundled). The cascade dropdown picks which one runs first, with fallback through the others if it finds nothing:
defaultis the fastest of the frontalface set;alt/alt2/alt_treeget progressively stricter.profilefacefinds a head turned to the side;upperbodyframes head and shoulders;eyehunts a single eye.lbpcascade_animefaceis the one for drawn and anime faces - the real difference-maker if your subject isn't a photograph.
When several faces are found, the largest wins the crop. crop_padding_factor (default 0.25) decides how much room stays around the detection as a fraction of its size - 0.0 crops tight, 0.25 leaves a quarter of the face's size as margin, 2.0 pulls back to roughly include the shoulders. For a detail pass you want some padding so the re-render has surroundings to match against.
A batch is searched on its first image and every frame is cut to that same window - fine for a consistent subject, but don't point it at a video where the face drifts, because the window doesn't follow.
Outputs and the loop
You get IMAGE (the square crop, minimum 64px per side) and CROP_DATA (the window, for Image Paste Face). Two failure tells to know cold: when no face is found you get a black 512×512 placeholder image rather than an error, and CROP_DATA comes back as false - so route on that if you're automating. The crop feeds a face detailer or an inpaint pass, then Image Paste Face composites it back using the window you were given.
This is the same detect-crop-re-render-paste loop that packs like Impact and ReActor run with segmentation detectors and YOLO, with the honest trade: cascades are ancient computer vision - fast, deterministic, no install - but they're brittle on angles, glasses, and heavy stylization, and they can't tell you how confident they are. If faces are small, angled, or badly lit, you'll get better results from the pack's sibling Image Crop Face (YuNet), which runs a modern learned detector and reports a confidence score.
Install
WAS Node Suite via ComfyUI Manager (search "WAS Node Suite v3") or git clone https://github.com/WASasquatch/was-node-suite-comfyui into ComfyUI/custom_nodes, then restart - ComfyUI 0.14.0+, Python 3.10+. Nothing to download; the cascades ship in the repo and run on torch. If a saved pre-v3 workflow's old "Image Crop Face" opens missing, ComfyUI offers the swap to this replacement automatically - same name, same wiring, same padding and cascade settings.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | The image to search for a face in. A batch is searched on its first image and every image is then cut to that same window. | |
| crop_padding_factor | FLOAT | 0.250–2 | How much room to leave around the detected face, as a fraction of its size. 0.0 crops tight to the detection, 0.25 leaves a quarter of the face size as margin, and 2.0 pulls back far enough to include the shoulders. |
| cascade | COMBO | Which classifier to try first. 'lbpcascade_animeface' is for drawn and anime faces, the 'frontalface' set for photographs. If it finds nothing, the others are tried. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | The square face crop, at least 64 pixels on a side. A black 512x512 image when no face was found. |
| CROP_DATA | CROP_DATA | The crop window, for Image Paste Face to put the reworked face back in the right place. One window covers a whole batch. False when no face was found. |