Spanning the Visual Analogy Space with a Weight Basis of LoRAs
Hila Manor, Rinon Gal, Haggai Maron, Tomer Michaeli, Gal Chechik
TL;DR
The paper tackles the limited generalization of single-LoRA adapters in visual analogy editing by introducing LoRWeB, a framework that learns a basis of LoRA adapters and a lightweight encoder to dynamically mix them per input triplet. By encoding the analogy triplet and querying a learnable key set, LoRWeB constructs a task-specific, mixed LoRA injected into a diffusion-based editing backbone, enabling flexible transformations unseen during training. Across extensive experiments, LoRWeB achieves state-of-the-art results and better generalization to unseen transformations, outpacing single-LoRA baselines and demonstrating strong preservation of original content while applying complex edits. The work highlights the promise of LoRA-basis decompositions for flexible, parameter-efficient visual manipulation and suggests broad potential for applying task-specific adapter bases beyond visual analogies.
Abstract
Visual analogy learning enables image manipulation through demonstration rather than textual description, allowing users to specify complex transformations difficult to articulate in words. Given a triplet $\{\mathbf{a}$, $\mathbf{a}'$, $\mathbf{b}\}$, the goal is to generate $\mathbf{b}'$ such that $\mathbf{a} : \mathbf{a}' :: \mathbf{b} : \mathbf{b}'$. Recent methods adapt text-to-image models to this task using a single Low-Rank Adaptation (LoRA) module, but they face a fundamental limitation: attempting to capture the diverse space of visual transformations within a fixed adaptation module constrains generalization capabilities. Inspired by recent work showing that LoRAs in constrained domains span meaningful, interpolatable semantic spaces, we propose LoRWeB, a novel approach that specializes the model for each analogy task at inference time through dynamic composition of learned transformation primitives, informally, choosing a point in a "space of LoRAs". We introduce two key components: (1) a learnable basis of LoRA modules, to span the space of different visual transformations, and (2) a lightweight encoder that dynamically selects and weighs these basis LoRAs based on the input analogy pair. Comprehensive evaluations demonstrate our approach achieves state-of-the-art performance and significantly improves generalization to unseen visual transformations. Our findings suggest that LoRA basis decompositions are a promising direction for flexible visual manipulation. Code and data are in https://research.nvidia.com/labs/par/lorweb
