Domain Generalizable Portrait Style Transfer

Xinbo Wang, Wenju Xu, Qing Zhang, Wei-Shi Zheng · DOI

TL;DR

This paper introduces a novel diffusion-based framework for domain-generalizable portrait style transfer. It achieves high-quality, semantically aligned stylization across diverse domains by establishing dense correspondences between portraits and employing a unique AdaIN-Wavelet transform for balancing content and style.

What Problem Does This Paper Address?

Portrait style transfer aims to apply the artistic style of a reference image to a target portrait while preserving the target's identity and facial structure. Existing methods often struggle with domain generalization, meaning they perform poorly when the input and reference portraits come from significantly different sources (e.g., photos vs. sketches, different artistic styles). This limitation arises from difficulties in establishing accurate semantic correspondences between facial regions (like eyes, hair, skin) across these diverse domains. Furthermore, achieving a good balance between faithfully transferring the style and retaining the original content can be challenging, with many methods either over-stylizing or failing to capture fine details.

Methods

The proposed method, Domain Generalizable Portrait Style Transfer (DGPST), leverages diffusion models to address these challenges. Key components include:

  • Semantic-Aware Style Alignment: To overcome domain generalization issues, the authors establish dense semantic correspondences. This involves a "semantic adapter" that uses a pre-trained diffusion model and a CLIP encoder to extract features. Crucially, they introduce a "mask warping loss" and "cyclic warping consistency loss" to ensure these correspondences are robust and semantically consistent, even across different domains.
  • Semantic-Aware Image Warping: Using the established correspondences, the reference portrait is warped to align semantically with the input portrait. This creates a "warped reference" that is better suited for style transfer.
  • AdaIN-Wavelet Transform for Initial Latent: To balance content preservation and stylization, a novel initialization strategy is proposed. It involves performing DDIM inversion on the warped reference to get its latent representation. Then, AdaIN (Adaptive Instance Normalization) is applied to blend the low-frequency information of this warped reference latent with the high-frequency information of the input latent. This is further refined using a Discrete Wavelet Transform (DWT) to integrate high-frequency components from the input and low-frequency components from the warped reference.
  • Dual-Conditional Diffusion Model: The core generation process uses a diffusion model (specifically, Stable Diffusion) conditioned on both content and style.
  • Structure Guidance: A ControlNet is employed to extract and inject high-frequency structural information from the input portrait, ensuring content preservation.
  • Style Guidance: A "style adapter" is used to extract style information from the warped reference and inject it into the diffusion model's cross-attention layers.

Datasets

The paper uses the following datasets:

  • CelebAMask-HQ: Used for training, containing 30K high-resolution portraits with detailed facial segmentation masks.
  • FFHQ: Used for evaluation, comprising 70K high-quality images of human faces.
  • AAHQ: Used for evaluation, featuring approximately 25K high-quality artistic images with varied styles.

The model is trained solely on the 28K training images from CelebAMask-HQ to demonstrate its domain generalization capabilities.

Key Insights and Ideas

  • Dense Semantic Correspondence is Key for Domain Generalization: The core insight is that robust, dense semantic alignment between input and reference portraits is crucial for transferring styles across diverse domains (photos, sketches, cartoons). Simply aligning global features is insufficient.
  • AdaIN-Wavelet Transform for Balanced Latent Initialization: The proposed AdaIN-Wavelet transform is a clever way to initialize the diffusion process. It effectively blends the stylistic richness of the warped reference with the structural integrity of the input, striking a critical balance that prior methods struggled with.
  • Dual Conditioning for Control: Combining ControlNet for structural guidance and a dedicated style adapter for style guidance within a diffusion framework provides fine-grained control over the generation process, leading to more faithful and coherent results.
  • Leveraging Pre-trained Models Effectively: The method builds upon powerful pre-trained diffusion models and CLIP, demonstrating how these can be adapted and enhanced for specific, challenging tasks like domain-generalizable portrait style transfer.

Key Results

  • Quantitative Performance: The method achieves competitive Gram loss (style similarity) while significantly outperforming state-of-the-art methods in LPIPS (content preservation) and Identity Distance (ID) scores on both CelebAMask-HQ and mixed datasets. For instance, on a mixed dataset, it achieves the lowest Gram loss and superior LPIPS/ID scores.
  • Qualitative Performance: The results show highly faithful stylization effects, effectively transferring styles to semantically aligned regions. The method demonstrates strong domain generalization, producing good results for photo-to-sketch, photo-to-animation, colorizing grayscale images, and modernizing old photographs.
  • Inference Speed: The model processes 512x512 images in approximately 6.97 seconds on an NVIDIA RTX 4090, which is more efficient than some other diffusion-based methods.

Limitations and Future Work

  • Limitations: While the paper highlights domain generalization, the training is primarily on CelebAMask-HQ. The performance on extremely novel or out-of-distribution domains might still be a challenge. The paper also notes that for certain tasks (like training the second stage), image pairs are not available, requiring the use of the input image for both content and style extraction.
  • Future Work: The authors suggest that their framework can be extended to other image editing tasks. The current work focuses on portrait style transfer, and future research could explore its application to broader image manipulation scenarios. The controllable region-specific style transfer and style interpolation capabilities also suggest avenues for more interactive and user-controlled editing tools.

Summary updated

BibTeX
@inproceedings{wang2025domain,
  author = {Xinbo Wang and Wenju Xu and Qing Zhang and Wei-Shi Zheng},
  title = {{Domain Generalizable Portrait Style Transfer}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure