Crop Center with SEGS
A Square, Centered Face Crop in One Node
- segs
- image
- IMAGE
Most diffusion models want square images, and most face detectors give you rectangles. This node is the bridge: give it a SEGS stream and the original image, and it crops a square centered on the detected face - then snaps the crop to a multiple of 8 so it'll behave when it hits a VAE. It's the one-node version of the "detect face, center it, square-crop it" dance you'd otherwise build from Impact Pack primitives.
It ships in ComfyUI-off-suite, Off-Live's small personal pack of face-crop utilities. It has a twin - more on that in a second, because the twin is a trap.
How it works
The node takes segs and image. For each segment it:
- Finds the center of that face's crop region.
- Cuts a square around it, sized to the smaller dimension of the original image.
- Slides the square back into frame if it would hang off an edge (it adjusts the top/left rather than just clipping).
- Resizes the result down to a multiple of 8.
That centering is the useful part. A plain center-crop centers on the image; this centers on the face, which is what you actually want when the subject is off to the side. For a face-swap or detail pass, a face-centered square beats a frame-centered one every time.
The part the docs won't tell you
Read the source and you'll notice it loops over every segment in the SEGS stream, building a crop for each - then returns only the first one (results[0]). So despite the plural-sounding output, you get one image out. If your detector found five faces, you see face #1's centered crop. It's not a bug that will crash you; it's a behavior that will confuse you once you have a batch with multiple detections.
This also means the node is really built for the single-face case. One face in frame, SEGS from any Impact Pack detector, and you're one node away from a clean square input for a detailer or an inpaint pass.
The trap: don't install the typo version
There are two nodes registered for this behavior in the pack:
- Crop Center with SEGS - this one, the correct name.
- Crop Center wigh SEGS - the typo'd duplicate, and the author literally renamed its display name to "DONT USE THIS."
Both map to the same class, so the typo'd one isn't broken code - it's just dead weight the author left in and told you to avoid. If you see the "DONT USE THIS" node in your node list after installing the pack, ignore it. Use the correctly spelled one.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Off-Live/ComfyUI-off-suite
# or: ComfyUI Manager → search "ComfyUI-off-suite"
Nothing extra to pip-install. You do need Impact Pack installed so SEGS exists as a type, plus whatever detector produces your SEGS stream. And because the pack's repo has been quiet since mid-2024, treat it as stable-but-frozen: it works, but don't hold your breath for fixes.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| segs | SEGS | — | |
| image | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |