Real-Time 3D-Aware Portrait Editing from a Single Image

Qingyan Bai, Zifan Shi, Yinghao Xu, Hao Ouyang, Qiuyu Wang, Ceyuan Yang, Xuan Wang, Gordon Wetzstein, Yujun Shen, Qifeng Chen

Abstract

3DPE is a novel framework that enables high-fidelity, 3D-consistent portrait editing from a single image in real-time (~0.04s). By distilling the editing power of 2D diffusion models and the geometric priors of 3D GANs into a lightweight feedforward network, it achieves a 100x speedup over previous state-of-the-art methods while supporting fast adaptation to custom styles.

Introduction

Portrait editing has seen massive leaps thanks to 2D diffusion models, but bringing those edits into the 3D world—where the face remains consistent as you rotate the camera—remains a significant bottleneck. Current approaches generally fall into two camps, both with significant drawbacks:

  1. 3D GAN Inversion: These methods map an image into the latent space of a 3D generator. They are often limited to predefined attributes (like age or smile) and struggle with complex textures or "out-of-distribution" edits.
  2. Score Distillation Sampling (SDS): This involves using a 2D diffusion model to guide a 3D representation through iterative optimization. While the results are high-quality, the process is agonizingly slow—often taking minutes per image—making it impractical for real-time applications like AR/VR or video conferencing.

3DPE addresses these issues by introducing a "third way": a method as flexible as diffusion models but as fast as a simple feedforward neural network.

Methodology

The core innovation of 3DPE is knowledge distillation. Instead of running a heavy diffusion model at inference time, the authors "bake" its capabilities into a lightweight module.

Architecture and Prompt Injection

The system builds upon the Live3D framework, utilizing the EG3D triplane representation. It employs a two-branch encoder:

  • $E_{low}$: Captures coarse geometry and structural information.
  • $E_{high}$: Captures fine-grained textures and high-frequency details.

To handle instructions (such as "make him a zombie" or a reference image), a Prompt Encoder ($E_p$) is introduced. This encoder uses a Transformer architecture (MAE for images, CLIP for text) to create embeddings. These embeddings are injected into the high-level feature branch via a cross-attention mechanism, ensuring the edit is conditioned on the user's intent.

Dual-Prior Distillation

The model is trained using two types of "teachers":

  • 2D Diffusion Prior: InstructPix2Pix generates thousands of edited 2D images (pseudo-labels), which the model learns to mimic.
  • 3D GAN Prior: To ensure edits maintain 3D structural integrity, the pretrained Live3D model provides triplane and depth supervision. This prevents edits from appearing as "flat stickers" on the face.
3DPE demonstrates high-fidelity edits with consistent novel-view synthesis from both image and text prompts.

Key Insights

  • Disentanglement: The two-branch encoder naturally separates geometry from appearance. By freezing the geometry branch ($E_{low}$), the model ensures the edited face preserves the original person’s bone structure, preventing "identity drift."
  • Feedforward Efficiency: Shifting from iterative optimization (SDS) to a feedforward distillation approach enables the massive speedup. The network learns the mapping of the edit rather than solving it from scratch for every instance.
  • Fast Adaptation: Because the geometry branch is frozen, the model only needs to learn style changes. This allows users to provide just 10 image pairs and fine-tune the model for a new, custom style in approximately 5 minutes.

Experimental Results

3DPE was evaluated using the FFHQ dataset for real faces and InstructPix2Pix to generate 20,000 training pairs across 20 styles. Performance on video sequences was tested using TalkingHead-1KH.

Efficiency and Consistency

As shown in the comparison below, 3DPE offers a massive leap in processing speed. While optimization-based methods like PTI + StyleCLIP can take up to 360 seconds, 3DPE processes an image in just 0.04s.

Efficiency comparison showing 3DPE (Ours) achieving real-time performance (0.04s) compared to 10s for IP2P+Live3D and 360s for PTI+StyleCLIP.

Quantitatively, 3DPE outperformed baselines in 3D consistency metrics (0.76 vs 0.72-0.75) and maintained higher identity similarity scores ($ID_t$) than most diffusion-based baselines.

Conclusion and Future Work

3DPE provides a viable path for real-time 3D-aware portrait editing. While the model currently inherits some artifacts from the underlying EG3D framework and can exhibit slight temporal flickering in video, it represents a significant step forward in speed and consistency. Future research will focus on native video training to improve temporal stability and exploring more complex non-rigid geometric edits.

Summary updated

BibTeX
@inproceedings{bai2024real,
  author = {Qingyan Bai and Zifan Shi and Yinghao Xu and Hao Ouyang and Qiuyu Wang and Ceyuan Yang and Xuan Wang and Gordon Wetzstein and Yujun Shen and Qifeng Chen},
  title = {{Real-Time 3D-Aware Portrait Editing from a Single Image}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72983-6\_20},
}
Figure