Nodes/comfyui-gits-tracked-identity/GITS Face Replacement (Simple)
ComfyUI Node

GITS Face Replacement (Simple)

The GITS Node You'll Actually Reach For

By Niutonian·Created 2 months ago·Updated 2 months ago· 1
GITS Face Replacement (Simple)
  • images
  • static_logo
  • static_logo_mask
  • ring_logo
  • ring_logo_mask
  • final_images
  • removed_background_images
◄fps24.00►
◄effect_presetclassic►
◄logo_scale1.10►
◄vertical_position-0.04►
◄ring_speed35►
◄face_removallama►
◄removal_area1.15►
◄lama_strength230►
◄edge_smoothness8►
◄mask_input_modecomfy_load_image►
◄face_modelocked_face►
◄max_faces4►
◄temporal_lamatrue►
◄lama_resolution384►
◄lama_every_n_frames2►
◄temporal_flowtrue►
◄temporal_blend0.35►
◄glitch_intensity0.00►
◄signal_flicker0.10►
◄edge_aware_mask0.35►
◄yaw_foreshorten0.40►
◄profile_boost0.55►
◄partial_face_boost0.55►

Most "face" tooling in ComfyUI is generative - you're steering a model toward producing a face that looks like someone. This pack does the opposite. It's the Reactor school: find the face, delete it, paste a graphic exactly where it was. Nothing gets diffused.

GITS Face Replacement (Simple) is that whole pipeline in one node. Feed it images, get images back with a tracked overlay on the faces. No KSampler, no second pass.

What's under the hood

It's a thin wrapper - literally. The source imports GITSTrackAndGuide and delegates to it with fixed defaults, so the guts are the same: MediaPipe FaceLandmarker finds the face, an optional Big-LaMa pass removes it, the artwork gets composited on the tracked transform. The wrapper's gift is that you never see the fourteen other sockets.

Worth knowing: artwork is optional on every node in this pack. Leave static_logo, static_logo_mask, ring_logo and ring_logo_mask unconnected and tracking plus LaMa removal still run - you just get the face removed and nothing drawn over it. Which makes this a fine "remove the face" node on its own, not how it's sold but definitely how people will use it.

The inputs that matter

A couple of dozen widgets here, and you can ignore most of them. Set these five:

  • face_removal - lama or disabled. On lama, a face-sized crop goes through Big-LaMa and the hole gets filled. On disabled you get tracking and artwork only - the honest choice for a first test, since it skips the model dependency.
  • effect_preset - classic, subtle, aggressive_track, live_balanced, cinematic_glitch, or custom to take your widget values literally. Start on classic.
  • face_mode - locked_face holds the first identity it picked, largest_face always chases the biggest, all_faces handles up to max_faces, single_face is the legacy one-tracker path. For one subject, you want locked_face.
  • mask_input_mode - comfy_load_image (default) or alpha_mask. It exists because ComfyUI's core Load Image hands you an inverted mask relative to the alpha you'd expect. Loading your logo with core Load Image? Leave it. Coming from anything else? Try alpha_mask.
  • removal_area - how much bigger than the detected face the removal mask is. Default 1.15. See a face-shaped ghost at the edges? Nudge it up.

profile_boost and partial_face_boost are the two fields the author bothered to write tooltips for, and both are honest about their narrow remit: extra mask expansion on side shots, and on faces cropped by the frame edge. Frontal faces barely change. If a profile shot leaves half a cheek showing, that's the knob, not removal_area.

Two outputs: final_images (artwork composited) and removed_background_images (the LaMa fill, no artwork). That second one is genuinely useful - it's the plate you'd send into diffusion if you want to re-render the scene with the identity gone.

Install

Standard custom-node clone, or search GITS in ComfyUI Manager.

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   # writes into ComfyUI/models/gits_tracking/

That script has a --skip-lama flag for just the two face-detection models. Requirements are mediapipe>=0.10.14,<0.11, numpy>=1.24,<2 and Pillow>=10.0 - note the numpy pin, which is what breaks installs on an environment already sitting on numpy 2. OpenCV and PyTorch come from ComfyUI. Python 3.10 or 3.11, because of that mediapipe ceiling.

And the part people miss: LaMa removal needs ComfyUI-RMBG installed and loaded. The pack resolves RMBG's AILab_LamaRemover node at runtime and repoints it at your local models/gits_tracking/big-lama.pt. No RMBG, no LaMa - the error message says exactly that, so you won't be guessing. Already have Big-LaMa in RMBG's folder? Copy it across.

Tuning it, and where it bites

For a single image, classic with LaMa on is the whole answer - temporal settings are meaningless at batch size 1. For video, turn temporal_lama on, set lama_every_n_frames to 2–3, and keep temporal_blend around its 0.35 default; that cross-fades a fresh LaMa result with the optical-flow-warped previous one, which is what stops the fill from strobing.

Things that will actually happen to you:

  • "Model not found." You skipped the models folder. Three files, exact names, ComfyUI/models/gits_tracking/, restart.
  • "MediaPipe import error." Wrong interpreter - on Windows embedded, python_embeded\python.exe, not the python on your PATH.
  • The logo is inverted. You're on alpha_mask when you want comfy_load_image, or the reverse. It's a two-value switch precisely because it's an even split.
  • A color cast over the whole frame. Fixed in current builds. If you still see tone shift, check whether it's global (old bug, gone) or confined to the face hole (just LaMa's guess).
  • Identities swapping in a two-person shot. locked_face, and drop max_faces to roughly the number of people on screen. There are no detector toggles here - the control you have is telling it how many identities to worry about.

One caveat that isn't a bug: LaMa is a still-image inpainter. The temporal layer smooths it, but a head turning through 90 degrees over a long shot will show that, and extreme profiles and tiny faces stay hard. The README says so, and it's telling the truth.

CategoryGITS

Inputs (28)

NameTypeDefaultDescription
imagesIMAGE—
fpsFLOAT24.001–240—
effect_presetCOMBOclassic6 options: custom, classic, subtle, aggressive_track, live_balanced, cinematic_glitch
logo_scaleFLOAT1.100.25–3—
vertical_positionFLOAT-0.04-1–1—
ring_speedFLOAT35-720–720—
face_removalCOMBOlama2 options: lama, disabled
removal_areaFLOAT1.150.5–2.5—
lama_strengthINT2300–255—
edge_smoothnessINT80–20—
mask_input_modeCOMBOcomfy_load_image2 options: comfy_load_image, alpha_mask
face_modeCOMBOlocked_face4 options: locked_face, largest_face, all_faces, single_face
max_facesINT41–12—
temporal_lamaBOOLEANtrue—
lama_resolutionCOMBO3843 options: 256, 384, 512
lama_every_n_framesINT21–30—
temporal_flowBOOLEANtrue—
temporal_blendFLOAT0.350–0.95—
glitch_intensityFLOAT0.000–1—
signal_flickerFLOAT0.100–1—
edge_aware_maskFLOAT0.350–1—
yaw_foreshortenFLOAT0.400–1—
profile_boostFLOAT0.550–1Extra LaMa mask expansion on side shots only. Raise if profiles leave half a face.
partial_face_boostFLOAT0.550–1Extra mask expansion when only part of the face is visible (edge crop). Full faces almost unchanged.
static_logooptIMAGE—
static_logo_maskoptMASK—
ring_logooptIMAGE—
ring_logo_maskoptMASK—

Outputs (2)

NameTypeDescription
final_imagesIMAGE—
removed_background_imagesIMAGE—