Skip to main content
QUICK REVIEW

[Paper Review] Style Injection in Diffusion: A Training-free Approach for Adapting Large-scale Diffusion Models for Style Transfer

Jiwoo Chung, Sangeek Hyun|arXiv (Cornell University)|Dec 11, 2023
Generative Adversarial Networks and Image SynthesisComputer Science5 citations
TL;DR

This paper proposes a training-free style transfer method for large-scale diffusion models by injecting style through self-attention feature manipulation—substituting content image keys and values with those from a style image during inference. The approach preserves content structure and transfers style based on local texture similarity, achieving state-of-the-art performance without optimization.

ABSTRACT

Despite the impressive generative capabilities of diffusion models, existing diffusion model-based style transfer methods require inference-stage optimization (e.g. fine-tuning or textual inversion of style) which is time-consuming, or fails to leverage the generative ability of large-scale diffusion models. To address these issues, we introduce a novel artistic style transfer method based on a pre-trained large-scale diffusion model without any optimization. Specifically, we manipulate the features of self-attention layers as the way the cross-attention mechanism works; in the generation process, substituting the key and value of content with those of style image. This approach provides several desirable characteristics for style transfer including 1) preservation of content by transferring similar styles into similar image patches and 2) transfer of style based on similarity of local texture (e.g. edge) between content and style images. Furthermore, we introduce query preservation and attention temperature scaling to mitigate the issue of disruption of original content, and initial latent Adaptive Instance Normalization (AdaIN) to deal with the disharmonious color (failure to transfer the colors of style). Our experimental results demonstrate that our proposed method surpasses state-of-the-art methods in both conventional and diffusion-based style transfer baselines.

Motivation & Objective

  • Address the limitations of existing diffusion-based style transfer methods that require time-consuming optimization like fine-tuning or textual inversion.
  • Enable effective style transfer in large-scale pre-trained diffusion models, such as Stable Diffusion, without any retraining or optimization.
  • Leverage the intrinsic attention mechanism of self-attention layers to transfer style while preserving content semantics and spatial layout.
  • Mitigate issues such as content disruption and color disharmony through query preservation and adaptive instance normalization.
  • Achieve flexible style-content trade-off control via a learnable parameter, enabling user-adjustable stylization intensity.

Proposed method

  • Inject style by substituting the key and value features of self-attention layers in the content image's forward pass with those from the style image, particularly in later decoder layers sensitive to local textures.
  • Apply query preservation by retaining a portion of the original content query features to prevent distortion of the original image structure.
  • Introduce attention temperature scaling to sharpen attention maps, reducing blurriness and improving detail fidelity in generated images.
  • Apply initial latent Adaptive Instance Normalization (AdaIN) to align the color distribution of the generated image with the target style image.
  • Use a learnable parameter γ to control the trade-off between content preservation and style transfer intensity during inference.
  • Operate entirely at inference time without any model fine-tuning, textual inversion, or gradient-based optimization.

Experimental results

Research questions

  • RQ1Can self-attention features in pre-trained diffusion models be manipulated to enable training-free style transfer without fine-tuning or textual inversion?
  • RQ2Does substituting keys and values of self-attention layers with those from a style image preserve content structure and transfer style based on local texture similarity?
  • RQ3How effective are query preservation and attention temperature scaling in minimizing content disruption during style injection?
  • RQ4Can initial latent AdaIN effectively resolve color disharmony in style transfer results?
  • RQ5To what extent can the proposed method achieve flexible style-content trade-off control compared to existing baselines?

Key findings

  • The proposed method achieves a Style-Frechet Inception Distance (ArtFID) of 28.80 and FID of 18.13, outperforming state-of-the-art baselines in both conventional and diffusion-based style transfer.
  • Ablation studies confirm that style injection is essential for style transfer, with removal increasing ArtFID from 28.80 to 43.72 and FID from 18.13 to 27.13.
  • Attention temperature scaling significantly improves image quality, reducing FID from 18.13 (τ=1.0) to 17.21 (τ=1.5) and LPIPS from 0.505 to 0.535.
  • Initial latent AdaIN improves color transfer, reducing LPIPS from 0.505 (default) to 0.390 when removed, indicating better color fidelity.
  • The method enables flexible style-content trade-off via γ, with lower γ values producing stronger stylization and higher γ values preserving more content, as validated across FID and LPIPS metrics.
  • Compared to text-guided methods, the proposed approach achieves higher style fidelity, as text prompts fail to capture full style details like texture and color tones.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.