FaceShaper Load MediaPipe
The commercially-clean detector option for FaceShaper
- cropper
The pack gives you three ways to power its V2 face-cropping pipeline, and this is the one built on Google's MediaPipe instead of InsightFace. There's exactly one reason most people pick it over the InsightFace loader: licensing. MediaPipe is Apache 2.0, full stop - no non-commercial clause hiding in the model weights the way there is with InsightFace's buffalo_l. If you're building something you might ever sell, this is the loader you want.
Why this exists alongside the InsightFace loader
InsightFace is the default choice across nearly every identity/face-swap tool in the ecosystem (ReActor, InstantID, PuLID, the FaceID adapters), and it's genuinely good at what it does. But its code being MIT doesn't mean its models are - every InsightFace model pack, including the buffalo_l pack this pipeline's InsightFace loader depends on, is licensed for non-commercial research only, and that restriction follows the weights regardless of how you obtained them. MediaPipe sidesteps that entirely, at a real but modest cost: it's a landmarking/detection library, not an identity-recognition one, so it does the job FaceShaper actually needs (finding a face and its landmarks) without carrying the license baggage. This is a well-trodden path - Kijai made the identical swap in ComfyUI-LivePortraitKJ, the pack FaceShaper's crop code is adapted from, specifically to get out from under InsightFace's restriction, and other projects have kept doing the same thing since.
The tradeoff, in the words of the person who's actually benchmarked both head-to-head: InsightFace detects more extreme face angles, but MediaPipe otherwise keeps up, and it's noticeably faster on CPU. For most FaceShaper use - reasonably front-facing source and target photos - that's a fine trade.
The inputs that matter
landmarkrunner_onnx_device(defaultCPU, optionsCPU/CUDA/ROCM/CoreML/torch_gpu) - where the landmark model runs. Note the pack's own README calls out that MediaPipe can't run on GPU on Windows, so CPU is the realistic default there regardless of what you set here; on Linux or macOS you have more room to experiment withCUDAortorch_gpu.keep_model_loaded(defaulttrue) - keeps the model resident between runs rather than reloading it each time. Leave it on unless you're tight on memory.
The single output is cropper (FSMCROPPER), which plugs straight into FaceShaperCropper's cropper input - same as the InsightFace and FaceAlignment loaders, since all three produce the same handle type and are drop-in swaps for each other.
Installing it
Through ComfyUI Manager, search "ComfyUI_FaceShaper," or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/fssorc/ComfyUI_FaceShaper
then restart. This loader specifically needs MediaPipe installed, which the README covers with one line from inside the pack's own directory:
pip install -r requirement.txt
You'll also want landmark.onnx and landmark_model.pth, from Kijai/LivePortrait_safetensors on HuggingFace, placed under models/liveportrait - that's shared across all three cropper loaders and is where the actual landmark detection model lives, regardless of which detector backend you pick.
Common issues & troubleshooting
Faces at steep angles aren't detected well. This is the documented tradeoff, not a bug - MediaPipe's detection genuinely falls off on extreme angles compared to InsightFace. If your source or target photos aren't reasonably front-facing, try the InsightFace loader instead (accepting its licensing terms) or the FaceAlignment loader.
Trying to run this on GPU on Windows and it won't. That's a known limitation stated directly in the pack's README - MediaPipe can't use GPU on Windows. CPU is genuinely fast enough for this use case; it's part of why people reach for MediaPipe in the first place.
pip install -r requirement.txt fails or you can't find the file. It's inside the cloned pack's own folder (ComfyUI/custom_nodes/ComfyUI_FaceShaper/requirement.txt), not the ComfyUI root - run the command from there, or point pip at the full path.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| landmarkrunner_onnx_device | COMBO | CPU | 5 options: CPU, CUDA, ROCM, CoreML, torch_gpu |
| keep_model_loaded | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| cropper | FSMCROPPER | — |