Merging and Splitting Diffusion Paths for Semantically Coherent Panoramas

Fabio Quattrini, Vittorio Pippi, Silvia Cascianelli, Rita Cucchiara

Abstract

Generating high-quality, wide-angle panoramas from text-to-image diffusion models often suffers from "semantic drift," where local windows fail to maintain global consistency. We present the Merge-Attend-Diffuse (MAD) operator, a zero-shot plug-in that synchronizes overlapping latent views within the model's attention layers. By merging features before attention and splitting them afterward, MAD ensures global semantic coherence without requiring retraining. Our method achieves superior text alignment and is significantly faster than existing gradient-based alternatives.

Introduction

State-of-the-art text-to-image models, such as Stable Diffusion, are typically constrained to square aspect ratios. Extending these models to generate panoramas often involves "joint diffusion" techniques like MultiDiffusion, which process overlapping square windows and average the results. However, because these windows are processed independently, the resulting images frequently lack semantic unity—for instance, transitioning from a snowy forest to a tropical beach despite a single prompt.

Illustration of overlapping windows used in panorama generation.

Methodology: The Merge-Attend-Diffuse (MAD) Operator

The core innovation of this work is the MAD operator, which introduces interaction points directly into the U-Net architecture. Unlike previous methods that average outputs at the end of a denoising step, MAD operates inside the attention layers.

The MAD framework architecture and pseudocode. The operator merges overlapping latent views into a unified tensor for global self- and cross-attention before splitting them back for convolutional processing.

The process follows three main stages:

  1. Merge: Latent features from overlapping views are aggregated into a single large tensor, with overlapping regions averaged to maintain continuity.
  2. Attend: The model performs self-attention and cross-attention on this unified space, allowing every region of the panorama to attend to the global prompt and other spatial regions.
  3. Split: The aggregated tensor is partitioned back into individual views for subsequent convolutional layers.

This zero-shot approach is modular, allowing users to apply MAD to specific U-Net blocks or timesteps to balance global structure with local detail.

Implementation and Insights

A key finding of this work is that semantic drift primarily occurs when attention is localized to individual windows. By enabling global attention through merging, the model maintains a consistent "thought" across the entire canvas.

Furthermore, the authors observed that global structure is established early in the diffusion process. Applying MAD only during the initial denoising steps (e.g., the first 15 out of 50 steps) is often sufficient to lock in a coherent layout, significantly reducing computational overhead. The parameter $\tau$ acts as a control for this trade-off: higher values of $\tau$ promote global uniformity, while lower values allow for greater local variation across the panorama.

Experimental Setup and Results

The authors evaluated MAD using standard prompts from prior work and a new GPT1k benchmark consisting of 1,000 complex prompts designed to test semantic coherence.

Key Findings

  • Semantic Alignment: MAD outperformed competitors in mCLIP scores, indicating better adherence to the text prompt across the entire panorama.
  • Human Preference: In user studies, MAD was preferred over MultiDiffusion (80.92%) and SyncDiffusion (66.54%).
  • Efficiency: By avoiding expensive backpropagation required by gradient-based methods, MAD is approximately 8x faster than SyncDiffusion.
  • Versatility: The operator is compatible with Latent Consistency Models (LCMs), enabling high-quality generation in as few as 1–4 steps.

Discussion and Conclusion

The primary insight of this research is that semantic coherence is a function of global attention. By synchronizing the "thought process" of the model across windows during the early stages of denoising, stable global structures are established. While MAD is subject to the inherent biases of the underlying base model and sensitive to initial seeds, it represents a significant step forward in efficient, coherent wide-angle image synthesis.

Summary updated

BibTeX
@inproceedings{quattrini2024merging,
  author = {Fabio Quattrini and Vittorio Pippi and Silvia Cascianelli and Rita Cucchiara},
  title = {{Merging and Splitting Diffusion Paths for Semantically Coherent Panoramas}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72986-7\_14},
}
Figure