NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Compositional Visual Generation with Composable Diffusion Models

Nan Liu, Shuang Li, Yilun Du, Antonio Torralba, Joshua B. Tenenbaum

Introduction

Recent advancements in text-to-image generation, driven by large-scale diffusion models like DALL-E 2 and Stable Diffusion, have demonstrated an uncanny ability to produce high-fidelity imagery. However, these models frequently struggle with compositional logic—the ability to correctly bind attributes to specific objects or maintain spatial relationships. For instance, a request for "a red cube to the left of a blue sphere" often results in "color bleeding" or misplaced objects. This paper introduces Composable Diffusion Models, a framework that enables the generation of complex scenes by composing multiple simpler diffusion models during inference, treating them as modular components.

The Compositional Challenge: The Latent Bottleneck

The authors identify a fundamental limitation in current monolithic architectures: the "latent bottleneck." Standard models attempt to compress a multi-faceted text description into a single, fixed-size latent vector. As the complexity of the prompt increases, the model's ability to represent every individual constraint diminishes, leading to the omission or mixing of attributes.

To address this, the researchers propose a "divide and conquer" strategy. Instead of training a single model to understand every possible combination of concepts, they leverage the modularity of probability distributions to compose independent concepts at test time.

Methodology: Diffusion as Energy-Based Models

The technical core of this work lies in the mathematical equivalence between the score functions of diffusion models and the gradients of Energy-Based Models (EBMs).

1. The Score-EBM Bridge

In a diffusion model, the score function predicts the direction to move from noise toward the data manifold. In EBMs, the probability of a state is defined by an energy function. The authors demonstrate that the score function of a diffusion model is functionally equivalent to the gradient of an energy function in an EBM.

2. Compositional Operators

By viewing diffusion models through the lens of EBMs, the authors can apply logical operators to combine different distributions during the image generation process:

  • Conjunction (AND): To generate an image satisfying multiple conditions (e.g., "a cat" AND "in the snow"), the model sums the predicted scores from each individual prompt. This guides the denoising process toward an intersection of the concepts.
  • Negation (NOT): This operator allows for the explicit removal of concepts (e.g., "a mystical tree" AND NOT "dark"). This provides a mathematically grounded method for negative prompting, offering more precise control than standard text-based exclusion.

3. Zero-Shot Inference

A significant advantage of this approach is that composition occurs entirely during the inference (sampling) stage. No additional training or fine-tuning is required to combine concepts, enabling "zero-shot" generation of novel scenes and intricate object relations.

Experimental Evaluation

The authors evaluated Composable Diffusion across diverse datasets to test spatial reasoning, attribute binding, and photorealism:

  • CLEVR & Relational CLEVR: Used to assess the model's precision in placing objects at specific coordinates and understanding spatial relations like "to the left of."
  • FFHQ: Tested the composition of facial attributes, such as combining "Smiling" with "Male" while excluding "Glasses."
  • Natural Language Models (GLIDE/Stable Diffusion): Demonstrated the framework's scalability by applying it to large-scale, pre-trained models for complex, multi-sentence scene generation.

Key Results and Insights

The experimental results highlight the robustness of the compositional approach:

  • Quantitative Superiority: On the CLEVR benchmark for 3-component compositions, the proposed method achieved 31.36% accuracy, significantly outperforming the previous EBM-based state-of-the-art, which stood at 7.34%.
  • Attribute Binding: Qualitative analysis showed that while standard models like GLIDE often confuse attributes in long sentences, "Composed GLIDE" correctly assigned specific traits (e.g., "overwater bungalows" and "pink sky") to the intended parts of the image.
  • Modular Intelligence: The framework allows for generalization beyond the training distribution. For example, a model trained on scenes with few objects can successfully generate images with many objects by simply composing multiple single-object models.
  • Zero-Shot Generalization: The model successfully generated 3D hybrid objects (using Point-E) like an "avocado-chair," creating a seamless mesh of a concept it had never encountered during training.

Limitations and Future Directions

Despite its success, the method faces certain hurdles. It performs best when composing instances of the same model; composing heterogeneous models (e.g., mixing a face model with a landscape model) remains a challenge. Additionally, the system can struggle with "visual crowding" when multiple objects are forced into the same spatial area. Future work may involve incorporating "conservative score fields" from EBM research to better handle the composition of separately trained, diverse models.

Conclusion

Composable Diffusion Models represent a shift from monolithic image generation toward modular, logic-based synthesis. By bridging diffusion and EBMs, the authors provide a powerful tool for zero-shot compositional generation, paving the way for AI systems that can understand and build complex visual worlds with the precision of a Lego set.

Summary updated

BibTeX
@inproceedings{liu2022compositional,
  author = {Nan Liu and Shuang Li and Yilun Du and Antonio Torralba and Joshua B. Tenenbaum},
  title = {{Compositional Visual Generation with Composable Diffusion Models}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19790-1\_26},
}
Figure