TL;DR
Custom Diffusion is a highly efficient method for personalizing text-to-image models with new, user-defined concepts using as few as four images. By fine-tuning only a tiny fraction of the model's parameters—specifically the cross-attention layers—it achieves high-fidelity results in just six minutes, while enabling the seamless composition of multiple custom concepts in a single generated scene.
What Problem Does This Paper Address?
While large-scale text-to-image models like Stable Diffusion have mastered the art of generating "anything and everything," they often fail at generating "your thing." If you want to see your specific pet dog or a unique family heirloom in a new context, general models lack the specific identity information required.
Existing solutions face significant hurdles:
- Efficiency: Methods like DreamBooth require fine-tuning the entire model, resulting in massive 3GB checkpoints and long training times.
- Language Drift: Fine-tuning on a new concept (like a "moongate") often causes the model to forget the original meaning of the component words (like "moon" or "gate").
- Composition: Most methods struggle to generate two different custom concepts in the same image (e.g., your dog sitting on your favorite chair), often omitting one or blending them incorrectly.
Methods
The authors introduce Custom Diffusion, which centers on the insight that you don't need to update the whole model to teach it a new trick.
- Selective Fine-tuning: The researchers analyzed which weights change most during personalization and identified the cross-attention layers—the mechanism that maps text prompts to image features—as the key. They only update the "Key" ($W^k$) and "Value" ($W^v$) projection matrices. This represents only about 3% of the total model parameters.
- Modifier Tokens: New concepts are represented by a unique modifier token, $V^*$, used alongside a category name (e.g., "a $V^*$ dog").
- Regularization with Real Images: To prevent the model from "forgetting" its prior knowledge (language drift), the authors retrieve a small set of real images from the LAION dataset that have similar captions to the target concept. These act as anchors during training.
- Multi-Concept Merging: A standout feature is the ability to combine multiple concepts. This can be done via joint training or through a novel closed-form constrained optimization that merges two separately fine-tuned models into one in just seconds.
Datasets
- LAION-400M: Used to retrieve regularization images to maintain the model's general knowledge.
- CustomConcept101: A new benchmark introduced by the authors, consisting of 101 unique concepts across categories like pets, toys, scenes, and human faces. This provides a much-needed diverse evaluation set for the community.
Key Insights and Ideas
- The Power of Cross-Attention: The most significant "aha moment" is that the identity of a new concept is primarily encoded in how the text interacts with the latent image features. By ignoring the rest of the U-Net, the authors achieved a 5x speedup and a 40x reduction in storage requirements compared to full fine-tuning.
- Mitigating Overfitting: The paper demonstrates that without regularization, the model quickly overfits. For example, learning a "moongate" might make every "moon" look like a circular stone gate. Using real-world "moon" images during training keeps the concepts distinct.
Key Results
- Speed and Efficiency: Custom Diffusion takes ~6 minutes to train on two A100 GPUs, compared to nearly an hour for DreamBooth. The resulting "concept file" is only 75MB, making it easy to share and store.
- Superior Composition: In human preference studies and quantitative metrics (CLIP-score), Custom Diffusion outperformed concurrent works in multi-concept generation. It successfully places two distinct custom objects in a scene where other models often fail to render both.
- Fidelity: Qualitatively, the model preserves the fine details of the user's input images while allowing for dramatic changes in style and context, such as turning a specific plushie into a watercolor painting.
Limitations and Future Work
Despite its efficiency, Custom Diffusion still faces challenges:
- Difficult Compositions: The model struggles when asked to compose two concepts from the same category (e.g., a specific cat and a specific dog). The attention maps for these tokens often overlap, leading to visual blending.
- Scaling Up: While two concepts work well, composing three or more custom concepts simultaneously remains a difficult frontier.
- Base Model Bias: The method is an augmentation of a pre-trained model; therefore, it inherits any underlying limitations or biases present in the original Stable Diffusion weights.
Future work may involve exploring more sophisticated attention-masking techniques to further separate overlapping concepts in complex scenes.
Summary updated