Abstract
Methods for finetuning generative models for concept-driven personalization generally achieve strong results for subject-driven or style-driven generation. Recently, low-rank adaptations (LoRA) have been proposed as a parameter-efficient way of achieving concept-driven personalization. While recent work explores the combination of separate LoRAs to achieve joint generation of learned styles and subjects, existing techniques do not reliably address the problem, so that either subject fidelity or style fidelity are compromised. We propose ZipLoRA, a method to cheaply and effectively merge independently trained style and subject LoRAs in order to achieve generation of any user-provided subject in any user-provided style. Experiments on a wide range of subject and style combinations show that ZipLoRA can generate compelling results with meaningful improvements over baselines in subject and style fidelity while preserving the ability to recontextualize.
Introduction
Personalizing text-to-image models typically involves two distinct goals: subject-driven generation (learning a specific object or person) and style-driven generation (learning a specific artistic aesthetic). While specialized tools like DreamBooth and StyleDrop excel at these tasks individually, combining them remains a significant challenge.
The standard approach of linear merging—simply adding the weights of a subject LoRA and a style LoRA—often results in a "tug-of-war" where either the subject's identity is lost or the style fails to manifest correctly. Joint training on both concepts is an alternative, but it is computationally expensive and often fails to disentangle the subject from the style. ZipLoRA addresses this by "zipping" independently trained modules together efficiently, maintaining the integrity of both concepts.
Methodology
ZipLoRA is an optimization-based merging strategy rooted in two key observations regarding LoRA weight matrices:
- Sparsity: LoRA weight updates are inherently sparse; many elements have negligible impact on the final output.
- Alignment Interference: Interference occurs when columns of weight matrices from different LoRAs are highly aligned (high cosine similarity), leading to degraded generation quality during a merge.
The ZipLoRA Algorithm
Rather than applying a single global scaling factor, ZipLoRA learns column-wise merging coefficients ($m_c$ for content, $m_s$ for style) for every layer. The method optimizes these coefficients using a multi-part loss function:
- Preservation Loss: This ensures the merged model retains the ability to generate the original subject and style independently by comparing its outputs to those of the single-LoRA versions.
- Orthogonality Constraint: This minimizes the cosine similarity between the merging vectors ($m_c$ and $m_s$). By forcing the optimization to select "disjoint" sets of weights from each LoRA, the algorithm effectively interlocks them like the teeth of a zipper.
This optimization is highly efficient, requiring only approximately 100 gradient updates, which is roughly 10 times faster than traditional joint training.
Experimental Setup
The researchers evaluated ZipLoRA using the DreamBooth dataset (30 sets of subject images) and StyleDrop reference images. All experiments utilized Stable Diffusion XL (SDXL) v1.0 as the base model. A notable finding was that SDXL possesses significantly stronger native style-learning capabilities than its predecessors, often learning complex styles from a single reference image using standard protocols.
Key Results and Insights
ZipLoRA demonstrated clear superiority over existing baselines in both qualitative and quantitative assessments:
- Qualitative Fidelity: ZipLoRA consistently produced images where the subject remained recognizable and the style was accurately applied. In contrast, direct merging often resulted in distorted subjects or "washed out" artistic effects.
- User Preference: In a study involving 45 users, ZipLoRA was preferred over the StyleDrop + DreamBooth baseline 68% of the time, and over direct arithmetic merging 82.7% of the time.
- Quantitative Performance: Using DINO (for subject fidelity) and CLIP (for style and text fidelity) scores, ZipLoRA outperformed both joint training and direct merging across all tested combinations.
- Parameter Efficiency: The method is remarkably lightweight, requiring only 1.6M trainable parameters (the coefficient vectors) compared to the 180M parameters typically tuned in competing personalization methods.
Limitations and Future Work
A primary limitation is content leakage from style references. If a style image contains prominent background elements (e.g., a specific landscape feature), the model may erroneously learn these as part of the style, forcing them into generated images regardless of the prompt. Future research will focus on improving the disentanglement of style from background content and extending ZipLoRA to merge multiple subjects or styles simultaneously.
Conclusion
ZipLoRA provides a robust, efficient solution for the long-standing problem of combining disparate personalized concepts in generative models. By leveraging the sparsity of LoRA weights and optimizing for orthogonality, it enables high-fidelity, multi-concept generation without the need for expensive joint training or compromising on subject and style identity.
Summary updated