Abstract
Layout design generation has recently gained significant attention due to its potential applications in various fields, including UI, graphic, and floor plan design. However, existing models face two main challenges that limits their adoption in practice. Firstly, the limited expressiveness of individual condition types used in previous works restricts designers' ability to convey complex design intentions and constraints. Secondly, most existing models focus on generating labels and coordinates, while real layouts contain a range of style properties. To address these limitations, we propose a novel framework, CoLay, that integrates multiple condition types and generates complex layouts with diverse style properties. Our approach outperforms prior works in terms of generation quality and condition satisfaction while empowering users to express their design intents using a flexible combination of modalities, including natural language prompts, layout guidelines, element types, and partially completed designs.
Introduction
Automating layout design is a "holy grail" for UI/UX and graphic design, but existing generative models hit two major walls. First, they usually rely on a single type of input—like a text prompt or a layout grid—which is too restrictive for real-world design workflows where intentions are multi-faceted. Second, most models only produce "wireframes" (bounding boxes and labels), ignoring the stylistic properties like colors, font sizes, and alignments that make a design actually usable.
The authors introduce CoLay to bridge this gap, moving beyond simple box-generation to create complex, multi-layered layouts that respect diverse user constraints and include rich CSS-style attributes.
Methods
CoLay is built on a Latent Diffusion Model (LDM) architecture, specifically improving upon the prior "PLay" framework. Key technical innovations include:
- Fixed-Length VAE Compression: Instead of treating every property (x, y, color, etc.) as a separate token, CoLay uses a Variational Autoencoder (VAE) to compress an entire element’s attributes into a single latent vector. It fixes the sequence at $N=64$ elements, using "invalid" tokens to handle smaller layouts. This keeps the denoising task computationally efficient even as design complexity grows.
- Multi-Condition Encoder with Hierarchical Dropout: The model is trained to handle four distinct condition types: Text Prompts, Class/Count (e.g., "I need 3 buttons"), Given Design (partial layouts for inpainting), and Guidelines (alignment grids). During training, conditions are randomly dropped, allowing the model to generate layouts based on any arbitrary subset of these inputs during inference.
- Multiple Guidance Weights: Recognizing that a text prompt and a layout grid might require different levels of "influence," the authors propose a sampling method that handles multiple classifier-free guidance weights simultaneously.
Datasets and Style Properties
The researchers evaluated CoLay on two primary datasets:
- CLAY: A standard dataset of 50,000 mobile UI layouts.
- C4 (Web Layouts): The authors extracted CSS attributes from a 5-million-layout subset of the C4 web corpus. This is significantly more complex than CLAY, featuring higher resolutions ($1024 \times 1024$) and more elements per page.
- LLM-Generated Prompts: Since these datasets lacked natural language descriptions, the authors used PaLM-2-Bison to generate summaries of the UI hierarchies, creating a new benchmark for text-to-layout alignment.
Unlike models that just output coordinates, CoLay is trained to predict CSS attributes, including foreground/background colors, font weights, and text alignments.
Key Results
CoLay demonstrates a significant leap over previous models like PLay and LayoutDM:
- Visual Quality: On the CLAY dataset, CoLay achieved a Fréchet Inception Distance (FID) of 6.23, nearly halving the FID of the previous SOTA (PLay at 11.41).
- Complexity Scaling: On the massive C4 dataset, CoLay reduced the FID from 26.27 to 11.21, proving it can handle the variety of real-world web design.
- Condition Satisfaction: The model showed high scores in metrics like CycSim (measuring how well the layout matches the text prompt) and G-Usage (adherence to layout guidelines).
- User Preference: In a study with professional designers, CoLay’s outputs were preferred over PLay and were rated as comparable in quality to ground-truth human designs.
Conclusion
CoLay represents a major step forward by treating layout generation as a modular "toolkit." While limitations exist—such as the age of the training data and the challenge of global theme consistency—the ability to combine natural language, structural constraints, and stylistic properties opens new doors for AI-assisted design workflows.
Summary updated