arXiv:2611.07543cs.CVNov 2026

Manuscript Offprint

arXiv:2611.07543

OptIMerge: Optimization-Based Merging of Diffusion Models

Viraj Shah, Ashwini Pokle, Peyman Milanfar, Mauricio Delbracio, Hossein Talebi

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

The arithmetic merging of weights from multiple task-specific models fine-tuned from a shared base model, commonly known as model souping, has emerged as a popular strategy for multi-task learning without the computational overhead of joint retraining. However, naive scalar weight averaging frequently leads to severe performance degradation when the constituent models learn structurally divergent feature representations, leading to destructive parameter interference. We study this problem in a largely unexplored setting: merging image-to-image (I2I) diffusion models fine-tuned for dense, pixel-accurate tasks such as image restoration. Unlike the large language models (LLMs) and text-to-image (T2I) diffusion models for which most merging methods were developed, I2I experts encode conflicting spatial priors (e.g., anisotropic motion-blur vs. isotropic defocus-blur) in their convolutional filters, where both naive soup and LLM-style element-wise merging introduce visible artifacts. We introduce OptIMerge, a gradient-based optimization framework: instead of relying on heuristic scalars, OptIMerge learns highly expressive, yet parameter-efficient merger coefficients by minimizing a multi-task diffusion loss over a small set of 100–500 images. OptIMerge parameterizes the merge with architecture-aware transformations: for attention layers, a structured low-rank feature alignment with explicit channel biases; for convolutional layers, per-kernel merger coefficients, and a low-rank Cayley transform that aligns channels by orthogonal rotation without distorting the filters. By keeping the experts frozen and optimizing only these lightweight merger parameters (equivalent to < 0.4% of the network footprint), OptIMerge achieves simultaneous multi-task capabilities that rival computationally expensive joint training and decisively outperform zero-shot model soups.

1 INTRODUCTION

Large-scale image diffusion models have become widely adopted for high-quality visual synthesis such as generating photorealistic images from open-ended text prompts (Dhariwal & Nichol, 2021; Ho et al., 2020; Song et al., 2021; Rombach et al., 2022). Beyond standalone generation, the rich structural and semantic representations embedded within these networks function as powerful generative priors. Consequently, to harness these priors for specific downstream applications, a single pre-trained base model is frequently fine-tuned to master specific downstream domains, yielding specialized expert models tailored to distinct tasks. While these individual experts achieve excellent single-task performance, deploying a separate multi-gigabyte backbone, such as a U-Net, for every distinct capability incurs a prohibitive memory and computational footprint.

Model merging (Wortsman et al., 2022; Ilharco et al., 2023) presents a practical solution to this inefficiency, allowing the unification of weights from multiple fine-tuned experts into a single, multi-task architecture without the extensive overhead of joint retraining. While model merging has seen significant success in standard text-to-image (T2I) generation (Biggs et al., 2024), its application to dense image-to-image (I2I) translation tasks, such as image restoration, remains relatively under-explored. To adapt a base T2I model for I2I applications, the input image is incorporated as an

*Equal contribution.

Figure

Figure 1: Overview of OptIMerge. (a) Naive souping merges experts WAW_A and WBW_B with one scalar α\alpha shared by all layers. (b) OptIMerge learns a merger coefficient matrix MℓM_\ell per layer, as large as that layer's weights. (c) The coefficients are optimized with the diffusion loss on a small calibration set while the experts stay frozen. (d) Architecture-aware parameterizations keep this under 0.4% of the U-Net parameters: a biased LoRA mask with low-rank alignment for attention layers, and a low-rank Cayley rotation for convolutional layers.

additional conditioning signal to the base model (Rombach et al., 2022; Brooks et al., 2023; Lin et al., 2024) which is then independently fine-tuned to resolve distinct physical degradations. This process yields specialized restoration experts—such as one model tailored for anisotropic motion deblurring, and another for isotropic defocus deblurring.

One of the prevailing methods for unifying such experts is zero-shot weight averaging (Wortsman et al., 2022; Biggs et al., 2024), also known as souping (Fig. 1(a)), which interpolates the constituent network weights using a single, heuristically chosen global scalar (e.g., α=0.5\alpha = 0.5). Such uniform scalar approach rests on two assumptions: all layers contribute equally to the merged multi-task objective, and the experts' features are aligned. However, diffusion U-Net is a deeply heterogeneous architecture: attention modules govern global semantics and cross-channel interactions, while convolutional filters dictate continuous spatial geometry and high-frequency edge detection (Tumanyan et al., 2023; Zhang et al., 2023; Frenkel et al., 2024). Secondly, I2I experts are obtained by independent, full-parameter fine-tuning of the entire U-Net, which can misalign their representations throughout the network and store physically conflicting spatial priors (e.g., anisotropic motion-blur versus isotropic defocus kernels) in the same convolutional filters. Uniformly averaging such experts therefore causes severe destructive interference. Merging methods from other domains do not resolve this: LLM merging algorithms (Yadav et al., 2023; Yu et al., 2024) rely on element-wise pruning, or random dropout that fracture the spatial filters, while T2I merging methods (Shah et al., 2024; Shenaj et al., 2025; Wu et al., 2024) compose concept-specific LoRAs that typically modify only the attention layers. Consequently, there is critical need to transition from manually guessing a single heuristic scalar to systematically learning expressive, architecture-aware merging parameters.

Motivated by this need for structural granularity, we introduce OptIMerge, an optimization-based model merging framework tailored specifically for I2I diffusion models. By utilizing a small calibration dataset (100–500 images) and keeping the constituent expert networks strictly frozen, OptIMerge optimizes highly expressive multi-task merger parameters via standard gradient descent (Figure 1(c)).

To ensure that this merging process remains lightweight, stable, and expressive, we propose architecture-aware parameterizations that update less than 0.4% of the network footprint. As attention and convolutional layers have distinct functional roles, we parameterize their merging distinctly (Fig. 1(b,d)). For attention layers, we propose a modified low-rank parameterization, which we refer to as biased LoRA, to smoothly blend semantic features. For convolutional layers, preserving spatial integrity requires a kernel-centric approach that merges filters as indivisible units. However, because this dense filter-level fusion incurs a prohibitive parameter overhead, we introduce a novel low-rank Cayley transform to efficiently align divergent feature spaces prior to interpolation.

We comprehensively evaluate OptIMerge with a primary focus on complex, structurally conflicting I2I restoration tasks (e.g., reconciling Motion and Defocus deblurring, and Super-Resolution). Our empirical evaluations demonstrate that learning structured, geometry-aware coefficients successfully resolves clashing spatial priors to achieve Pareto-optimal multi-task retention, vastly outperforming heuristic souping. Finally, as a proof of concept beyond our primary I2I setting, we show that OptIMerge can also be applied to merge subject- and style-personalized T2I models such that both concepts are retained in resulting merged model.

References (32)