ComfyUI Node

Face Tracker

Sequence awareness for Face Processor (with a caveat)

By SykkoAtHome·Created 2 years ago·Updated 9 months ago· 20
Face Tracker
  • image
  • fp_pipe
  • image
  • fp_pipe
debugfalse
use_motion_vectorsfalse
reset_points_interval10
tracker_region_size64
proxy_scale1.00
show_detectionfalse
show_regionfalse

Here's the honest pitch: FaceTracker exists so Face Processor can work on image sequences instead of single frames. It takes a frame, detects the face, and files the landmarks away in fp_pipe under tracking_data, keyed by frame number. Run it frame after frame and you end up with a per-frame landmark record you can hand to the rest of the pack. That's genuinely useful for video-ish workflows - consistent face edits across a shot need the geometry from every frame, not just one.

The caveat comes from reading the source: despite the "optical flow" talk in the class docstring, the tracking here is mostly re-detection. Each call runs MediaPipe Face Mesh again on the current frame and stashes the result. use_motion_vectors and reset_points_interval appear in the input schema and the function signature, but at the version this repo ships they don't actually change the output - the optical-flow parameters are defined and then never used. It's an early-stage node. It works; it's just not doing what the name promises yet. Keep expectations in check and it's a fine per-frame landmark logger.

Inputs and outputs that matter

  • image and fp_pipe - both required. fp_pipe should come from earlier in your sequence (an ImageFeeder → FaceWrapper chain), because the node reads current_frame out of it to decide which frame_N key it's filing under.
  • proxy_scale (0.2–1.0) - downscales the frame before detection and rescales the landmarks back. The one knob you'll actually tune for speed on big frames.
  • debug, show_detection, show_region, tracker_region_size - the debug quartet. show_region draws a box around each landmark; tracker_region_size (32–128) sets that box size. Turn these on while verifying alignment, then leave them off for real runs.
  • use_motion_vectors, reset_points_interval - present, no visible effect in this version (see above).

Outputs are image (unchanged unless debug overlay is on) and fp_pipe with tracking_data populated.

Install and context

Same pack as everything else here - Manager search "Face Processor", or:

cd ComfyUI/custom_nodes
git clone https://github.com/SykkoAtHome/ComfyUI_FaceProcessor.git

restart, and let requirements.txt pull in mediapipe/dlib/pandas (CuPy only matters for the GPU warper in FaceWrapper, not this node). The MediaPipe landmarker model downloads itself on first detection, so nothing to fetch by hand.

Troubleshooting

  • No face detected - the node prints it and returns the frame untouched. If your subject leaves frame or turns hard profile, the frame gets no entry; the code even has a TODO about filling NaNs and continuing, which tells you it's not handled yet.
  • "Task runner is currently not running" - a known MediaPipe annoyance when the task gets closed between calls. This pack actually handles it: it detects that exact error, re-initializes the model, and retries. If you see it once, it's self-healing; if you see it every frame, restart ComfyUI.
  • Sequences and current_frame - because it keys off fp_pipe["current_frame"], make sure that value is advancing between calls (ImageFeeder and FaceFitAndRestore both manage it). Static current_frame means every frame overwrites the same frame_0 entry and your "tracking data" has one row in it.

It's a thin node - you could argue it's not worth installing the pack for on its own. But it's the piece that makes the Fit → edit → Restore loop sequence-aware, and once the optical-flow plumbing actually lands it'll be the interesting one.

CategoryFace Processor

Inputs (9)

NameTypeDefaultDescription
imageIMAGE
fp_pipeDICT
debugBOOLEANfalse
use_motion_vectorsBOOLEANfalse
reset_points_intervalINT103–50
tracker_region_sizeCOMBO645 options: 32, 48, 64, 96, 128
proxy_scaleFLOAT1.000.2–1
show_detectionBOOLEANfalse
show_regionBOOLEANfalse

Outputs (2)

NameTypeDescription
imageIMAGE
fp_pipeDICT