Nodes/ComfyUI-WanVideoWrapper/FantasyPortrait Face Detector
ComfyUI Node Runs on cloud

FantasyPortrait Face Detector

Pull expression embeds from a driving face for Wan

By kijai·Created about a year ago·Updated 2 months ago· 6,651
FantasyPortrait Face Detector
  • portrait_model
  • images
  • portrait_embeds
  • bbox
  • landmarks
adapter_scale1.00
mouth_scale1.00
emo_scale1.00
devicecuda

This is the middle step of a FantasyPortrait workflow - the one that actually reads a face and turns its performance into control data. You give it the loaded FantasyPortrait model and a batch of driving frames, and it finds the face(s), extracts the expression, and hands back a portrait_embeds object the Wan sampler can follow. It also spits out bounding boxes and facial landmarks along the way.

FantasyPortrait is expression transfer: someone emotes in the driving video, your generated character copies it. This node is where the "read the emotion" happens, and it's also where you dial how much of that emotion carries through.

How it works

The node runs face detection over your images, locates the portrait, and encodes its expression through the FantasyPortrait model into an embedding. Because it detects faces explicitly, it can handle multiple people in frame and produce landmarks and boxes for each. Those portrait_embeds then flow into the WanVideoAddFantasyPortrait node, which injects them into the generation.

The three scale knobs are the reason this node isn't just a black box - they let you separate how much expression to transfer from which parts of it.

The inputs and outputs that matter

  • portrait_model (FANTASYPORTRAITMODEL) - the model from FantasyPortraitModelLoader. Required.
  • images (IMAGE) - the driving performance, as frames.
  • adapter_scale (default 1) - the overall strength of the expression transfer. Your master dial. Down for subtle, up for exaggerated.
  • mouth_scale (default 1) - isolates mouth movement. Raise it if speech/mouth shapes aren't reading; drop it if the mouth is over-animated relative to the rest of the face.
  • emo_scale (default 1) - isolates the emotional component (brows, eyes, the stuff that reads as feeling). Push it for more expressive results.
  • device (default cuda) - run detection on GPU. Switch to cpu only if you're desperately short on VRAM and willing to eat the slowdown.

Outputs:

  • portrait_embeds (PORTRAIT_EMBEDS) → WanVideoAddFantasyPortrait.
  • bbox (BBOX) and landmarks (LANDMARKS) - the detected face boxes and keypoints, useful for debugging alignment or for masking.

How to install it

ComfyUI Manager → search ComfyUI-WanVideoWrapper, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-WanVideoWrapper
pip install -r ComfyUI-WanVideoWrapper/requirements.txt

then restart. This node relies on the FantasyPortrait model already being loaded, so you need those weights on disk (Kijai mirrors them under huggingface.co/Kijai/WanVideo_comfy) alongside your Wan model, VAE and text encoder.

Common issues & troubleshooting

"Missing nodes" on someone's FantasyPortrait workflow. The recurring FantasyPortrait gotcha: the fix is updating WanVideoWrapper, not installing a separate pack. Manager's "install missing nodes" often won't help because the class ships inside the wrapper - update the pack you have and restart.

No face found / empty embeds. The detector needs a reasonably clear, front-ish face in the driving frames. Tiny, side-profile, or heavily occluded faces may not register. Check the bbox output - if it's empty, detection failed, and no amount of scale tuning downstream will help.

Expression is over the top. Pull adapter_scale down first; if it's specifically the mouth flapping too much, target mouth_scale. The split exists precisely so you don't have to nuke the whole transfer to fix one part.

Expression is flat. Raise emo_scale for more brow/eye life, or adapter_scale for more of everything. And make sure your driving clip actually contains expression - a deadpan source gives a deadpan result.

CategoryWanVideoWrapper

Inputs (6)

NameTypeDefaultDescription
portrait_modelFANTASYPORTRAITMODEL
imagesIMAGE
adapter_scaleoptFLOAT1.000–10Scale for the adapter projection
mouth_scaleoptFLOAT1.000–10Scale for the mouth projection
emo_scaleoptFLOAT1.000–10Scale for the emotion projection
deviceoptCOMBOcudaDevice to run the model on

Outputs (3)

NameTypeDescription
portrait_embedsPORTRAIT_EMBEDS
bboxBBOX
landmarksLANDMARKS