Customizing Text-to-Image Models with a Single Image Pair

Maxwell Jones, Sheng-Yu Wang, Nupur Kumari, David Bau, Jun-Yan Zhu

Abstract

Recent advancements in text-to-image (T2I) customization have enabled users to personalize models using a small set of images. However, when only a single example of a style is available, existing methods often fail to disentangle the desired artistic style from the underlying content. We present Pair Customization, a novel framework that learns a specific artistic style from a single image pair—consisting of a "before" content image and an "after" stylized image. By employing joint LoRA optimization with orthogonality constraints and a new style guidance technique at inference, our method achieves superior style transfer while maintaining the structural integrity of the original content.

Introduction

Personalizing large-scale text-to-image models like Stable Diffusion typically requires multiple images to define a new concept or style. When a user provides only a single stylized image, models often suffer from overfitting and poor disentanglement. For instance, if a model is trained on a single watercolor painting of a dog, it may struggle to apply that watercolor style to a landscape without also attempting to insert the dog's features. This ambiguity arises because the model cannot distinguish which pixels represent the "content" and which represent the "style."

Pair Customization addresses this by utilizing an image pair to explicitly define the stylistic transformation. By providing both the original content and its stylized counterpart, the model can learn the "delta" between the two, effectively treating style acquisition as a supervised difference-learning problem.

Methodology

The Pair Customization framework is built upon three technical innovations designed to ensure clean disentanglement and robust application of learned styles.

1. Joint LoRA Optimization

Instead of optimizing a single set of weights, the method trains two separate Low-Rank Adaptation (LoRA) modules: a ContentLoRA and a StyleLoRA. The ContentLoRA is optimized to reconstruct the original content image, while the StyleLoRA is trained to bridge the gap between the content and the stylized version. This dual-path approach allows the model to categorize features into content-specific or style-specific buckets from the outset.

2. Orthogonality Constraint

To prevent stylistic features from leaking into the content representation (and vice versa), the authors introduce a row-space orthogonality constraint between the two LoRA weight matrices. Mathematically, this forces the model to find a style representation that is distinct from the content representation, ensuring that the learned style is a transformation rather than a collection of specific object features.

3. Style Guidance at Inference

Traditional customization methods apply learned styles by scaling LoRA weights during the generation process. However, aggressive weight scaling often degrades the structural coherence of the generated image. Pair Customization introduces Style Guidance, a new inference algorithm that treats the style as an additional guidance term, similar to classifier-free guidance. This allows for precise control over stylization strength while keeping the original denoising path intact, resulting in much better preservation of the target image's structure.

Experimental Setup and Datasets

The authors evaluated the method using a diverse dataset comprising three distinct types of image pairs:

  • Synthetic Pairs: 40 content images (headshots, animals, landscapes) paired with stylized versions created via tools like LEDITS++, Cartoonization, and Stylized Neural Painting.
  • Artist-Created Pairs: Real-world examples of human artistic interpretations to test the model's ability to capture nuanced, non-algorithmic styles.
  • Real Image Editing: Testing the framework's versatility by stylizing real photographs through DDIM inversion.

Results and Discussion

Quantitative evaluations demonstrate that Pair Customization "Pareto dominates" existing baselines, such as DreamBooth LoRA and Concept Sliders. In metrics measuring the trade-off between "Distance to Style" and "Distance to Content," our method consistently achieves a closer style match for any given level of content preservation. Furthermore, a blind user study on Amazon Mechanical Turk showed that users preferred Pair Customization results over 60% of the time compared to the strongest competing methods.

Beyond simple style transfer, the modular nature of the learned LoRAs allows for Multi-Style Blending. Users can linearly combine multiple learned styles at inference time, creating unique hybrid aesthetics while maintaining the structural integrity of the base content.

Limitations and Future Work

Despite its effectiveness, Pair Customization requires test-time optimization, which currently takes approximately 15 minutes on an NVIDIA A5000 GPU. This makes it slower than encoder-based methods that operate in a single forward pass. Additionally, while the model preserves structure better than baselines, aggressive stylization can still occasionally result in unintended shifts in pose or minor feature additions. Future research will focus on developing encoder-based architectures to enable real-time, pair-based style customization.

Summary updated

BibTeX
@inproceedings{jones2024customizing,
  author = {Maxwell Jones and Sheng-Yu Wang and Nupur Kumari and David Bau and Jun-Yan Zhu},
  title = {{Customizing Text-to-Image Models with a Single Image Pair}},
  booktitle = {SIGGRAPH Asia},
  year = {2024},
  doi = {10.1145/3680528.3687642},
}
Figure