StyleDiffusion: Controllable Disentangled Style Transfer via Diffusion Models

Zhizhong Wang, Lei Zhao, Wei Xing

Introduction

The "holy grail" of style transfer is perfect disentanglement: the ability to separate an image's "content" (the objects and structures) from its "style" (the brushstrokes, colors, and textures). Despite years of research, achieving this remains difficult. Existing methods typically fall into two categories: explicit mathematical definitions, such as Gram matrices, which often fail to capture complex textures and inadvertently distort content; and implicit learning via GANs, which often act as "black boxes" that are difficult to control and limited to specific domains.

StyleDiffusion is a novel framework that addresses these limitations by leveraging diffusion models and CLIP-based latent spaces. By explicitly extracting content and implicitly learning style as its "complement," StyleDiffusion achieves high-fidelity, controllable style transfer that preserves structural details far better than previous state-of-the-art (SOTA) methods.

The StyleDiffusion Framework

The authors introduce a three-component architecture designed to isolate and manipulate style without compromising the underlying content structure.

1. Style Removal Module

To identify the "pure" content of an image, StyleDiffusion uses a pre-trained diffusion model as a sophisticated "eraser." The process involves a partial forward diffusion process (adding noise) followed by a deterministic reverse process (DDIM) applied to a grayscale version of the image. This "smooths out" artistic textures and brushstrokes, leaving behind a domain-aligned content representation ($I_c$).

2. Style Transfer Module

Rather than using a fixed transformation, the framework fine-tunes the reverse process of a diffusion model ($\epsilon_\theta \to \hat{\epsilon}_\theta$). This allows the model to learn the specific generative "rules" and distributions of a target style, resulting in more natural and harmonious textures.

3. CLIP-based Disentanglement Loss ($L_{SD}$)

The core innovation of this paper is the definition of style as the semantic complement of content in the CLIP latent space. The authors utilize a combination of L1 loss to match style distance and Direction loss to ensure the content-to-stylization vector in the latent space aligns with the style image’s own content-to-style vector. Additionally, a Style Reconstruction Prior ($L_{SR}$) is used to task the model with reconstructing the original style image from its extracted content, providing a high-quality initialization for the fine-tuning process.

Key Insights and Controllability

One of the most significant advantages of StyleDiffusion is its inherent controllability. Because diffusion is an iterative process, the intensity of style removal or transfer can be precisely adjusted by changing the number of steps ($T_{remov}$ or $T_{trans}$). This allows for a continuous trade-off between content preservation and stylistic expression.

Furthermore, the paper demonstrates that diffusion models are inherently better suited for art than GANs. Diffusion models can learn complex, multi-scale distributions of artistic textures, whereas GANs frequently produce "disharmonious artifacts" or messy, inconsistent textures when applied to diverse artistic styles.

Experimental Results

Quantitative and Qualitative Performance

StyleDiffusion was evaluated against 10 SOTA baselines using a diverse set of 32 content images and 12 style images. The framework achieved the highest SSIM (0.672) and CLIP Score (0.741), indicating superior content preservation and more accurate style alignment. Qualitatively, the results show significantly sharper details—such as the eyes of animals or fine architectural lines—and more natural-looking textures compared to traditional methods like Gatys or AdaAttN.

User Preference and Versatility

In user studies, StyleDiffusion was consistently preferred for both style pattern transfer and overall stylization quality. The framework also extends to challenging tasks like photo-realistic style transfer and multi-modal manipulation, where text prompts (e.g., "+ Sketch" or "+ Cubism") can be used to further refine the output.

Limitations and Future Directions

Despite its performance, StyleDiffusion faces challenges regarding efficiency. Diffusion models are computationally expensive; while training takes approximately 0.4 hours per style, inference takes roughly 5.6 seconds per image, making it slower than real-time feed-forward networks. Additionally, the current model requires per-style fine-tuning. Future research will likely focus on "arbitrary style transfer" (zero-shot) to eliminate the need for individual model training for every new style.

Summary updated

BibTeX
@inproceedings{wang2023stylediffusion,
  author = {Zhizhong Wang and Lei Zhao and Wei Xing},
  title = {{StyleDiffusion: Controllable Disentangled Style Transfer via Diffusion Models}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
}
Figure