MaxFusion: Plug&Play Multi-modal Generation in Text-to-Image Diffusion Models

Nithin Gopalakrishnan Nair, Jeya Maria Jose Valanarasu, Vishal M. Patel

Introduction

Large-scale Text-to-Image (T2I) diffusion models, such as Stable Diffusion, have revolutionized creative workflows. While extensions like ControlNet and T2I-Adapter allow for spatial guidance (e.g., depth maps or poses), a significant challenge arises when attempting to combine multiple, often contradictory, spatial conditions. Existing solutions typically require expensive retraining on specific multi-modal datasets, which risks "catastrophic forgetting" of the base model's generative capabilities. Naive feature averaging often leads to "signal dilution," resulting in blurry outputs or weak adherence to the input conditions.

Methodology: The MaxFusion Algorithm

MaxFusion introduces a training-free, "plug-and-play" approach to multi-modal generation. The core innovation lies in using feature variance as a proxy for "conditioning intensity." The authors observed that areas with strong conditioning signals (like an edge or a joint) exhibit higher activation variance in the intermediate feature maps of the diffusion model.

Feature-Merging Strategy

The algorithm operates at each layer during inference, comparing features ($f_1, f_2$) from different control modules:

  1. Correlation Analysis: It calculates the Pearson correlation ($\rho$) between features at each spatial location.
  2. Complementary Fusion: If $\rho > 0.7$, the features likely describe similar spatial information and are merged via simple averaging.
  3. Contradictory Fusion: If the correlation is low, the features likely represent different objects or layouts. MaxFusion then selects the feature with the highest relative standard deviation at each pixel, effectively prioritizing the "strongest" signal.
  4. Variance Rescaling: To prevent signal decay in deeper layers, non-selected features are rescaled to match the variance of the "winning" feature.
MaxFusion handles contradictory conditions by intelligently merging features from different modalities, such as pose and depth, into a single coherent scene.

Evaluation and Results

To evaluate the method, the authors curated a synthetic dataset based on the COCO validation set, extracting modalities like depth (MiDAS), edges (Canny, HED), and segmentation masks. Captions were generated using the BLIP model.

Quantitative Performance

On the "Pose + Segmentation" task, MaxFusion demonstrated superior performance across standard metrics:

  • FID Score: 46.72 (significantly outperforming T2I-Adapter's 55.61 and ControlNet's 63.46).
  • Condition Consistency: Lower Mean Squared Error (MSE) indicated that generated images followed input maps more strictly than baseline methods.

Qualitative Advantages

In scenarios involving contradictory conditions—such as placing a specific object from one image into the background of another—MaxFusion successfully preserved intricate details. Unlike previous methods that often produced "ghosting" effects or semi-transparent objects, MaxFusion generates sharp, well-defined compositions by mathematically deciding which condition is more important at any given pixel.

Conclusion

MaxFusion provides a mathematically grounded, zero-shot way to compose diverse modalities in T2I models. By treating variance as information density, it enables complex spatial control without retraining. While currently limited by the base Stable Diffusion v1.5 model's performance on fine details like hands, future work aims to extend this recursive approach to simultaneous $N$-modality processing for even greater efficiency and coherence.

Summary updated

BibTeX
@inproceedings{nair2024maxfusion,
  author = {Nithin Gopalakrishnan Nair and Jeya Maria Jose Valanarasu and Vishal M. Patel},
  title = {{MaxFusion: Plug\&Play Multi-modal Generation in Text-to-Image Diffusion Models}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72920-1\_6},
}
Figure