Abstract
Style transfer presents a significant challenge, primarily centered on identifying an appropriate style representation. Conventional methods employ style loss, derived from second-order statistics or contrastive learning, to constrain style representation in the stylized result. However, these pre-defined style representations often limit stylistic expression, leading to artifacts. In contrast to existing approaches, we have discovered that latent features in vanilla diffusion models inherently contain natural style and content distributions. This allows for direct extraction of style information and seamless integration of generative priors into the content image without necessitating retraining. Our method adopts dual denoising paths to represent content and style references in latent space, subsequently guiding the content image denoising process with style latent codes. We introduce a Cross-attention Reweighting module that utilizes local content features to query style image information best suited to the input patch, thereby aligning the style distribution of the stylized results with that of the style image. Furthermore, we design a scaled adaptive instance normalization to mitigate inconsistencies in color distribution between style and stylized images on a global scale. Through theoretical analysis and extensive experimentation, we demonstrate the effectiveness and superiority of our diffusion-based zero-shot style transfer via adjusting style distribution, termed Z-STAR+.
Introduction: The Style-Content Trade-off
Style transfer—the art of applying the "look" of one image to the "content" of another—has long struggled with a fundamental trade-off: how do you define "style" mathematically?
Early methods used rigid statistics like Gram matrices, which often missed complex artistic nuances. Modern diffusion models are powerful, but using text prompts (e.g., "in the style of Van Gogh") is often too coarse to capture specific textures. Meanwhile, existing image-guided diffusion methods usually require time-consuming optimization for every new style or suffer from "content leakage," where objects from the style image accidentally bleed into the final result. Z-STAR+ aims to solve these issues by providing a plug-and-play, training-free solution that balances content preservation with vivid stylistic expression.
Methodology: Dual-Path Denoising and Distribution Alignment
The authors introduce a framework that operates entirely within the latent space of a pre-trained diffusion model (specifically Stable Diffusion v1.5). Their approach consists of three main pillars:
- Dual-path Denoising: The system concurrently processes two paths—one for the style reference and one for the content image. This ensures that features from both images are perfectly aligned at every step of the denoising process.
- Cross-attention Reweighting: Standard attention mechanisms often over-stylize images, leading to structural distortions. Z-STAR+ introduces a reweighted attention module that uses content features to "query" the style image. By integrating a balancing factor ($\lambda$) directly into the Softmax operation, the model can intelligently decide how much style to inject into specific local patches without destroying the underlying content structure.
- Scaled Adaptive Instance Normalization (SAIN): To fix global color inconsistencies, the authors observed that the "implicit style" is largely determined in the very first denoising steps. SAIN adjusts the global distribution of the content latent to match the style latent, using Kullback-Leibler (KL) divergence to scale the adjustment. This ensures the color palette is transferred accurately without washing out the content.
Key Results and Evaluation
Because Z-STAR+ is zero-shot, it does not require a training dataset. For evaluation and benchmarking, the authors used a diverse set of 100 style/content pairs featuring various artistic genres (oil painting, sketch, abstract, etc.).
- Quantitative Superiority: Z-STAR+ achieved the lowest Style Loss ($L_s = 3.63$) among all tested methods, indicating it captures artistic patterns more accurately than competitors like InST (4.70) or CAST (4.18).
- User Preference: In a comprehensive study involving 50 participants and 4,800 individual votes, Z-STAR+ was consistently preferred over other methods for overall quality, content preservation, and style representation.
- Visual Fidelity: Qualitatively, the results show much more vibrant brushstrokes and linear patterns compared to older CNN-based or transformer-based methods, which often look "flat" or "artificial."
- Temporal Stability: In video tasks, the method significantly reduced inter-frame variance (0.0041) compared to the "w/o consistency" baseline (0.0086).
Conclusion and Future Work
Z-STAR+ demonstrates that vanilla diffusion models already "know" what style and content are; we just need better ways to query those internal distributions. While highly effective, the authors acknowledge some areas for improvement, such as automating the selection of the optimal "injection" window and addressing the computational overhead of running dual denoising paths, which effectively doubles the memory requirement per step.
Summary updated