Nodes/VRGameDevGirl Video Enhancement Nodes/Face Fix - Prepare Full Video With Shot Tracking
ComfyUI Node

Face Fix - Prepare Full Video With Shot Tracking

The node that turns a whole video into a fixable face — shot by shot

By vrgamegirl19·Created about a year ago·Updated about 7 hours ago· 718
Face Fix - Prepare Full Video With Shot Tracking
  • video_frames
  • face_video_512
  • anchor_images
  • anchor_count
  • anchor_indices
  • face_fix_context
detection_confidence0.70
crop_padding0.10
minimum_face_pixels20
rotation_assistLight: ±15°
repair_distanceFar faces (recommended)
custom_distance_threshold9.0
anchor_interval16 frames (recommended)
short_gap_tracking2
cut_sensitivity0.28
crop_smoothing0.85

This is the front door of VRGameDevGirl's Face Fix pipeline, and one of the most impressive nodes in the pack. Face Fix - Prepare Full Video With Shot Tracking takes your entire video, finds the one primary face in it, tracks that face frame by frame, cuts a clean 512×512 face sequence for LTX to regenerate, picks safe reference anchors for Z-Image, and - crucially - remembers exactly where every face was so the repaired face can be pasted back into the original full-resolution frames. If you've ever "just fixed the face" and ended up with a shaky, misaligned paste job, you know why the bookkeeping matters.

The wider idea: LTX Video is fast enough to regenerate a face crop in seconds - that speed is the reason the pack builds on it at all - but the face has to move with the shot. This node does the motion tracking so LTX only has to handle identity and detail.

What it does, stage by stage

It detects the primary face using an OpenCV DNN detector (model files ship in the pack's assets/ folder - no download). Within each shot it tracks that face, pads the crop, and stabilizes the box so it doesn't jitter. It also detects hard cuts and resets tracking at them - the "shot aware" part. A new shot gets a fresh track instead of dragging a dead face position forward.

The inputs that matter

  • video_frames - connect the IMAGE output from VHS Load Video. The whole batch gets scanned; the originals are retained for the final composite.
  • detection_confidence - default 0.7. Higher rejects false positives but misses small/blurry/profile faces. Drop to ~0.6 for distant faces.
  • crop_padding - extra area around the face as a fraction of face size, per side. 0.10–0.25 is the recommended range; more includes hair/neck/background, which helps LTX place the face in context.
  • minimum_face_pixels - ignore detections smaller than this many source pixels. Raised, it filters tiny false positives; lowered, it lets distant faces in (at your own risk).
  • rotation_assist - rescans rotated copies of frames to catch tilted faces, then maps detections back. Light (±15°) roughly triples detection work; Strong (±30°) roughly quintuples it. Detection only - output frames are never rotated.
  • repair_distance - which face sizes get repaired. Far faces (recommended) fully repairs faces below 7% of frame width, fading out by 9%. "All detected faces" repairs everything; Custom sets your own threshold. Close faces are left unchanged and never used as anchors.
  • anchor_interval - spacing between Z-Image identity/detail anchors. 16 frames (recommended); smaller = stronger consistency but slower. The nearest valid detected face is used and boundaries are included automatically.
  • short_gap_tracking - how many consecutive missed detections reuse the last known position (default 2). It bridges brief blur without pasting a face into a genuinely face-less stretch.
  • cut_sensitivity - hard-cut detection. Lower catches subtler cuts; higher ignores flashes and lighting changes. Default 0.28.
  • crop_smoothing - stabilizes crop position/size within a shot. Resets at hard cuts. Default 0.85.

The outputs

  • face_video_512 - the face sequence at 512×512, ready for LTX.
  • anchor_images and anchor_indices - the Z-Image reference anchors and their frame positions; anchor_count tells you how many.
  • face_fix_context - the tracked crop boxes plus originals. This is the glue. It must be wired into the Composite node at the end, or the repaired faces have no map to paste back onto.

Installing it

The pack, as usual: Manager, search vrgamedev, or git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl.git into custom_nodes/, restart, hard-refresh. Face detection models are bundled, so no extra downloads for this node - but the full Face Fix workflow also needs Z-Image and LTX models, and the README's heavy pip requirements (transformers, opencv, voxcpm, llama-cpp-python) apply to the whole pack. The included Workflows/FaceFix/VRGDG_FaceFix_Workflow.json is the intended wiring.

Common issues

  • The crop drifts or a face is missed entirely. Lower detection_confidence, bump crop_padding, and try rotation_assist on Light. If the face is tiny, lower minimum_face_pixels.
  • Faces get pasted into blank stretches. That's short_gap_tracking set too high - drop it toward 0 if faces are appearing where none exist.
  • Face keeps sliding between shots. Raise cut_sensitivity if subtle cuts aren't being caught, or lower it if flashes are triggering resets.
  • Nothing repaired for close-up faces. That's repair_distance working as intended - "Far faces" leaves close-ups untouched.

Set it up right and video face repair stops feeling like a ten-hour grudge match and starts feeling like magic.

CategoryVRGameDevGirl/Face Fix

Inputs (11)

NameTypeDefaultDescription
video_framesIMAGEConnect the IMAGE output from VHS Load Video. The complete batch is scanned for one primary face and retained for final full-resolution compositing.
detection_confidenceFLOAT0.700.1–0.99Minimum confidence accepted from the face detector. Higher values reduce false detections but may miss small, blurry, profile, or motion-blurred faces. Lower cautiously for distant faces. Recommended starting value: 0.70.
crop_paddingFLOAT0.100–1.5Extra area around the detected face, measured as a fraction of face size on every side. Lower values crop closer to facial features; higher values include more hair, neck, and background. Recommended starting range: 0.10–0.25.
minimum_face_pixelsINT204–1024Reject detections whose width or height is smaller than this many source pixels. Raising this filters tiny false positives; lowering it permits very distant faces but increases false-detection risk. Recommended starting value: 20.
rotation_assistCOMBOLight: ±15°Also scans rotated copies of each frame, then maps detections back to the original coordinates. Light helps mildly tilted/overhead faces at roughly 3× detection work. Strong adds ±30° for difficult angles at roughly 5× detection work. It affects detection only; output frames are never rotated.
repair_distanceCOMBOFar faces (recommended)Controls which face sizes are repaired. Very Far fully repairs below 4% of frame width and fades out by 6%. Far fully repairs below 7% and fades out by 9%. Far and Medium fully repairs below 10% and fades out by 12%. All disables distance filtering. Close faces above the fade limit remain unchanged and are not selected as Z-Image anchors.
custom_distance_thresholdFLOAT9.00.1–50Used only when Repair Distance is Custom. Faces at or above this percentage of frame width remain unchanged. Repair fades in across the 2 percentage points below this value. Example: 9% gives full repair at 7% or smaller, fading to no repair at 9%.
anchor_intervalCOMBO16 frames (recommended)Approximate spacing between Z-Image identity/detail anchors. Smaller intervals create more anchors and stronger consistency but take longer. Larger intervals are faster but give LTX less identity guidance. The nearest valid detected face is used, and boundary anchors are included automatically.
short_gap_trackingINT20–8How many consecutive missed detections may reuse the last known face position. Strength fades across the gap. Use 0 to repair only freshly detected frames. The default 2 bridges brief blur without pasting a face into long no-face sections.
cut_sensitivityFLOAT0.280.05–0.95Hard-cut sensitivity. Lower detects subtler cuts; higher ignores flashes and lighting changes.
crop_smoothingFLOAT0.850–0.95Stabilizes tracked crop position and size within each shot. Resets automatically at hard cuts.

Outputs (5)

NameTypeDescription
face_video_512IMAGE
anchor_imagesIMAGE
anchor_countINT
anchor_indicesSTRING
face_fix_contextVRGDG_FACE_FIX_CONTEXT