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

Video - Close Up (Face Centered)

Auto-crop onto the eyes

By scofano·Created 10 months ago·Updated 20 days ago· 0
Video - Close Up (Face Centered)
  • segs
  • output_path
video_path
zoom_factor1.5
prefixclose_up

If you've ever tried to make a close-up crop of a talking head and watched the framing drift off-center as the head moves, you'll get this immediately. The Close Up (Face Centered) node zooms a video onto the face, and it anchors the crop on the midpoint between the subject's eyes. Eyes are the stable landmark - heads move around, but the eye line is where attention goes. The node reads SEGS segmentation data, finds the eyes, computes the face center, and applies a zoom centered on that point. Audio is preserved, and the result is written out as a new video file.

The honest caveat up front: this is the most setup-heavy node in the pack, because it depends on two things that aren't bundled. It needs Impact Pack installed (for SEGS), and it needs an eye-segmentation model - the author's workflow uses PitEyeDetailer-v2-seg.pt, an Ultralytics-style segmentation model, loaded through an UltralyticsDetectorProvider.

How it works

You feed it a video path and a SEGS object. The node filters the SEGS for segments labeled eye with confidence above 0.4, takes the first two valid eyes, calculates the center of each from its bounding box, and uses the midpoint as the face center. It then crops a region sized original / zoom_factor, centered on that point, clamps it to stay inside the frame, and bicubic-resizes back to the original dimensions. Every frame of the video gets the same zoom treatment before re-encoding, and the audio is copied across losslessly.

The key mechanism detail: the eye positions come from the SEGS you hand it, not from re-detection per frame. So the workflow is to detect eyes once on a representative frame and let the node apply that fixed face center to the whole clip. The pack ships example workflows (workflows/close_up_video.json) showing the exact chain:

Video path → VHS_LoadVideoPath → SegmDetectorSEGS → CloseUpNode
                          ↑
          UltralyticsDetectorProvider (PitEyeDetailer-v2-seg.pt)

Inputs and output

  • video_path - the video file to zoom.
  • segs - the SEGS data from Impact Pack's detector.
  • zoom_factor - zoom multiplier, default 1.5, minimum 1.0. 1.5 is a strong, useable close-up; 1.2 is a gentler reframe.
  • prefix - output filename prefix, default close_up.

Output is output_path, the new video file.

Installing it

First install the pack itself:

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 install ComfyUI-Impact-Pack (via ComfyUI Manager is easiest) and grab the PitEyeDetailer-v2-seg.pt eye model - the pack README points at Ultralytics models/compatible sources. Restart ComfyUI after everything lands.

Common issues

The failure mode is explicit in the source: if fewer than two eyes with confidence > 0.4 are found, the node raises a ValueError - "Need at least 2 eyes with confidence > 0.4." Side profiles, hats, or heavily stylized faces will fail, because there's no re-detection fallback. Make sure your detection frame is one where the eyes are clearly visible and reasonably front-on.

Also remember the SEGS is a snapshot: if the subject moves a lot across the clip, a single fixed face center can drift off as they move - pick the detection frame wisely, or accept that this node is best for head-and-shoulders shots where the face stays put. And because it re-encodes the whole file, keep the ffmpeg/ffprobe binaries on your PATH or it won't start.

CategorySimple Video Effects

Inputs (4)

NameTypeDefaultDescription
video_pathSTRING
segsSEGS
zoom_factorFLOAT1.5
prefixSTRINGclose_up

Outputs (1)

NameTypeDescription
output_pathSTRING