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

Towards Aligned Layout Generation via Diffusion Model with Aesthetic Constraints

Jian Chen, Ruiyi Zhang, Yufan Zhou, Changyou Chen

Introduction

Automated layout generation—the task of arranging elements like text, images, and buttons on a canvas—is a cornerstone of modern UI/UX and document design. While recent advancements in generative modeling, particularly diffusion models, have significantly improved the distributional similarity of generated layouts to real-world data, they often struggle with "micro-level" design quality. This phenomenon, termed the "diffusion paradox," highlights a gap where models achieve high Fréchet Inception Distance (FID) scores but fail to produce visually polished results due to poor alignment and unintentional element overlap.

The Diffusion Paradox and the Need for Continuity

Most existing layout diffusion models operate in a discrete state-space, treating coordinates and dimensions as categorical data. While effective for capturing macro-level patterns, this approach prevents the application of calculus-based optimization. Without differentiability, it is difficult to enforce precise geometric constraints, such as ensuring multiple text boxes are perfectly left-aligned.

To bridge this gap, we introduce LACE (LAyout Constraint diffusion modEl). LACE shifts the paradigm from discrete to continuous diffusion, enabling the incorporation of differentiable aesthetic constraints directly into the generation process.

Methodology: LACE

LACE leverages a continuous state-space to represent layout attributes (x, y, width, and height) as continuous variables. This transition allows for several key innovations:

1. Differentiable Aesthetic Constraints

By predicting the "clean" layout ($x_0$) at each denoising step via the reparameterization trick, LACE can calculate and minimize specific loss functions during both training and inference:

  • Global Alignment Loss: Unlike previous "local" methods that only consider adjacent elements, LACE utilizes an alignment mask derived from real-world data. It employs a coordinate difference matrix to understand the holistic alignment structure of a page, preventing "over-alignment" while ensuring professional-grade neatness.
  • Pairwise Overlap Loss: This function combines Intersection over Union (IoU) with center-to-center distances to effectively push overlapping elements apart without disrupting the overall layout structure.

2. Time-Dependent Weighting

Enforcing strict alignment on pure Gaussian noise is counterproductive. LACE introduces a time-dependent weighting mechanism ($\omega_t$) that deactivates aesthetic constraints during the early, high-noise stages of generation. As the layout structure emerges in later steps, the constraints are gradually ramped up to "polish" the final output.

3. Unified Task Handling

LACE utilizes a masked input architecture, similar to a Masked Autoencoder. This allows a single model to handle diverse tasks, including unconditional generation, category-conditioned generation, and layout completion or refinement.

Experimental Evaluation

LACE was evaluated on two benchmark datasets: PubLayNet (over 330,000 document layouts) and Rico (approximately 72,000 UI designs from Android apps).

Key Results

The model demonstrates superior performance across both statistical and aesthetic metrics:

  • Visual Quality: On PubLayNet, LACE achieved an FID of 4.56, a substantial improvement over the previous state-of-the-art (SOTA) model, LayoutDM (7.95).
  • Alignment Precision: The alignment score (where lower is better) improved from 0.195 (LayoutDM) to 0.074 with LACE’s post-processing refinement.
  • Refinement Capabilities: LACE outperformed specialized models like RUITE in layout refinement tasks, suggesting that a well-constrained diffusion model inherently excels at denoising and correcting suboptimal designs.

Limitations and Future Directions

Despite its success, LACE has limitations that provide avenues for future research. Currently, the model is restricted to rectangular bounding boxes, excluding complex polygons or paths found in more artistic designs. Furthermore, LACE is "content-blind," meaning it does not account for the semantic weight of images or the specific length of text strings. Future iterations could integrate "content-aware" features to ensure layouts respond dynamically to the visual and textual data they contain. Finally, the model's current capacity is capped at 25 elements, which may limit its application in highly complex web or infographic designs.

Conclusion

LACE demonstrates that the move to continuous diffusion is more than a technical shift; it is the essential "enabler" for integrating classical design principles into deep generative models. By combining the flexibility of diffusion with the precision of differentiable constraints, LACE sets a new standard for automated, aesthetically pleasing layout generation.

Summary updated

BibTeX
@inproceedings{chen2024towards,
  author = {Jian Chen and Ruiyi Zhang and Yufan Zhou and Changyou Chen},
  title = {{Towards Aligned Layout Generation via Diffusion Model with Aesthetic Constraints}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=kJ0qp9Xdsh},
}
Figure