Nodes/Simple Video Effects/Image - Close Up (Face Centered)
ComfyUI Node

Image - Close Up (Face Centered)

Reframe any face in one node

By scofano·Created 10 months ago·Updated 20 days ago· 0
Image - Close Up (Face Centered)
  • image
  • segs
  • output_image
zoom_factor1.5
random_zoomfalse
seed0
zoom_factor_min1.0
steps0.5

Sometimes the shot you generated is perfect except the face is a postage stamp in the middle of a busy frame. The Close Up (Face Centered) image node is the surgical reframe: it takes an image plus SEGS segmentation data, finds the eyes, computes the face center, and crops in on it - so you get a proper close-up that's actually centered on the subject, not a blind center-of-frame crop. It works on batches too, and it can roll a random zoom factor per image if you want variety across a batch.

The honest warning up front, same as the video version: this needs Impact Pack for SEGS and an eye-segmentation model (PitEyeDetailer-v2-seg.pt is what the author's workflow uses). It's the most setup-heavy node in the pack, but the payoff - a reliably face-centered crop - is something a blind center crop can't give you.

How it works

You feed it an image tensor and a SEGS object. The node filters the SEGS for segments labeled eye with confidence above 0.4, takes the first two valid eyes, computes each eye's center from its bounding box, and uses the midpoint as the face center. It then crops a region sized original / zoom_factor around that point, clamps to the image bounds, and bicubic-resizes back to the original dimensions. The eye positions come from the SEGS you supply - there's no per-frame re-detection, so for a batch of images you'd feed SEGS detected from those same images.

The twist this node adds over the video version is random zoom: when random_zoom is on, it generates candidate zoom factors from zoom_factor_min up to zoom_factor in steps increments and picks one per image using seed. That's a batch-variation tool - every image in the batch gets a slightly different framing, which is great for training sets or contact sheets where you want natural variety.

Inputs and output

  • image - the input image or batch.
  • segs - SEGS data from Impact Pack's detector (eyes labeled with confidence > 0.4).
  • zoom_factor - base zoom, default 1.5, min 1.0. 1.5 is a strong close-up; 1.2 a gentle reframe.
  • random_zoom - off by default. When on, per-image random zoom.
  • seed - reproducibility for the random zoom.
  • zoom_factor_min and steps - the lower bound and step size for random zoom selection (optional inputs).

Output is output_image, same shape as the input.

Installing it

Install the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/scofano/ComfyUI-Simple-video-effects
cd ComfyUI-Simple-video-effects
pip install -r requirements.txt

Then add ComfyUI-Impact-Pack and the eye-segmentation model (PitEyeDetailer-v2-seg.pt) per the README's workflow, and restart ComfyUI. The pack ships workflows/close_up_image.json showing the exact detection chain.

Common issues

The failure is the same as the video node: fewer than two eyes at confidence > 0.4 → ValueError. Profile shots and stylized faces will throw. Make sure the SEGS you feed was detected on the same image(s) you're zooming - feeding mismatched SEGS produces a crop centered on some other face. And if you turn on random_zoom, remember steps defaults to 0.5, so you'll get zoom values like 1.0, 1.5, 2.0 - a smaller step gives finer variation, a larger one gives more contrast between images.

CategorySimple Video Effects

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
segsSEGS
zoom_factorFLOAT1.5
random_zoomBOOLEANfalse
seedINT00–18446744073709550000
zoom_factor_minoptFLOAT1.0
stepsoptFLOAT0.5

Outputs (1)

NameTypeDescription
output_imageIMAGE