InstructPix2NeRF: Instructed 3D Portrait Editing from a Single Image

Jianhui Li, Shilong Liu, Zidong Liu, Yikai Wang, Kaiwen Zheng, Jinghui Xu, Jianmin Li, Jun Zhu

Abstract

With the success of Neural Radiance Field (NeRF) in 3D-aware portrait editing, a variety of works have achieved promising results regarding both quality and 3D consistency. However, these methods heavily rely on per-prompt optimization when handling natural language as editing instructions. Due to the lack of labeled human face 3D datasets and effective architectures, the area of human-instructed 3D-aware editing for open-world portraits in an end-to-end manner remains under-explored. To solve this problem, we propose an end-to-end diffusion-based framework termed InstructPix2NeRF, which enables instructed 3D-aware portrait editing from a single open-world image with human instructions. At its core lies a conditional latent 3D diffusion process that lifts 2D editing to 3D space by learning the correlation between the paired images' difference and the instructions via triplet data. With the help of our proposed token position randomization strategy, we could even achieve multi-semantic editing through one single pass with the portrait identity well-preserved. Besides, we further propose an identity consistency module that directly modulates the extracted identity signals into our diffusion process, which increases the multi-view 3D identity consistency. Extensive experiments verify the effectiveness of our method and show its superiority against strong baselines quantitatively and qualitatively.

1. Introduction

InstructPix2NeRF is a novel end-to-end framework designed to bridge the gap between 2D image editing and 3D-aware portrait manipulation. While 2D models like InstructPix2Pix have revolutionized image editing, 3D portrait editing has historically suffered from rigidity (limited to preset attributes), inefficiency (requiring minutes of per-prompt optimization), and identity loss during the 2D-to-3D lifting process. InstructPix2NeRF addresses these challenges by enabling fast, free-form natural language editing of 3D portraits from a single 2D image while strictly preserving the subject's identity.

2. Methodology

The framework operates in the latent space of a 3D generator, specifically leveraging the $W+$ space of the EG3D architecture.

The InstructPix2NeRF architecture overview, featuring a Diffusion Transformer (DiT) that integrates latent codes, identity signals, and text instructions for 3D-aware editing.

2.1 Latent 3D Diffusion

Instead of diffusing pixels, the model utilizes a Diffusion Transformer (DiT) backbone to learn the correlation between an original image's latent code, a text instruction, and the resulting edited 3D latent code. This approach allows the model to generate edited 3D portraits in just a few seconds using 15-step DDIM sampling.

2.2 Token Position Randomization (TPR)

To handle complex, multi-attribute instructions (e.g., "add glasses and turn her hair red") in a single pass, the authors introduced TPR. By randomly shifting the starting position of text tokens during training, the model avoids the common bias of over-prioritizing the first few words of a prompt.

2.3 Identity Consistency Module

Identity preservation is treated as a constant "anchor signal." The framework modulates the diffusion process directly with identity features extracted from a face recognition model (ArcFace) using Adaptive Layer Normalization (AdaLN). This ensures that the subject's unique facial structure is not washed away by the editing process.

3. Dataset Synthesis

Training an end-to-end 3D editor requires triplet data (Original Image, Edited Image, Instruction), which does not exist naturally for 3D scenes. The researchers synthesized a dataset of 640,000 examples by:

  • Using 40,000 real faces from the FFHQ dataset.
  • Applying 2D editing tools (e4e and InstructPix2Pix) to create target edits.
  • Utilizing ChatGPT to generate natural language instructions describing the transitions.

4. Results and Evaluation

InstructPix2NeRF significantly outperforms existing baselines in both speed and quality.

Qualitative results showing instructed 3D editing (e.g., beard removal) with high 3D consistency across different viewpoints and strong identity preservation.

4.1 Key Performance Metrics

  • Identity Preservation (ID): The model achieved scores of 0.55–0.60, significantly higher than the ~0.40–0.45 seen in competitive baselines.
  • 3D Consistency: Qualitative head rotations demonstrate that edits (such as glasses or facial hair) remain perfectly placed without the "texture flickering" common in 2D-to-3D pipelines.
  • Instruction Following: The model shows superior alignment with text prompts, effectively distinguishing between "adding" and "removing" features.

5. Conclusion

InstructPix2NeRF provides a robust solution for instructed 3D portrait editing, achieving high-quality results in seconds. While limitations such as semantic ambiguity in prompts and the loss of extremely fine eye details remain, the framework sets a new benchmark for identity-consistent 3D-aware editing. Future work will explore extending these capabilities to full-body editing and complex open-world scenes.

Summary updated

BibTeX
@inproceedings{li2024instructpix,
  author = {Jianhui Li and Shilong Liu and Zidong Liu and Yikai Wang and Kaiwen Zheng and Jinghui Xu and Jianmin Li and Jun Zhu},
  title = {{InstructPix2NeRF: Instructed 3D Portrait Editing from a Single Image}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=XIxhINXtQk},
}
Figure