comfyui-gits-tracked-identity
Temporally tracked identity graphic overlays for ComfyUI (single image, video batch, webcam)
Nodes (4)
ComfyUI GITS Tracked Identity
A ComfyUI custom-node package that places a tracked, camera-facing identity graphic over one or more faces — for single images, ordered video batches, and live webcam. The name describes the visual technique; this repository contains no copyrighted franchise artwork. Bundled cyan placeholders are original geometric art.
Version 0.2.0 — multi-face IDs, Temporal LaMa, webcam, glitch/signal effects, appearance matching, motion prediction, and improved temporal fill.
Everything runs locally. Dependencies and models use MIT/Apache-style licenses only (see Licenses).
Why the overlay is applied twice
video/image batch -> Advanced Tracking -> preprocessing / diffusion -> Final Artwork Overlay
| ^
+-- exact RGB overlay + alpha mask ----+
GITS Face Tracking + Removal (Advanced) puts an opaque proxy plate plus the
graphic into the images sent toward diffusion. It also returns the exact aligned
RGB graphic and alpha separately. GITS Final Artwork Overlay applies those
exact pixels after VAE decoding so letters, circles, thin lines, and ring
rotation do not deform. Do not expect KSampler to reproduce logo art.
For a fast path with no diffusion, use Simple or Webcam: they track, optionally remove the face with LaMa, and composite the exact graphic in one node.
Artwork is optional on every node. If static_logo, static_logo_mask,
ring_logo, and ring_logo_mask are all unconnected, tracking and LaMa face
removal still run. The outputs are then the reconstructed background (face
removed) with no graphic overlay.
Installation
Reference environment: Python 3.10 or 3.11.
Clone into ComfyUI
cd ComfyUI\custom_nodes
git clone https://github.com/Niutonian/ComfyUI-GITS-Tracked-Identity.git
cd ComfyUI-GITS-Tracked-Identity
Or copy this folder to ComfyUI/custom_nodes/ComfyUI-GITS-Tracked-Identity.
Dependencies
Use the same interpreter that starts ComfyUI:
# Embedded ComfyUI Easy Install (Windows example)
..\..\python_embeded\python.exe -m pip install -r requirements.txt
# Or a normal venv
python -m pip install -r requirements.txt
OpenCV and PyTorch are normally already provided by ComfyUI. Face removal also needs ComfyUI-RMBG (or an equivalent Big-LaMa provider) loaded in ComfyUI.
Models (explicit download only)
Nodes never download weights at queue time. Install models once, then restart
ComfyUI. Search the node menu for GITS.
Where to place them
Create this folder if it does not exist:
ComfyUI/models/gits_tracking/
Expected files (exact names):
| File | Purpose | Approx. size |
|------|---------|-------------:|
| face_landmarker.task | MediaPipe face landmarks (primary tracker) | ~3.6 MB |
| face_detection_yunet_2023mar.onnx | OpenCV YuNet fallback (small / hard faces) | ~0.2 MB |
| big-lama.pt | Big-LaMa face removal / inpaint | ~196 MB |
Full example on a typical Windows Easy-Install layout:
ComfyUI/
models/
gits_tracking/
face_landmarker.task
face_detection_yunet_2023mar.onnx
big-lama.pt
custom_nodes/
ComfyUI-GITS-Tracked-Identity/
If you already have Big-LaMa from ComfyUI-RMBG at
ComfyUI/models/RMBG/Lama/big-lama.pt, you can copy that file into
gits_tracking/ instead of downloading it again. GITS prefers
models/gits_tracking/big-lama.pt and can fall back to the RMBG path when
configured through the LaMa remover node.
Manual download URLs
Download each file in a browser (or with curl / wget) and save it into
ComfyUI/models/gits_tracking/ with the exact filename above:
-
Face Landmarker → save as
face_landmarker.task
https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/latest/face_landmarker.task -
YuNet face detector → save as
face_detection_yunet_2023mar.onnx
https://github.com/opencv/opencv_zoo/raw/main/models/face_detection_yunet/face_detection_yunet_2023mar.onnx -
Big-LaMa → save as
big-lama.pt
https://huggingface.co/1038lab/Lama/resolve/main/big-lama.pt
(model card / files page: https://huggingface.co/1038lab/Lama)
PowerShell example:
$dest = "C:\path\to\ComfyUI\models\gits_tracking"
New-Item -ItemType Directory -Force -Path $dest | Out-Null
Invoke-WebRequest -Uri "https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/latest/face_landmarker.task" -OutFile "$dest\face_landmarker.task"
Invoke-WebRequest -Uri "https://github.com/opencv/opencv_zoo/raw/main/models/face_detection_yunet/face_detection_yunet_2023mar.onnx" -OutFile "$dest\face_detection_yunet_2023mar.onnx"
Invoke-WebRequest -Uri "https://huggingface.co/1038lab/Lama/resolve/main/big-lama.pt" -OutFile "$dest\big-lama.pt"
Automatic installer script
From the custom node folder (after it is inside custom_nodes, the script
writes into ComfyUI/models/gits_tracking/):
python scripts\download_face_landmarker.py
Use --skip-lama to install only the two face-detection models.
Optional: sync from a development checkout
powershell -ExecutionPolicy Bypass -File scripts\deploy_to_comfyui.ps1 `
-Target "C:\path\to\ComfyUI\custom_nodes\ComfyUI-GITS-Tracked-Identity"
Or set GITS_COMFYUI_CUSTOM_NODES and run the script without -Target.
Nodes
| Node | Role | |------|------| | GITS Face Replacement (Simple) | One-node image/video path: track → LaMa → exact overlay | | GITS Webcam Face Replacement | Stateful live path; keeps tracker + LaMa cache across prompts | | GITS Face Tracking + Removal (Advanced) | Full outputs for diffusion / ControlNet / diagnostics | | GITS Final Artwork Overlay | Exact post-decode composite |
Effect presets
Available on Simple, Advanced, and Webcam (effect_preset):
| Preset | Intent |
|--------|--------|
| custom | Use widget values only |
| classic | Default censor look, mild signal flicker |
| subtle | Softer edges, slower ring, more smoothing |
| aggressive_track | Longer hold, lower confidence, more prediction |
| live_balanced | Webcam-friendly hold/fade and Temporal LaMa |
| cinematic_glitch | Scanlines / RGB shift / stronger flicker |
Face modes
locked_face— keep the first selected identitylargest_face— always follow the largest faceall_faces— process up tomax_facesidentitiessingle_face— legacy Advanced one-tracker path
Tracking robustness (v0.2)
- MediaPipe FaceLandmarker (VIDEO mode) + OpenCV YuNet fallback
- Detector fusion: YuNet faces that do not overlap landmarks are kept
- Small-face boost: extra YuNet pass on a 1.5× upscale
- Appearance matching: local RGB histogram signatures reduce ID swaps
- Bipartite association for multi-face frames
- Motion prediction during hold/fade after brief occlusions
- One Euro smoothing + configurable hold/fade
Temporal face removal
- Cropped Big-LaMa at 256 / 384 / 512
lama_every_n_frames+ optical flow (OpenCV DIS when available, else Farneback)temporal_blendcross-fades fresh LaMa with the warped prior (less flash)- Webcam:
fast(blur),balanced(interval LaMa),quality(every frame) - Color-safe composite: Big-LaMa rewrites the full frame (or crop). After inpaint, the node blends the result only under the face-remove mask and keeps original RGB outside that mask. Unmasked background colors match the input (no global cast from the LaMa provider’s full-frame rewrite).
Visual options
glitch_intensity— scanlines, channel shift, block noise on artworksignal_flicker— digital opacity noise when tracking is weakedge_aware_mask— grow removal mask along image edges (hair)yaw_foreshorten— cheap horizontal squash from estimated head yawprofile_boost— extra face-mask / LaMa expansion on side shots only (0 = mild auto, 1 = aggressive profile coverage; frontal almost unchanged)partial_face_boost— extra expansion when the face is cropped by the frame edge or only partly visible (0 = mild auto, 1 = aggressive; full faces almost unchanged)
Workflows
Packaged under workflows/:
gits_simple_demo.json— Simple node, single image or batchgits_core_image_batch.json— Advanced + Final Overlay (core nodes only)gits_integrated_working_demo.json/gits_working_demo.json— LaMa pathgits_video_integration_example.json— VideoHelperSuite templategits_webcam_template.json— live template
For long videos, load chunks with VideoHelperSuite to limit RAM.
Performance tips
| Use case | Suggestion |
|----------|------------|
| Single image | Simple + classic, LaMa on, Temporal LaMa irrelevant for B=1 |
| Video batch | Simple/Advanced, temporal_lama=true, interval 2–3, blend ~0.35 |
| Webcam live | Webcam node, live_balanced, balanced mode, resolution 256–384 |
| Many faces | Lower max_faces, raise interval, or use fast mode live |
MediaPipe is CPU-side. Unchanged logos are converted once per call.
Troubleshooting
- Model not found: download the three files into
ComfyUI/models/gits_tracking/(see Models), or runscripts/download_face_landmarker.py, then restart ComfyUI - MediaPipe import error: install
requirements.txtinto ComfyUI’s Python - Logo inverted: Simple/Webcam default
comfy_load_imagefixes core Load Image masks; Advanced may needInvertMask - Track loss: try
aggressive_track, lowertracker_confidence, raisehold_frames, keepsmall_face_boost/fuse_detectorson - ID swaps:
locked_face+ appearance matching; avoid extreme motion blur - LaMa flicker: raise
temporal_blend, keeptemporal_flowon, lower interval only if quality allows - Whole image looks recolored / different “color profile”: fixed in current
builds — full-frame LaMa used to return the provider’s rewritten tensor for
every pixel. Output now restores original RGB outside the face mask. If you
still see a cast only inside the face hole, that is LaMa’s inpaint tone
(not a global profile change); try a smaller
removal_area/ lower boosts. Withface_removal=disabled, final must match the input. - Tensor size mismatch (Final Overlay): match batch/H/W after decode
Tests
cd ComfyUI-GITS-Tracked-Identity
python -m pytest -q
Licenses
| Component | License |
|-----------|---------|
| This package | MIT (LICENSE) |
| MediaPipe | Apache-2.0 |
| OpenCV / YuNet | Apache-2.0 |
| Big-LaMa weights (local) | Apache-2.0 |
No telemetry, no cloud inference. MediaPipe may log harmless
portable_clearcut_uploader messages; they are not network model downloads
from this package.
Limitations
- Artwork is a camera-facing billboard (roll + optional yaw squash), not a full 3D mesh sticker
- LaMa is an image inpainter; temporal cache/flow/blend improve continuity but are not a dedicated video-inpaint network
- Extreme profiles, heavy occlusion, and tiny faces remain difficult
all_facescost scales roughly with selected face count × LaMa