Less is More: Masking Elements in Image Condition Features Avoids Content Leakages in Style Transfer Diffusion Models

Lin Zhu, Xinbing Wang, Chenghu Zhou, Qinying Gu, Nanyang Ye

In the rapidly evolving landscape of generative AI, "style transfer" remains a highly sought-after capability for image personalization. The goal is intuitive: take the distinct visual flair of a reference image—such as the vibrant brushstrokes of a post-impressionist painting or the sleek neon aesthetic of a cyberpunk scene—and apply it to a completely new subject dictated by a text prompt.

However, current text-to-image diffusion models frequently stumble over a frustrating hurdle known as content leakage. Instead of merely adopting the requested style, the model accidentally "leaks" specific objects or structural elements from the reference image into the newly generated output.

A recent paper, "Less is More: Masking Elements in Image Condition Features Avoids Content Leakages in Style Transfer Diffusion Models," introduces a surprisingly simple, training-free solution to this pervasive issue.

The Problem: Entangled Conditions

When utilizing a style-reference image in models like Stable Diffusion, users provide two distinct conditions: a text prompt dictating the content (the "what") and a reference image dictating the aesthetic (the "how"). Ideally, these two inputs should remain independent.

In practice, they become deeply entangled in the model's latent space. If your style reference is a watercolor painting of a lighthouse and your text prompt is "a dog," the model will often generate a dog standing right next to a lighthouse. Previous state-of-the-art methods, such as InstantStyle, have attempted to mitigate this by subtracting features. Unfortunately, this often results in style degradation—yielding bland outputs—or forces users to manually fine-tune "style strength" coefficients for every single generation, a tedious and inconsistent process.

Comparison of style transfer methods showing content leakage in baselines versus the proposed masking approach.

The "Less is More" Approach: MaskST

To combat this, the researchers propose a novel method called MaskST, built entirely on a "less is more" philosophy. Instead of attempting to balance complex weights or subtract entire feature vectors, MaskST simply identifies and removes the specific parts of the image feature vector that represent "content."

The methodology breaks down into four straightforward steps:

  1. Feature Identification: The system extracts the image feature vector from the style reference and a corresponding text feature vector that describes the reference image's actual content.
  2. Clustering the Product: It computes the element-wise product of these two vectors. This mathematical step highlights the specific dimensions where the image and its content description are most highly correlated.
  3. Masking: Using K-means clustering, the method identifies the "high-means" cluster—the specific elements most responsible for carrying content information. These elements are then aggressively masked (set to zero).
  4. Inference: The resulting "masked" feature is fed directly into the cross-attention layers of a standard IP-Adapter.

Crucially, MaskST is entirely training-free and parameter-free. It requires no fine-tuning of the underlying diffusion model or the adapter network, making it highly accessible and efficient.

Key Insights and Performance

The core theoretical insight of the paper is that providing fewer conditioning signals can actually yield better generative results. By stripping away the "noisy" content elements from the image feature, the diffusion model is forced to focus exclusively on the remaining stylistic elements. The authors back this up with mathematical proofs demonstrating that diffusion models guided by these appropriately reduced conditions achieve a lower divergence between generated and target distributions.

The experimental results are highly compelling. Evaluated across a custom dataset and the comprehensive StyleBench benchmark (which covers 73 distinct styles), MaskST demonstrated significant superiority:

  • Human Preference: In a study of 3,520 generated images, MaskST achieved a Human Preference Score of 42.1%, vastly outperforming the next best methods like StyleShot (21.1%) and InstantStyle (7.9%).
  • High Fidelity: The method achieved a text alignment fidelity score of 0.972, proving it accurately renders the requested prompt without losing the subject.
  • Reduced Leakage: MaskST recorded the lowest "leakage score" (0.478) among all tested methods, confirming its ability to block unwanted reference objects.
  • Robust Stability: Unlike previous techniques that break down if the style strength coefficient is set too high, MaskST remains stable across various settings, eliminating the need for tedious manual tuning.

Looking Ahead

While highly effective, the authors note that MaskST relies heavily on the quality of the underlying CLIP embeddings. If CLIP fails to accurately represent a highly abstract or niche style, the masking process may lose precision. Additionally, the current implementation primarily uses a fixed cluster count ($K=2$), whereas an adaptive clustering approach based on image complexity could offer even finer control in the future.

Ultimately, this "less is more" masking principle proves that sometimes the best way to guide an AI is simply to tell it what not to look at. The researchers suggest this approach holds significant promise for expansion into other modalities, including video generation and 3D synthesis.

Summary updated

BibTeX
@inproceedings{zhu2025less,
  author = {Lin Zhu and Xinbing Wang and Chenghu Zhou and Qinying Gu and Nanyang Ye},
  title = {{Less is More: Masking Elements in Image Condition Features Avoids Content Leakages in Style Transfer Diffusion Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=88JJjsLtqr},
}
Figure