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

SSMG: Spatial-Semantic Map Guided Diffusion Model for Free-Form Layout-to-Image Generation

Chengyou Jia, Minnan Luo, Zhuohang Dang, Guang Dai, Xiaojun Chang, Mengmeng Wang, Jingdong Wang

Introduction

Generating complex scenes from user-specified layouts, known as Layout-to-Image (L2I) generation, is a critical task for fine-grained image synthesis. While Text-to-Image (T2I) models like Stable Diffusion have shown remarkable capabilities, they often struggle with precise spatial control, such as exact object placement and boundary definition. Existing L2I approaches typically fall into two categories: token-guided methods, which flatten layout information into 1D tokens, and image-guided methods (like ControlNet), which use 2D visual conditions but often rely on global captions.

Comparison of different guidance strategies for Layout-to-Image generation. SSMG (Map Guided) preserves 2D spatial structure while providing instance-level semantic control.

Token-guided methods often lose the inherent 2D structure of the image, leading to imprecise boundaries. Conversely, image-guided methods suffer from "semantic ambiguity" because they lack specific descriptions for individual objects within the layout. SSMG (Spatial-Semantic Map Guided) addresses these issues by utilizing a 2D Spatial-Semantic Map that combines spatial precision with instance-specific text embeddings.

Methodology

The SSMG framework introduces three primary components to bridge the gap between layout specifications and pixel-level generation:

Spatial-Semantic Map Initialization

The core of the model is a 2D feature map ($H \times W \times C$). Unlike 1D tokens, this map populates every pixel within an object's layout with the CLIP text embedding of that specific object's description. This allows for free-form text control (e.g., "a ginger cat" instead of just "cat") for every instance in the scene.

Visualization of the 2D Spatial-Semantic Map, where each grid cell corresponds to specific instance-level semantic embeddings.

Relation-Sensitive Attention (RSA)

To handle complex scenes with overlapping objects, the authors developed Relation-Sensitive Attention. RSA incorporates a relation matrix that explicitly models the interactions between different objects and the global context, preventing distinct entities from "blending" together during the diffusion process.

Location-Sensitive Attention (LSA)

LSA is designed to ensure the model adheres strictly to the provided layout. It "warps" initial noise features using the spatial-semantic map via a cross-attention mechanism. A gating mechanism is employed to maintain stability during training, effectively reducing the "lost object" problem where small or overlapping items are omitted.

Experimental Results

The model was evaluated on the COCO-Thing-Stuff dataset, focusing on complex scenes with 3 to 8 objects. SSMG achieved state-of-the-art performance across key metrics:

  • Fidelity: It reached an FID of 20.82, surpassing GLIGEN (21.04) and ReCo (27.47).
  • Controllability: The YOLO score, measuring detection accuracy of generated objects, improved significantly from 30.5 to 37.6.
  • Qualitative Quality: Visual results demonstrate cleaner boundaries and superior adherence to complex layouts compared to previous models like LayoutD or ControlNet.

Conclusion

SSMG represents a significant advancement in L2I generation by maintaining 2D spatial-semantic guidance throughout the diffusion process. By combining the spatial accuracy of maps with the semantic depth of free-form text, it provides users with unprecedented control over image synthesis. Future work may extend this map-guided strategy to diverse layout representations such as masks or keypoints for interactive design applications.

Summary updated

BibTeX
@inproceedings{jia2024ssmg,
  author = {Chengyou Jia and Minnan Luo and Zhuohang Dang and Guang Dai and Xiaojun Chang and Mengmeng Wang and Jingdong Wang},
  title = {{SSMG: Spatial-Semantic Map Guided Diffusion Model for Free-Form Layout-to-Image Generation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i3.28024},
}
Figure