NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

LatRef-Diff: Latent and Reference-Guided Diffusion for Facial Attribute Editing and Style Manipulation

Wenmin Huang, Weiqi Luo, Xiaochun Cao, Jiwu HuangarXiv 2026

TL;DR

The authors introduce LatRef-Diff, a novel diffusion-based framework that achieves both precise facial attribute editing and fine-grained style manipulation (e.g., choosing specific types of glasses or hairstyles). By replacing rigid linear semantic directions with flexible style codes and introducing a self-supervised forward-backward consistency training strategy, the model delivers state-of-the-art editing quality without requiring paired training data.

What Problem Does This Paper Address?

Facial attribute editing tasks usually fall into two categories: basic attribute modifications (e.g., adding or removing a smile) and style manipulation (e.g., specifying whether a pair of eyeglasses should be thin-framed, black sunglasses, or brown sunglasses).

While Generative Adversarial Networks (GANs) have historically excelled at style manipulation, they are notoriously plagued by training instability, non-convergence, and mode collapse. Conversely, recent diffusion models offer incredible image generation quality and stable training, but they typically rely on moving latent representations along fixed, linear semantic directions. This design choice limits their expressiveness, making it difficult to perform fine-grained style manipulation. Furthermore, training a model to handle diverse styles usually requires paired images (the same face before and after editing), which are extremely rare in real-world datasets.

Methods

LatRef-Diff bridges the gap between the stability of diffusion models and the stylistic flexibility of GANs using three core architectural components and a unique training strategy:

Fig. 2. The network architecture of the proposed LatRef-Diff, consisting of four components: (a) mapper M, (b) extractor E, (c) style modulation encoder F, and (d) denoising UNet ϵ.
  1. Style Code Generation (Mapper & Extractor): Instead of using static semantic vectors, the framework generates dynamic style codes. Users can choose latent guidance (where a Mapper network generates a random style from Gaussian noise) or reference guidance (where an Extractor network pulls a specific style from a reference image).
  2. Style Modulation Encoder ($F$): This module injects the style code into the target image features. To prevent different attributes from interfering with each other, the authors introduce a hierarchical design (tags $\rightarrow$ attributes), learnable vectors for Adaptive Instance Normalization (AdaIN), and cross-attention mechanisms to blend local and global details seamlessly.
  3. Denoising UNet ($\epsilon$): A conditional DDIM (cDDIM) handles the actual image generation, reversing a deterministic noising process conditioned on the modified semantic code from the encoder.

Forward-Backward Consistency Training Strategy (FBCTS)

To train the network without paired data, the authors designed a clever self-supervised cycle:

  • Removal (Forward): The target attribute is approximately removed in the latent space using an image-specific semantic direction. This direction is adaptively calculated by swapping mask regions with a random reference image to ensure background and unrelated details are preserved.
  • Restoration (Backward): The style modulation module is tasked with restoring the attribute back to its original state. The network is optimized using a combination of perceptual loss (to keep the face looking like the original person) and classification loss (to ensure the attribute is correctly applied).
Detailed workflow of the forward-backward consistency training strategy.

Datasets

The model was trained and evaluated on the CelebA-HQ dataset, which consists of 30,000 high-quality facial images with binary attribute annotations. The authors split their experiments into two settings:

  • Setting #1 (Style Manipulation): 27,000 images for training, 3,000 for testing. Evaluated on Bangs and Eyeglasses due to their high stylistic diversity.
  • Setting #2 (Attribute Editing): 27,176 images for training, 2,824 for testing. Evaluated on Smile, Young, and Male.

Key Insights and Ideas

  • Ditching Linear Directions: Moving away from global, linear trajectories in the latent space toward dynamic style codes allows diffusion models to capture the full diversity of an attribute (e.g., distinguishing between reading glasses and sunglasses).
  • Image-Specific Trajectories: Applying a uniform attribute-removal vector across all images often causes artifacts due to individual facial differences. Calculating an adaptive, image-specific direction via regional masking ensures that unrelated facial details remain completely untouched during the cycle-training phase.
  • Adversarial-Free Training: By framing the training as a self-supervised "remove-and-restore" cycle, the framework completely bypasses the need for a GAN discriminator, preserving the inherent training stability of diffusion models.

Key Results

LatRef-Diff was compared against top-tier GAN baselines (HiSD, VecGAN++, SDGAN, BSGAN) and text-driven diffusion models (InstructPix2Pix, I-CLIP).

Quantitative Performance

  • Style Manipulation (Setting #1): In latent-guided manipulation, LatRef-Diff achieved a state-of-the-art average Fréchet Inception Distance (FID) of 43.27 and a top-tier classification accuracy of 96.60%, significantly outperforming SDGAN.
  • Attribute Editing (Setting #2): For standard attribute changes, LatRef-Diff achieved an average FID of 30.14 and an accuracy of 97.04%, outperforming the previous leading diffusion baseline, DiffAE (which scored 34.06 FID and 91.60% accuracy).

Qualitative Performance

Visually, competing GAN methods frequently introduced blurring or unwanted modifications to backgrounds, clothing, and hats. Text-guided models like InstructPix2Pix struggled to capture fine-grained style details from text prompts alone and showed high sensitivity to random seeds. LatRef-Diff consistently generated realistic hair textures and accurate lens reflections while perfectly preserving the subject's identity and background.

Limitations and Future Work

While LatRef-Diff marks a significant step forward, the authors note a few areas for improvement:

  • Architectural Upgrades: The current framework relies on standard MLP and CNN blocks for the mapper and extractor modules. The authors plan to explore advanced transformer architectures to improve style code extraction.
  • End-to-End Fine-Tuning: Currently, parts of the pre-trained diffusion model remain frozen during training. Fine-tuning the entire framework end-to-end could unlock even higher image synthesis quality.

Summary updated

BibTeX
@misc{huang2026latref,
  author = {Wenmin Huang and Weiqi Luo and Xiaochun Cao and Jiwu Huang},
  title = {{LatRef-Diff: Latent and Reference-Guided Diffusion for Facial Attribute Editing and Style Manipulation}},
  year = {2026},
  eprint = {2604.21279},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.21279},
}
Figure