GITS Face Tracking + Removal (Advanced)
The Node That Hands You the Pieces — and Why the Overlay Runs Twice
- images
- static_logo
- static_logo_mask
- ring_logo
- ring_logo_mask
- final_images
- removed_background_images
- guide_images
- aligned_overlay_images
- overlay_masks
- tracking_preview
- tracking_json
- face_occlusion_masks
Here's the honest summary of GITS Face Tracking + Removal (Advanced): it's the only node in this pack you can put in front of a sampler. Everything else assumes you've given up on diffusion rendering your graphic.
It does two unrelated jobs at once, which is why the outputs list is eight items long:
images -> Advanced Tracking -> preprocessing / diffusion -> Final Artwork Overlay
| ^
+-- exact RGB overlay + alpha mask ------+
On the way in, it takes your frames, finds the faces, paints an opaque plate over each one, and draws the artwork into the image. That's guide_images - what you send to ControlNet, an img2img pass, or KSampler. On the way out it hands you the artwork separately as aligned_overlay_images plus overlay_masks, so GITS Final Artwork Overlay can re-apply the real thing after the VAE decode.
That double-apply isn't redundancy, it's the design: KSampler will approximate a logo rather than reproduce one - smeared lines, an elliptical ring. So let diffusion work on a face that's already covered, then paste the real pixels over its guess.
The inputs you'll actually touch
Ten required widgets, and they fall into three groups.
Geometry - face_scale, y_offset, rotation_speed. How big the artwork sits relative to the face, where it sits vertically (-1..1), and how fast the ring spins - negative reverses it.
Smoothing - min_cutoff, beta. It's the pack's one Euro filter, exposed raw, and the fiddliest thing here. min_cutoff is the latency/jitter tradeoff: lower is smoother and laggier, higher hugs the face but inherits detector jitter. beta is how much the filter loosens up when the face is moving fast. Overlay trailing a quick head turn? Raise min_cutoff. Vibrating on a still face? Lower it.
Track loss - hold_frames, fade_frames, tracker_confidence. When detection drops, the node coasts on motion prediction for hold_frames, then fades over fade_frames. tracker_confidence is the bar for accepting a detection at all, and it's the one people get backwards: lowering it makes tracking more willing, which is what you want on hard faces, at the cost of the odd junk detection.
Then the optional block: track_prediction, fuse_detectors (keeps YuNet faces MediaPipe's landmarks don't overlap) and small_face_boost (a second YuNet pass on a 1.5× upscale) are the three robustness toggles shipped for exactly this. effect_preset defaults to custom here rather than classic - this node expects you to drive it. start_frame and rotation_phase let you join a video mid-stream and stay in phase, which matters when you chunk a long video.
The eight outputs, sorted by what they're for
guide_images- into your sampler, ControlNet, or whatever re-renders the scene.aligned_overlay_imagesandoverlay_masks- intoGITS Final Artwork Overlay, after decode. Also handy as a standalone tracked matte.final_images- artwork composited over the LaMa-filled frame;removed_background_imagesis the same plate with no artwork.face_occlusion_masks- the face coverage region; feeds the Final Overlay's optionalface_occlusion_masksinput to drive its backplate.tracking_preview- the guide image again, for eyeballing the track without rewiring.tracking_json- a JSON string (version,fps,width,height,frames[]) of the whole track. Per-frame transforms in a text output is the kind of thing you appreciate later.
The occlusion controls - occlusion_scale, occlusion_feather_px, guide_occlusion_opacity - govern the plate itself. profile_boost and partial_face_boost do narrow, literal jobs (side shots, frame-edge crops) and barely touch frontal faces by design.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Niutonian/ComfyUI-GITS-Tracked-Identity.git
cd ComfyUI-GITS-Tracked-Identity
python -m pip install -r requirements.txt
python scripts/download_face_landmarker.py
Everything goes in ComfyUI/models/gits_tracking/: face_landmarker.task (~3.6 MB), face_detection_yunet_2023mar.onnx (~0.2 MB - both from the script above, or --skip-lama) and big-lama.pt (~196 MB, from 1038lab/Lama). Restart after.
Face removal is the dependency that bites: face_removal_mode on lama needs ComfyUI-RMBG installed and loaded, because the pack borrows RMBG's AILab_LamaRemover class and points it at your local big-lama.pt. No RMBG and you get a RuntimeError naming RMBG specifically. Set face_removal_mode to disabled and everything else still works - tracking, guide, all eight outputs.
Troubleshooting
Model not found: the three files, exact filenames, gits_tracking/, restart. If you already have Big-LaMa from RMBG, copy it rather than re-downloading.
MediaPipe import error: requirements.txt into the interpreter that launches ComfyUI. On Windows embedded, python_embeded\python.exe.
Track loss or ID swaps: aggressive_track preset, lower tracker_confidence, raise hold_frames, keep fuse_detectors and small_face_boost on. For swaps specifically, locked_face and a lower max_faces - the appearance-matching layer needs contrast to work with.
LaMa flicker across frames: raise temporal_blend, keep temporal_flow on, and only lower lama_every_n_frames if you can afford the per-frame inpaint.
Inverted logo: this node has no mask_input_mode, so if the artwork comes out backwards, put an InvertMask in front of static_logo_mask or ring_logo_mask.
Tensor size mismatch at the Final Overlay: keep the decode resolution equal to the tracking resolution - match batch, height and width.
The packaged workflows/gits_core_image_batch.json is the core-nodes-only chain (Advanced → sampler → Final Overlay), and gits_video_integration_example.json shows the VideoHelperSuite setup. For long videos, load chunks.
Inputs (43)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| fps | FLOAT | 24.001–240 | — |
| face_scale | FLOAT | 1.000.25–3 | — |
| y_offset | FLOAT | -0.02-1–1 | — |
| rotation_speed | FLOAT | 42-720–720 | — |
| follow_head_roll | FLOAT | 0.200–1 | — |
| min_cutoff | FLOAT | 1.200.01–20 | — |
| beta | FLOAT | 0.0350–2 | — |
| hold_frames | INT | 80–120 | — |
| fade_frames | INT | 80–120 | — |
| tracker_confidence | FLOAT | 0.450–1 | — |
| static_logoopt | IMAGE | — | |
| static_logo_maskopt | MASK | — | |
| ring_logoopt | IMAGE | — | |
| ring_logo_maskopt | MASK | — | |
| effect_presetopt | COMBO | custom | 6 options: custom, classic, subtle, aggressive_track, live_balanced, cinematic_glitch |
| start_frameopt | INT | 00–2147483647 | — |
| rotation_phaseopt | FLOAT | 0.00-3600–3600 | — |
| logo_opacityopt | FLOAT | 1.000–1 | — |
| fallback_detectoropt | COMBO | yunet | 2 options: yunet, disabled |
| occlusion_scaleopt | FLOAT | 1.150.5–2.5 | — |
| occlusion_feather_pxopt | INT | 80–128 | — |
| guide_occlusion_opacityopt | FLOAT | 1.000–1 | — |
| face_removal_modeopt | COMBO | lama | 2 options: lama, disabled |
| lama_removal_strengthopt | INT | 2300–255 | — |
| lama_edge_smoothnessopt | INT | 80–20 | — |
| final_overlay_opacityopt | FLOAT | 1.000–1 | — |
| face_modeopt | COMBO | locked_face | 4 options: locked_face, largest_face, all_faces, single_face |
| max_facesopt | INT | 41–12 | — |
| temporal_lamaopt | BOOLEAN | true | — |
| lama_resolutionopt | COMBO | 384 | 3 options: 256, 384, 512 |
| lama_every_n_framesopt | INT | 21–30 | — |
| temporal_flowopt | BOOLEAN | true | — |
| temporal_blendopt | FLOAT | 0.350–0.95 | — |
| glitch_intensityopt | FLOAT | 0.000–1 | — |
| signal_flickeropt | FLOAT | 0.100–1 | — |
| edge_aware_maskopt | FLOAT | 0.350–1 | — |
| yaw_foreshortenopt | FLOAT | 0.400–1 | — |
| profile_boostopt | FLOAT | 0.550–1 | Extra LaMa/face-mask expansion on side shots only. 0 keeps tight frontal masks; raise toward 1 if profiles leave half a face. |
| partial_face_boostopt | FLOAT | 0.550–1 | Extra mask expansion when only part of the face is visible (frame edge crop / partial face). Full faces are almost unchanged. |
| track_predictionopt | BOOLEAN | true | — |
| fuse_detectorsopt | BOOLEAN | true | — |
| small_face_boostopt | BOOLEAN | true | — |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| final_images | IMAGE | — |
| removed_background_images | IMAGE | — |
| guide_images | IMAGE | — |
| aligned_overlay_images | IMAGE | — |
| overlay_masks | MASK | — |
| tracking_preview | IMAGE | — |
| tracking_json | STRING | — |
| face_occlusion_masks | MASK | — |