Skip to main content
Back

Tencent's IP-Adapter-FaceID Locks Facial Identity With a Single Reference Photo

A new open-source adapter on Hugging Face swaps CLIP image embeddings for face recognition vectors, locking identity across styles with a small LoRA.

Pro

  • New IP-Adapter-FaceID checkpoints on Hugging Face give zero-shot face conditioning for Stable Diffusion.
  • Uses InsightFace ID embeddings plus a small LoRA instead of CLIP image embeddings for identity lock.
  • Ships base, Plus, PlusV2, SDXL, and multi-image Portrait variants covering SD 1.5 and SDXL.
  • Portrait variant accepts up to five reference photos to tighten identity similarity without LoRA or ControlNet.
  • Released for research use only because upstream InsightFace weights are non-commercial.
  • Builds on the IP-Adapter paper and integrates directly with Hugging Face Diffusers pipelines.

A new experimental face-conditioning model has landed on Hugging Face under the h94/IP-Adapter-FaceID repository, extending the original IP-Adapter framework with something a lot of diffusion users have been asking for: reliable identity preservation from a single reference photo. Instead of feeding a CLIP image embedding into the diffusion model, this variant pipes in a face recognition embedding and pairs it with a small LoRA to keep the face consistent across generations.

The repository has already crossed 200,000 downloads and stars from more than 1,800 users, and it now powers over 100 Hugging Face Spaces including the popular multimodalart demo. It builds on the IP-Adapter paper from the tencent-ailab group, though the FaceID checkpoints themselves are released as an experimental extension by the model author.

Swapping CLIP for a face recognition backbone

IP-Adapter-FaceID uses a face ID embedding from a face recognition model instead of a CLIP image embedding, and adds a LoRA to improve ID consistency. In practice that means you extract a face vector with InsightFace, then hand it to the adapter as the conditioning signal, while a small LoRA nudges the base model toward preserving that identity throughout denoising.

Why bother? CLIP image embeddings are great at capturing vibe and composition but blur out the fine features that make a face recognizable. Face recognition embeddings are trained specifically to be identity-discriminative, which is exactly what you want if the goal is generating the same person in a hundred different scenes.

Four flavors, four tradeoffs

The repository ships several checkpoints tuned for different needs:

  • IP-Adapter-FaceID: the base variant, face ID embedding plus LoRA, for SD 1.5.
  • IP-Adapter-FaceID-Plus / PlusV2: combines the face ID embedding with a CLIP image embedding. In V2 the CLIP weight is adjustable, so you can dial how strongly the reference face structure leaks through.
  • IP-Adapter-FaceID-SDXL and PlusV2-SDXL: SDXL ports of the same ideas for higher-resolution generation.
  • IP-Adapter-FaceID-Portrait: same core approach as the base variant, but tuned for portrait generation with no LoRA and no ControlNet. It accepts multiple facial images to enhance similarity (five by default).

The multi-image portrait variant is the interesting one for anyone building avatar or profile-picture tools, because averaging five reference embeddings gives noticeably tighter identity lock than a single shot.

Wiring it into a diffusion pipeline

Usage is two steps: extract the embedding, then pass it into the IP-Adapter wrapper around a standard Diffusers pipeline. The pattern from the model card looks like this:

from insightface.app import FaceAnalysis
import cv2, torch
app = FaceAnalysis(name="buffalo_l",
    providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
app.prepare(ctx_id=0, det_size=(640, 640))
image = cv2.imread("person.jpg")
faces = app.get(image)
faceid_embeds = torch.from_numpy(faces[0].normed_embedding).unsqueeze(0)
ip_model = IPAdapterFaceID(pipe, ip_ckpt, device)
images = ip_model.generate(prompt="photo of a woman in a garden",
    faceid_embeds=faceid_embeds, num_samples=4,
    width=512, height=768, num_inference_steps=30, seed=2023)

The Diffusers documentation notes that DDIMScheduler or EulerDiscreteScheduler are recommended for face models, which lines up with the DDIM setup in the code above.

Where it fits, and where it strains

The strengths line up with the design goals. The FaceID variants can hold a facial identity steady while applying dramatic style changes, generating the same face as an oil painting, an anime character, or dropped into wildly different environments. The patch embeddings capture facial structure better than global embeddings, and the LoRA enhancement in FaceID-Plus tightens consistency further. That makes it a solid drop-in for style-transfer avatars, character consistency in illustration workflows, and any pipeline that already leans on Stable Diffusion 1.5 or SDXL.

The author is upfront about the ceiling. The model card lists two limits: outputs do not achieve perfect photorealism or ID consistency, and generalization is bounded by the training data, the base diffusion model, and the face recognition model underneath. Expect drift on unusual angles, occlusions, or faces underrepresented in InsightFace training data.

The licensing catch

Read the license carefully before plugging this into a product. The model card states that because InsightFace pretrained models are available for non-commercial research purposes only, the IP-Adapter-FaceID checkpoints are released exclusively for research and are not intended for commercial use. That inheritance from the upstream face recognition weights is the constraint, not the adapter itself, though the practical effect is the same: this belongs in research prototypes and personal projects, not shipped SaaS.

Why this release matters

Identity preservation has been one of the messier problems in open diffusion tooling. Textual inversion and DreamBooth both require training per subject, and generic IP-Adapter captures style but loses the face. Swapping in a purpose-built recognition embedding, then keeping it stable with a lightweight LoRA, delivers zero-shot identity transfer from a single reference image with a checkpoint measured in tens to a couple hundred megabytes. For anyone experimenting with character-consistent generation on top of Stable Diffusion, that beats fine-tuning as a starting point by a wide margin.