Inversion-based Style Transfer with Diffusion Models

Yuxin Zhang, Nisha Huang, Fan Tang, Haibin Huang, Chongyang Ma, Weiming Dong, Changsheng Xu

Abstract

InST (Inversion-based Style Transfer) is a novel framework that leverages latent diffusion models to capture the stylistic essence of a single painting—including brushstrokes, shapes, and semantic elements—and apply it to new images. By treating artistic style as a learnable "new word" in a text-to-image model's vocabulary, InST achieves high stylistic fidelity and editability, surpassing traditional style transfer methods that often focus solely on low-level features like color and texture.

Introduction

Traditional image style transfer methods typically focus on low-level features such as color palettes and textures. However, true artistic style encompasses high-level attributes, including unique shape distortions and specific decorative motifs. While modern text-to-image models like Stable Diffusion are powerful, they suffer from a "vocabulary gap," making it difficult to describe the nuanced style of a specific painting using standard language. Previous attempts to bridge this gap required complex prompt engineering or failed to preserve the structural integrity of the content image. InST addresses this by learning a style directly from a single image and applying it accurately without manual prompting.

Methodology

InST is built upon the Stable Diffusion architecture and introduces two primary technical innovations:

  1. Attention-Based Textual Inversion: Instead of manual descriptions, the style is treated as a unique placeholder token, [C]. A multi-layer cross-attention mechanism maps the CLIP image embedding of a style reference into the text-embedding space. This approach is significantly more efficient than previous optimization-based methods, achieving convergence approximately 10 times faster.
  2. Stochastic Inversion: To preserve the content image's layout (e.g., a city street), InST uses stochastic inversion. By adding noise to the content image and predicting it back through the diffusion model, the framework establishes a starting point that maintains original semantics while allowing the new style to be integrated.
Comparison of different style transfer paradigms, highlighting the InST approach.

Experimental Results

The authors evaluated InST across a wide range of artistic references, including works by Kandinsky and Monet, and various styles such as oil paintings and sketches.

Qualitative results of InST across diverse artistic styles and content types.

Key Insights

  • Style as a "New Word": Treating a specific artwork's style as a concept in the model's vocabulary allows for flexible usage, such as "A cat in the style of [C]."
  • Semantic Transfer: Unlike CNN-based methods, InST can transfer semantic elements, such as specific flower headwear or geometric patterns, onto the content image.
  • Efficiency: The attention-based mapping reduces the required iterations to approximately 1,000, making the process practical for consumer GPUs.

Performance Comparison

In qualitative comparisons, InST demonstrated a superior ability to alter object shapes to match artistic references. A user study involving 87 participants showed a strong preference for InST, with an 83.9% preference rate over IEST and 69% over AdaAttN. Furthermore, the model exhibits high editability; style embeddings can be combined with new text prompts to synthesize entirely new scenes (e.g., a "Kandinsky-style spaceship").

Conclusion and Future Work

While InST represents a significant advancement, challenges remain in precise color correspondence, sometimes requiring an additional tone transfer module. Additionally, the performance is tied to the capabilities of the underlying diffusion model. Future research may extend this inversion-based approach to video style transfer or 3D asset generation.

Summary updated

BibTeX
@inproceedings{zhang2023inversion,
  author = {Yuxin Zhang and Nisha Huang and Fan Tang and Haibin Huang and Chongyang Ma and Weiming Dong and Changsheng Xu},
  title = {{Inversion-based Style Transfer with Diffusion Models}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
  doi = {10.1109/cvpr52729.2023.00978},
}
Figure