MultiDiffusion: Fusing Diffusion Paths for Controlled Image Generation

Omer Bar-Tal, Lior Yariv, Yaron Lipman, Tali Dekel

Introduction

While text-to-image diffusion models like Stable Diffusion produce stunning results, they are notoriously difficult to control. Generating specific layouts (e.g., "a cat on the left, a dog on the right") or unusual aspect ratios (e.g., a 16:1 panorama) typically requires expensive fine-tuning on specialized datasets or ad-hoc adaptations that often result in visible seams and a lack of global coherence.

MultiDiffusion introduces a unified, training-free framework that adapts any pre-trained diffusion model to new spatial constraints and aspect ratios without modifying the model's weights. By mathematically fusing multiple "diffusion paths" into a single global optimization, it enables the generation of seamless panoramas and complex, region-based scenes using standard, off-the-shelf models.

Methodology

The core innovation is the MultiDiffusion process, which redefines the denoising step as a global optimization problem. Instead of taking one giant denoising step for the whole image, MultiDiffusion identifies multiple overlapping regions (crops) or masked areas within the target image and predicts local updates for each independently based on local text prompts.

These potentially conflicting local updates are reconciled into a single global denoising step via a Follow-the-Diffusion (FTD) loss. This quadratic objective seeks a global image that stays as close as possible to all local denoising trajectories simultaneously. Because it is a quadratic objective, it has a closed-form solution: the global update is essentially a weighted average of the local updates in the areas where they overlap.

Region-based generation where multiple prompts (rocket, blue smoke, pink smoke) are fused into a coherent scene.

For high-fidelity layout control, the authors introduce a bootstrapping phase. Early in the diffusion process, when the layout is determined, the model is encouraged to focus strictly on masked regions using a simplified background, only harmonizing the full scene in the later stages.

Key Results and Insights

MultiDiffusion demonstrates that the knowledge required for complex layouts already exists within pre-trained models; the challenge is coordination. By forcing overlapping regions to share pixels, the optimization naturally produces seamless transitions and emergent scene effects, such as reflections or shadows, that are necessary for the image to look realistic to the model's prior.

Panorama Generation

MultiDiffusion produces panoramas with significantly better quality than baselines like Blended Latent Diffusion (BLD) or Stable Inpainting (SI). It achieved an FID of 10.3 (compared to 18.4 for BLD and 45.5 for SI), effectively eliminating the seams and repetitive artifacts common in other methods.

A seamless high-resolution panorama generated using MultiDiffusion.

Region-based Control

In benchmarks using the COCO dataset, MultiDiffusion achieved a higher Intersection over Union (IoU) of 0.26, outperforming SI (0.16) and BLD (0.17). The framework handles arbitrary aspect ratios and complex multi-prompt layouts, such as generating a scene with specific objects in designated spots, with high fidelity.

Limitations and Future Work

MultiDiffusion is inherently dependent on the underlying model's prior; it cannot correct biases or prompt-struggles inherent to the base model. Additionally, while it requires no training, it involves multiple passes through the model's U-Net (one per region) at every denoising step, increasing computational overhead. Future work may involve generalizing the framework to include more complex cost functions or "hard" constraints beyond simple least-squares fusion.

Summary updated

BibTeX
@inproceedings{bartal2023multidiffusion,
  author = {Omer Bar-Tal and Lior Yariv and Yaron Lipman and Tali Dekel},
  title = {{MultiDiffusion: Fusing Diffusion Paths for Controlled Image Generation}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=D4ajVWmgLB},
}
Figure