Source-linked AI summary

CTRLorALTer: Conditional LoRAdapter for Efficient 0-Shot Control & Altering of T2I Models

Nick Stracke, Stefan Andreas Baumann, Joshua M. Susskind, Miguel Angel Bautista, Björn Ommer

arXiv:2405.07913v2cs.CV

TL;DR

Text-to-image models lack an efficient unified way to condition generation on both style and structure. LoRAdapter uses conditional LoRA blocks for zero-shot control, and the paper reports that it outperforms recent approaches while using a compact parameter count. The authors limit demonstrated effectiveness to Stable Diffusion-based text-to-image diffusion models.

  • Problem

    Existing approaches specialize in global style or local structure conditioning, leaving an efficient holistic approach to both missing.

    Source: §1 · p. 2, §4 · p. 6
  • Method

    LoRAdapter conditions LoRA blocks on the input to provide architecture-agnostic, zero-shot style and structure control in text-to-image diffusion models.

    Source: §1 · p. 3
  • Results

    LoRAdapter reports state-of-the-art fine-grained style and structure control, outperforming recent approaches while optimizing a more compact number of parameters.

    Source: §1 · p. 3, §6 · p. 14
  • Takeaways & Limitations

    The authors present LoRAdapter as progress toward fine-grained control over text-to-image models.

    Source: §6 · p. 14

    Effectiveness has been shown only for text-to-image diffusion models based on Stable Diffusion; verification on transformer-based diffusion models or large language models remains future work.

    Source: §7.1 · p. 19

Abstract

from arXiv · show

Text-to-image generative models have become a prominent and powerful tool that excels at generating high-resolution realistic images. However, guiding the generative process of these models to consider detailed forms of conditioning reflecting style and/or structure information remains an open problem. In this paper, we present LoRAdapter, an approach that unifies both style and structure conditioning under the same formulation using a novel conditional LoRA block that enables zero-shot control. LoRAdapter is an efficient, powerful, and architecture-agnostic approach to condition text-to-image diffusion models, which enables fine-grained control conditioning during generation and outperforms recent state-of-the-art approaches.

1 Introduction

Existing image-conditioning approaches either require costly full-model training or specialize in style or structure, leaving efficient unified control open. LoRAdapter uses conditional LoRA blocks for zero-shot style and structure conditioning and is reported to outperform dedicated adapters on various metrics.

1 Introduction

  • Prior image-prompt conditioning approaches require training from scratch or fully fine-tuning large text-conditioned models, incurring high computational costs and requiring large datasets.Source: §1 · p. 1
  • Adapters reduce trainable parameters by keeping the base model frozen, but are typically handcrafted for a particular architecture and conditioning modality.Source: §1 · pp. 1–2
  • Structure adapters provide pixel-level control, while style adapters emphasize similarity in style or semantics rather than fine-grained control.Structure control can use a depth map to influence image layout.Source: §1 · p. 2
  • Existing adapters tend to favor either structure or style, and unifying global style and local structure control efficiently remains an open problem.ControlNet adds substantial compute by copying the Stable Diffusion U-Net encoder.Source: §1 · p. 2
  • LoRAdapter conditions LoRA adaptations on the input, enabling zero-shot generalization and flexible adaptation across layers for both style and structure.Unlike fixed LoRAs, its adaptation can change for a given condition at test time.Source: Figure 1 · p. 2, §1 · p. 3
  • LoRAdapter outperforms dedicated style or structure adapters on various metrics while using a compact conditional-LoRA approach.The paper also reports outperforming approaches that train from scratch.Source: §1 · p. 3

2 Related Work

Related work covers adapters for local structure and global style conditioning, alongside LoRAs used to adapt diffusion models. These lines of work motivate a unified conditioning approach.

2.1 Structure Adapters

  • ControlNet adds a copied U-Net encoder for structure control, while T2I-Adapter, Uni-ControlNet, and SCEdit offer smaller or multi-condition alternatives.ControlNet’s added encoder can increase inference speed by up to 50%, and its capacity can entangle structure and style.Source: §2.1 · pp. 3–4

2.2 Style Adapters

  • Style adapters preserve text conditioning while using image prompts; IP-Adapter adds image-token cross-attention, whereas SeeCoder replaces text tokens with image-derived tokens.Structure adapters have also attempted style conditioning, but their performance does not compare favorably to dedicated style adapters.Source: §2.2 · p. 4

2.3 LoRAs in Diffusion Models

  • Diffusion-model LoRAs efficiently adapt generation, support style or subject learning, and have been applied to merging, distillation, and image editing.ZipLoRA merges LoRAs by minimizing cosine similarity between those adapting the same weight matrix.Source: §2.3 · pp. 4–5

3 Preliminaries

Diffusion models generate samples by gradually adding noise and then denoising, with conditions such as text directing generation. LoRA adapts frozen pretrained weights using low-rank matrices.

3.1 Diffusion

  • Diffusion uses a forward process that adds Gaussian noise over T steps and a reverse process that reconstructs samples from noise.During sampling, an initial Gaussian latent is iteratively denoised into a sample.Source: §3.1 · p. 5
  • Classifier-free guidance combines conditional and unconditional noise predictions, with w setting adherence to condition c.The passage describes this technique as enhancing alignment between generated images and text prompts.Source: §3.1 · p. 5

3.2 Low-Rank Adaptation (LoRA)

  • LoRA keeps pretrained weight matrices frozen and adds low-rank matrices to adapt the model.The adapted layer uses W0 + BA, where r is much smaller than the dimensions of the original matrix.Source: §3.2 · pp. 5–6
  • LoRA is applied per layer; zero-initializing B leaves the model initially unchanged, while rank and weights can be chosen for the task.Adapting n layers uses n A and B matrices.Source: §3.2 · p. 6

4 Method

LoRAdapter targets unified style and structure conditioning for text-to-image diffusion models. It conditions LoRA’s low-rank representation using inference-time inputs and applies the approach to attention and convolutional layers.

4 Method

  • LoRAdapter proposes a unified, efficient, customizable method for adding both style and structure conditioning to text-to-image diffusion models.Existing approaches are tailored to one conditioning objective, leaving a holistic approach to both objectives missing.Source: §4 · p. 6

4.1 Conditional LoRAs

  • Unlike a single LoRA learned for one modification, conditional LoRAs change behavior with inference-time conditioning, enabling zero-shot generalization.The approach is described as architecture-agnostic and efficient for adapting foundation models.Source: §4.1 · p. 7
  • Conditioning transforms the low-dimensional LoRA embedding Ax using m(c), restricting adaptation to a low-rank subspace.The proposed affine transformation uses scale and shift factors; the text attributes regularization and more efficient training to the low-rank restriction.Source: §4.1 · p. 7
  • The mapper combines shared and layer-specific parts, and the formulation supports spatially dependent local or non-spatial global conditioning.Its low-rank-subspace basis allows LoRAdapter to incorporate improvements to LoRA implementations.Source: §4.1 · pp. 7–8

4.2 A Unified Conditioning Approach

  • For attention layers, conditional LoRA is applied to key and value projections; for convolutional layers, it operates in a rank-sized channel bottleneck before expansion.The convolutional formulation uses KA to reduce channels and a pointwise KB convolution to expand them again.Source: Attention Layers · p. 8, Convolutional Layers · pp. 8–9

5 Experiments

Experiments evaluate LoRAdapter for style and structure conditioning, compare its performance and efficiency with other approaches, and examine qualitative examples and design choices. Results favor LoRAdapter across both conditioning types, while ablations identify cross-attention layers as strongest for style conditioning.

5.1 Experimental Setup

  • The experiments use Stable Diffusion 1.5, training on 40 million COYO-700M samples and evaluating on the 5,000-image COCO2017 validation set.Training runs for 50,000 steps on 32 A100 GPUs; structure conditioning uses no classifier-free guidance.Source: Data · p. 9, §5.2 · p. 10, Inference · p. 10

5.3 Qualitative Comparison

  • With an empty prompt and image-only conditioning, LoRAdapter performs on par with IP-Adapter overall and outperforms it on some style samples.Examples include less degradation in one image and better capture of a horse’s mane in another.Source: Figure 4 · p. 11, §5.3 · p. 13

5.2 Quantitative Evaluation

  • LoRAdapter achieves state-of-the-art CLIP-I and CLIP-T scores across adapters with about 27% fewer trainable parameters than IP-Adapter, and state-of-the-art structure results even at half the parameters of T2I-Adapter.The reported style results also include a higher CLIP-T score than unCLIP, while the structure models use 17M and 32M parameters.Source: Table 2 · p. 10, Style · pp. 11–12

5.3 Qualitative Comparison

  • For depth-map conditioning, LoRAdapter produces high-quality samples with closer fine-grained structure adherence than ControlNet or T2I-Adapter.The comparison attributes this improvement to adapting U-Net convolutions directly rather than through skip connections.Source: Figure 5 · p. 12, §5.3 · p. 13

5.4 Ablation experiments

  • Cross-attention layers perform best for style conditioning, and low-rank configurations retain good performance, while convolutional and self-attention layers perform worse in this setting.The authors note those other layer types may suit style conditioning focused on image style rather than semantics.Source: Table 3 · p. 13, Figure 6 · p. 13, Rank and Layer choice · p. 14
  • The structure ablation compares configurations adapting nine convolutional layers with configurations adapting 17, and joint style-and-structure examples include both reconstruction and mismatched-condition cases.Configuration A adapts the first layer in each block; configuration B adapts the first convolution in each ResNet block.Source: Rank and Layer choice · p. 14, Figure 7 · p. 14

6 Conclusion

LoRAdapter unifies structure and style control for text-to-image models with a conditional LoRA architecture. The paper concludes that it enables zero-shot generalization and achieves fine-grained control with state-of-the-art results and a compact parameter count.

6 Conclusion

  • LoRAdapter unifies structure and style control through a conditional LoRA architecture that enables zero-shot generalization and achieves state-of-the-art results with a compact number of parameters.The conclusion characterizes the approach as powerful and efficient for conditioning image generation in text-to-image models.Source: §6 · p. 14

7 Appendix

The appendix limits demonstrated effectiveness to Stable Diffusion text-to-image diffusion models and discusses potential impact. Its conditioning experiments report composable style and structure control, including across mismatched inputs, alongside comparisons of adapter choices and conditioning modalities.

7.1 Limitations & Future Work

  • Although presented as applicable to deep-learning models generally, LoRAdapter’s demonstrated effectiveness is limited to Stable Diffusion text-to-image diffusion models.Applying it to transformer-based diffusion models such as DiT or to large language models remains future work.Source: §7.1 · p. 19

7.2 Impact Statement

  • The authors note that more accessible, specific control over generation also carries a risk of enabling more believable disinformation or harmful content.They frame this risk as accompanying the extension of T2I diffusion-model capabilities.Source: §7.2 · p. 19

7.3 Style and Structure Conditioning

  • LoRAdapter combines style and structure coherently, including when the conditioning images come from different classes.Examples combine depth from a red car with style from a green car, and report sensible combinations across completely different classes.Source: §7.3 · p. 19, Figure 8 · p. 20
  • ControlNet structure guidance produces more sample variance than LoRAdapter in the reconstruction task.The authors attribute this to ControlNet’s 361M parameters and tendency to interpret structure conditioning in ways that produce hallucinations; they link LoRAdapter’s lower variance to its smaller size and separate LoRA subspaces.Source: §7.3 · pp. 19–20, Figure 11 · p. 23
  • LoRAdapter compares favorably with style-conditioning methods, including models trained from scratch and fully fine-tuned models.It preserves original text conditioning, unlike SeeCoder, and the figure caption says style-condition quality is on par with models trained from scratch.Source: §7.3 · p. 20, Figure 12 · p. 24, Figure 13 · p. 25
  • Adapting cross-attention layers yields the highest style fidelity and similarity to the prompt image, with self-attention a close second.Cross-attention also supports composability with text prompts that alter subjects in line with image semantics, such as producing different kinds of hats for different subjects.Source: §7.3 · pp. 20–21, Figure 10 · p. 22, Figure 13 · p. 25
  • Configuration B performs better than configuration A for HED conditioning, while even the smaller A configuration outperforms existing approaches.Table 4 specifies that smaller model A outperforms ControlNet and Uni-ControlNet.Source: §7.3 · p. 21, Table 4 · p. 21
  • LoRAdapter also combines key-pose conditioning with text prompts, extending the demonstrated structure inputs to sparse representations.The reported examples use multiple poses with different text prompts.Source: §7.3 · p. 21, Figure 9 · p. 22
Loading 2405.07913v2…