Face Fix - Prepare Video and Anchors
The node that finds a face, tracks it, and preps it for repair
- video_frames
- face_video_512
- anchor_images
- anchor_count
- anchor_indices
- face_fix_context
Video models are great at many things and famously bad at one: keeping a face stable. LTX melts faces, drifts identities across shots, and turns distant subjects into smudges. The VRGameDevGirl Face Fix pipeline is the fix for that - and VRGDGFaceFixPrepare is where it all starts. It scans your video, locks onto one primary face, builds a clean 512×512 face sequence from the crop, selects safe anchor frames for an image model to enhance, and remembers exactly where every crop came from so repaired faces can be pasted back later.
How it works. Feed it the IMAGE output from VHS Load Video. The node runs a face detector over the whole batch, tracks one primary face through the frames, and cuts a 512×512 sequence around it. Along the way it picks "anchors" - well-detected, safe frames spaced roughly anchor_interval apart - that get handed to Z-Image Turbo for enhancement (that's the identity-preservation trick from the wider Z-Image ecosystem: a strong image model draws clean, consistent faces, then those stills steer the video model). Every crop rectangle and every no-face decision gets packed into the face_fix_context output, which the rest of the pipeline uses to map repaired frames back onto the original video.
The inputs that matter. The defaults in the README-style notes are solid starting points; the workflow's own saved settings go lower for distant faces:
detection_confidence(default 0.70) - lower it if distant or blurry faces are missed, raise it if background objects get picked up as faces.crop_padding(0.10) - extra area around the face; 0.10–0.25 covers hair and neck, lower crops tighter.minimum_face_pixels(20) - filters tiny false positives; drop to 12 withrotation_assiston Strong for faraway faces.rotation_assist- scans rotated copies of frames for tilted/overhead faces. Light is ~3× detection work, Strong ~5×.repair_distance- which face sizes actually get repaired. "Far faces (recommended)" repairs below 7% of frame width; close-ups stay untouched.anchor_interval(16 frames) - smaller = more anchors = stronger identity, more Z-Image time.short_gap_tracking(2) - how many missed detections may reuse the last known face position. Use 0 to only repair freshly detected frames.
The outputs. face_video_512 (the cropped face sequence), anchor_images and anchor_count/anchor_indices (the frames selected for Z-Image), and the all-important face_fix_context that carries crop mappings forward.
Installing. The pack:
cd ComfyUI/custom_nodes
git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl
or search vrgamedev in ComfyUI Manager. You also need VideoHelperSuite (VHS) for loading/combining video, the Z-Image Turbo files (z_image_turbo_bf16.safetensors, the qwen_3_4b.safetensors text encoder, ae.safetensors VAE), an LTX 2.3 distilled GGUF (ltx-2.3-distilled_1.1 Q6/Q8), the Gemma 3 12B text encoder, and the LTX 2.3 VAEs. That's a real model download list - budget a few tens of GB before the first run.
Where people get burned. Detection tuning is the whole game. If your subject is far from camera, the recommended 0.70 confidence will skip them entirely - that's the single most common "it did nothing" report, and the fix is the low settings the workflow author ships for distant faces (confidence 0.40, min pixels 12, rotation Strong). Expect the first run to take a while: detection plus Z-Image on every anchor is real compute. If the pipeline pastes a face into a section with no face, lower short_gap_tracking.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| video_frames | IMAGE | Connect the IMAGE output from VHS Load Video. The complete batch is scanned for one primary face and retained for final full-resolution compositing. | |
| detection_confidence | FLOAT | 0.700.1–0.99 | Minimum 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_padding | FLOAT | 0.100–1.5 | Extra 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_pixels | INT | 204–1024 | Reject 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_assist | COMBO | Light: ±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_distance | COMBO | Far 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_threshold | FLOAT | 9.00.1–50 | Used 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_interval | COMBO | 16 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_tracking | INT | 20–8 | How 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. |
| warm_up_frames | INT | 80–64 | Disposable copies added before the real face video. The first strong image guide is moved onto this outer boundary and the warm-up frames are trimmed after LTX. Use 8 to reduce an over-strong first real frame; use 0 for the original start behavior. |
| cool_down_frames | INT | 80–64 | Minimum disposable copies added after the real face video. The last strong image guide is moved onto this outer boundary and the cool-down frames are trimmed after LTX. Face Fix may add up to seven more hidden frames for 8n+1 alignment and always keeps an eight-frame tail safety guard. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| face_video_512 | IMAGE | — |
| anchor_images | IMAGE | — |
| anchor_count | INT | — |
| anchor_indices | STRING | — |
| face_fix_context | VRGDG_FACE_FIX_CONTEXT | — |