WanAnimate Face Reformer
Wan Animate dropped a frame's face? This node holds the last good one
- images
- images
Every so often a Wan Animate run hands you a frame with no face - a smear, a flicker, a pose frame where the upstream detector just didn't fire. One bad frame in a sequence reads as a stutter, and if it lands in the driving side of the pipeline, the model compounds the damage downstream. WanAnimate Face Reformer is the sweep that catches those frames: any frame without a detected face gets replaced by the previous frame that had one.
It's a YOLO face detector strapped to a hold-last-valid-frame loop, and it's the same author (lihaoyun6, the FlashVSR fast video upscaler person) whose pack name you might have seen recommended for keeping ComfyUI execution order sane. The weights ship with the pack - res/models/yolov8n-face.pt, about 6 MB, cloned right alongside the code - so there's no separate download. The node runs the detector over your frame sequence in batches, and any frame whose best face detection scores below threshold gets overwritten with the last frame that passed. Output length is identical to input length: this is a repair, not a crop. It also prints how many frames it replaced to the console, which is your honest signal for whether it actually did anything.
Inputs and outputs
images: your frame sequence - either the driving pose frames or the animated output.threshold(default 0.25): the YOLO confidence cutoff. Raise it if marginal detections are letting bad frames through; lower it if real faces are getting nuked.batch_size(default 32): the detector processes frames in batches, so this is your speed-versus-memory knob.enabled: a bypass toggle, handy while you're debugging the rest of the graph and don't want the detector running on every queue.
The single output, images, is the same-length repaired sequence.
Where to put it
It works on either side of the model, but most people run it on the pose frames, before the generation - fixing a bad frame upstream is cheaper than fixing the artifact it causes downstream. If your face-extraction step occasionally drops a frame, slap this between that step and the Animate model and let it smooth the gap.
Installing it
Search lhyNodes in ComfyUI-Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/lihaoyun6/ComfyUI-lhyNodes.git
python -m pip install -r ComfyUI-lhyNodes/requirements.txt
Then restart. This is the node that genuinely needs the pack's heavy dependency: ultralytics, the YOLO runtime. Two things worth knowing about that. It's a chunky install that pulls in a lot of wheels, and it's AGPL-3.0 - which reaches your project, fine for personal use but a real licensing decision for anything you ship commercially. There was also a supply-chain scare in December 2024 when a poisoned Ultralytics release shipped a cryptominer through ComfyUI node packs, so if you're paranoid, pin your version.
Common issues
The one gotcha worth flagging is code-grounded: the "last valid" frame starts at frame 0. If the first frames have no face, they're all copies of frame 0 until the first detection - and if the entire sequence is faceless, you get a static clip of frame 0. Make sure your sequence has a detectable face early, and if a run comes back frozen, that's this node doing exactly what you asked with nothing to work from. Raise the threshold when flicker persists, keep it at default otherwise, and let it do its quiet job.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| threshold | FLOAT | 0.250–1 | — |
| batch_size | INT | 321–1024 | — |
| enabled | BOOLEAN | true | Whether to process the image sequence. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |