UniLayDiff: A Unified Diffusion Transformer for Content-Aware Layout Generation

Zeyang Liu, Le Wang, Sanping Zhou, Yuxuan Wu, Xiaolong Sun, Gang Hua, Haoxiang Li · DOI

Abstract

UniLayDiff is a unified Diffusion Transformer designed for content-aware layout generation. Unlike previous task-specific models, UniLayDiff handles a wide range of constraints—from unconditional generation to complex relational instructions—within a single framework. By utilizing a dual-path Multi-Modal Diffusion Transformer (MM-DiT) and a two-stage training strategy involving Low-Rank Adaptation (LoRA), the model maintains high generative quality while strictly adhering to spatial and content-aware constraints. Experimental results on the PKU and CGL datasets demonstrate state-of-the-art performance in graphic quality, rule-following, and content harmony.

Introduction

Content-aware layout generation involves the strategic placement of visual elements, such as text and logos, onto background images to ensure aesthetic harmony and functional clarity. Current approaches face two primary challenges: fragmentation and the relational paradox. Fragmentation refers to the reliance on multiple specialized models for different layout tasks (e.g., completion vs. refinement). The relational paradox describes the performance degradation that occurs when models are forced to follow strict spatial rules, often resulting in a loss of creative quality or content awareness. UniLayDiff addresses these issues by providing a single, unified architecture capable of handling diverse constraints without sacrificing generative diversity.

Methodology

UniLayDiff is built upon a Multi-Modal Diffusion Transformer (MM-DiT) backbone, incorporating several architectural innovations to achieve unification and high-fidelity generation.

Dual-Path Interaction

The model employs a dual-path architecture to manage different input modalities effectively. One path handles the interaction between the background image and the layout, while the other manages constraints (such as masks) and the layout. This separation prevents data dilution and ensures that the model remains sensitive to both visual context and explicit user constraints.

The UniLayDiff architecture featuring dual-path modality interaction and LoRA-based relation injection.

LoRA for Relational Constraints

To overcome the relational paradox, UniLayDiff utilizes a two-stage training process. After initial pre-training on general layout tasks, Low-Rank Adaptation (LoRA) is used to inject relational constraints. This "plugin" approach allows the model to learn specific spatial rules (e.g., "A is larger than B") while preserving the aesthetic knowledge gained during pre-training, thus avoiding mode collapse.

Optimization Objectives

The model is optimized using a combination of loss functions:

  • Relational Loss ($L_{rel}$): A differentiable penalty ensuring adherence to size and position rules.
  • Content-Constraint Loss ($L_{ctn}$): Utilizes saliency maps to prevent the occlusion of key visual subjects in the background.
  • Diffusion Loss ($L_{diff}$): The standard objective for the denoising process.

Experimental Results

The model was evaluated on the PKU and CGL e-commerce poster datasets, which include high-quality canvases and saliency maps.

Performance Metrics

UniLayDiff achieved state-of-the-art results across multiple dimensions:

  • Graphic Quality: Outperformed baselines like RALF and LayoutDiT in Fréchet Inception Distance (FID), indicating higher visual quality.
  • Constraint Adherence: In relational tasks, UniLayDiff reduced the Relation Violation Rate to 22.4% on the PKU dataset, a significant improvement over the previous best of 34.2%.
  • Content Awareness: The model demonstrated lower occlusion rates, successfully avoiding the covering of salient image regions.
Qualitative comparison of UniLayDiff against state-of-the-art baselines across various layout generation tasks.

Conclusion

UniLayDiff demonstrates that a unified transformer architecture can surpass specialized models in content-aware layout generation. By leveraging dual-path interactions and LoRA-based fine-tuning, it effectively balances rule-following with creative diversity. While inference speed remains a challenge typical of diffusion models (approximately 93ms per sample), the significant gains in parameter efficiency and layout quality mark a substantial step forward in automated graphic design. Future work will explore scaling to more complex elements and integrating natural language instructions via Large Language Models (LLMs).

Summary updated

BibTeX
@inproceedings{liu2026unilaydiff,
  author = {Zeyang Liu and Le Wang and Sanping Zhou and Yuxuan Wu and Xiaolong Sun and Gang Hua and Haoxiang Li},
  title = {{UniLayDiff: A Unified Diffusion Transformer for Content-Aware Layout Generation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=xeZ72x89EI},
}
Figure