DiffusionRig: Learning Personalized Priors for Facial Appearance Editing

Zheng Ding, Xuaner Zhang, Zhihao Xia, Lars Jebe, Zhuowen Tu, Xiuming Zhang · DOI

Abstract

We address the problem of learning person-specific facial priors from a small number (e.g., 20) of portrait photos of the same person. This enables us to edit this specific person's facial appearance, such as expression and lighting, while preserving their identity and high-frequency facial details. Key to our approach, which we dub DiffusionRig, is a diffusion model conditioned on, or “rigged by,“ crude 3D face models estimated from single in-the-wild images by an off-the-shelf estimator. On a high level, DiffusionRig learns to map simplistic renderings of 3D face models to realistic photos of a given person. Specifically, DiffusionRig is trained in two stages: It first learns generic facial priors from a large-scale face dataset and then person-specific priors from a small portrait photo collection of the person of interest. By learning the CGI-to-photo mapping with such personalized priors, DiffusionRig can “rig“ the lighting, facial expression, head pose, etc. of a portrait photo, conditioned only on coarse 3D models while preserving this person's identity and other high-frequency characteristics.

Introduction

Photorealistically editing a person's face—changing their expression, rotating their head, or altering the lighting—is a classic challenge in computer vision. The primary hurdle is the "identity shift" problem: most existing models are trained on large, diverse datasets (zero-shot learning) and often fail to capture the subtle, high-frequency details that make a specific person recognizable.

While 3D Morphable Models (3DMMs) provide excellent control over geometry and lighting, their raw renderings look like "CGI"—flat and unrealistic. Conversely, generative models like GANs or standard diffusion models produce beautiful images but are notoriously difficult to control with physical precision. DiffusionRig bridges this gap by using 3D models to "rig" the diffusion process.

Methodology

The authors propose a two-stage pipeline called DiffusionRig:

  1. Stage 1: Learning Generic Priors. The model is first trained on the massive FFHQ dataset (70,000 images) to learn the general mapping between 3D geometry and realistic human faces. It uses the DECA estimator to extract "physical buffers" (surface normals, albedo, and Lambertian rendering) from images.
  2. Stage 2: Learning Personalized Priors. The model is fine-tuned on a tiny "personal album" (roughly 20 images) of a specific person. This allows the model to learn that person's unique wrinkles, skin texture, and features.
A crude 3D face model used as a physical buffer to "rig" the diffusion process.

Key Technical Components

  • Physical Buffers: These act as the "rig," providing pixel-aligned 3D guidance for the diffusion model.
  • Global Latent Code: Since 3DMMs cannot model everything—such as hair, glasses, or earrings—an encoder branch captures these "nuance features" into a global code that stays constant during editing.
  • Diffusion Generator: Based on the ADM (Ablated Diffusion Model) architecture, it takes the noisy image, the 3D physical buffers, and the global latent code to reconstruct the final edited image.
An input image featuring "nuance features" like sunglasses and a hat, which are captured by the global latent code to ensure identity preservation.

Key Insights and Ideas

The core innovation of DiffusionRig is the "Rigging" Metaphor: treating crude 3D renders not as the final output, but as a spatial "skeleton" or "rig" that guides the diffusion model. This allows for physical-based control (like moving a light source in 3D space) within a generative framework.

Furthermore, the paper demonstrates that you don't need thousands of images to capture an identity. By starting with a strong generic base, 20 images are sufficient to "anchor" the model to a specific person's appearance. By separating the input into local physical buffers (geometry/light) and a global latent code (hair/style), the model learns to change the face's pose or expression without accidentally changing the person's hairstyle or background.

Results and Evaluation

DiffusionRig was evaluated using personal albums of celebrities (e.g., Obama, Taylor Swift) and non-celebrities, comparing results against baselines like DECA, HeadNerf, and MyStyle.

  • Identity Preservation: DiffusionRig significantly outperformed GAN-based methods in preserving identity during dramatic pose and expression changes.
  • Quantitative Accuracy: In "DECA re-inference" tests, DiffusionRig achieved lower error rates (RMSE) than competitors, particularly in expression and pose accuracy.
  • User Study: In a study on Amazon Mechanical Turk, users preferred DiffusionRig over MyStyle for both realism and identity preservation (e.g., scoring ~87% for Obama's expression edits vs. MyStyle's ~79%).
  • Efficiency: While Stage 1 takes 15 hours on eight A100 GPUs, the Stage 2 personalization is remarkably fast, completing in about 30 minutes on a single V100 GPU.

Limitations and Future Work

The quality of the edit is currently capped by the accuracy of the underlying 3D estimator (DECA). If the estimator fails to capture an extreme pose correctly, the diffusion model will struggle. Additionally, dramatic head rotations can reveal parts of the background that were previously hidden, and the model currently lacks a dedicated mechanism for complex background inpainting. Future work may also address the "baked-in lighting" issue, where estimated lighting from the input image can occasionally affect the learned skin tone accuracy during extreme relighting.

Summary updated

BibTeX
@misc{ding2023diffusionrig,
  author = {Zheng Ding and Xuaner Zhang and Zhihao Xia and Lars Jebe and Zhuowen Tu and Xiuming Zhang},
  title = {{DiffusionRig: Learning Personalized Priors for Facial Appearance Editing}},
  year = {2023},
  eprint = {2304.06711},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.06711},
}
Figure