Attention Editing for Style Transfer in Diffusion Models

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing image style transfer methods using fine-tuned diffusion models are time-consuming and prone to overfitting, with a style transfer effect that depends on the distribution of training data, leading to inefficient and costly deployment and use.

Innovation Solution

A non-training image style transfer method based on attention editing, where a first cross-attention feature is edited using a second cross-attention feature of an image feature and a text feature, allowing continuous introduction of reference image information into the diffusion model for generating target images consistent with the reference image in terms of content and style.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If fine-tuned diffusion models are used for image style transfer, then style transfer effect can be achieved, but the process is time-consuming and prone to overfitting

Engineering Contradiction:
Improvestyle transfer effectVSAvoidtraining time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The diffusion model is pre-trained on a large dataset of image-text pairs before being used for style transfer. This preliminary training establishes the model's foundational capabilities, allowing it to perform style transfer without requiring additional fine-tuning for each specific task, thereby reducing time loss while maintaining reliable style transfer effects.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent extracts cross-attention features from the pre-trained diffusion model and uses them to generate style transfer results. By copying and reusing the learned representations from the pre-trained model rather than retraining, the system achieves efficient style transfer without the time-consuming fine-tuning process, preventing overfitting while maintaining transfer quality.

Inventive Principle:
Principle #26Copying

2Reliability

If fine-tuned diffusion models are used for image style transfer, then style transfer effect can be achieved, but deployment and use become inefficient and costly

Engineering Contradiction:
Improvestyle transfer effectVSAvoiddeployment efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The pre-trained diffusion model serves multiple functions: it can perform general image generation tasks and specifically style transfer tasks without requiring separate fine-tuning for each application. This universality allows the same model to be deployed efficiently across different style transfer scenarios, improving productivity while maintaining reliable style transfer effects through the extraction and use of cross-attention features.

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Reliability

If fine-tuned diffusion models are used for image style transfer, then style transfer effect can be achieved, but the effect depends on the distribution of training data, leading to poor generalization

Engineering Contradiction:
Improvestyle transfer effectVSAvoidgeneralization capability
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The patent extracts cross-attention features from the pre-trained diffusion model, separating the style transfer capability from the specific training data distribution. By taking out and reusing these attention features across different style transfer tasks, the system achieves better generalization while maintaining reliable style transfer effects, as the extracted features capture universal style patterns rather than being overly specific to one dataset distribution.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS20250095250A1Image style transfer
Publication Date: 2025.03.20 BEIJING BAIDU NETCOM SCI & TECH CO LTD
  • US20250095250A1 patent drawing
  • US20250095250A1 patent drawing
  • US20250095250A1 patent drawing

AI summary

A method is provided that includes: obtaining a reference image and a description text; extracting a text feature of the description text; and performing the following operations based on a pre-trained diffusion model to generate a target image: in each time step of the diffusion model: calculating a first cross-attention feature of a first image feature and the text feature; obtaining a second cross-attention feature of a second image feature of the reference image and the text feature; editing the first cross-attention feature based on the second cross-attention feature to obtain a third cross-attention feature; and generating a result image feature of the time step based on the third cross-attention feature and the text feature; and decoding a result image feature of a last time step to generate the target image.