ESPLoRA: Enhanced Spatial Precision with Low-Rank Adaption in Text-to-Image Diffusion Models for High-Definition Synthesis

Andrea Rigo, Luca Stornaiuolo, Mauro Martino, Bruno Lepri, Nicu Sebe

Abstract

Diffusion models have revolutionized text-to-image (T2I) synthesis, producing high-quality, photorealistic images. However, they still struggle to properly render the spatial relationships described in text prompts. To address the lack of spatial information in T2I generations, existing methods typically use external network conditioning and predefined layouts, resulting in higher computational costs and reduced flexibility. Our approach builds upon a curated dataset of spatially explicit prompts, meticulously extracted and synthesized from LAION-400M to ensure precise alignment between textual descriptions and spatial layouts. Alongside this dataset, we present ESPLoRA, a flexible fine-tuning framework based on Low-Rank Adaptation, specifically designed to enhance spatial consistency in generative models without increasing generation time or compromising the quality of the outputs. In addition to ESPLoRA, we propose refined evaluation metrics grounded in geometric constraints, capturing 3D spatial relations such as in front of or behind. These metrics also expose spatial biases in T2I models which, even when not fully mitigated, can be strategically exploited by our TORE algorithm to further improve the spatial consistency of generated images. Our method outperforms the current state-of-the-art framework, CoMPaSS, by 13.33% on established spatial consistency benchmarks.

Introduction

While modern diffusion models generate breathtaking imagery, they often exhibit "spatial illiteracy." A request for "a cat to the left of a toaster" frequently results in the correct objects but randomized relative positions. Existing solutions often rely on heavy external machinery, such as ControlNets requiring manual sketches or LLM-based planning steps. These approaches are computationally expensive and can degrade final image quality. ESPLoRA addresses these challenges by improving spatial consistency "from the inside" through efficient fine-tuning.

Methodology

The ESPLoRA framework employs a three-pronged approach to enhance spatial precision:

  1. Enhanced Spatial Precision with Low-Rank Adaptation (ESPLoRA): Instead of introducing new neural layers, the framework utilizes LoRA to fine-tune existing weights in models like Flux.1 and SDXL. This maintains a lightweight architecture and ensures zero increase in inference time.
  2. Geometry-Grounded Extraction: To generate high-quality training data, the researchers developed a pipeline using Molmo for object identification, Grounding DINO for bounding box generation, and Depth Anything for 3D depth mapping. This allows for the mathematical definition of complex relationships like "behind" or "under" based on precise coordinates and depth values.
  3. Transforming Original Relations Effectively (TORE): Recognizing that models possess inherent spatial biases (e.g., Flux.1 excels at "on top of" but struggles with "under"), TORE acts as a pre-processing step. It detects requests for "weak" relationships and semantically flips them to "strong" counterparts (e.g., rephrasing "A is under B" to "B is on top of A") to leverage the model's existing strengths.
Spatial relationship extraction using geometric grounding to define 2D and 3D relations.

Data and Evaluation

The model was trained on the Urban T2I Spatial Dataset, a collection of 5.6 million prompts derived from 22,000 natural images in LAION-400M, specifically targeting complex urban scenarios. Additionally, a Synthetic Dataset was created by validating base model outputs against the geometric pipeline, keeping only those that accurately rendered spatial relationships.

Evaluation utilized the standard T2I-CompBench and a new Urban Benchmark designed for multi-object configurations. Results indicate that fine-tuning on high-quality synthetic images—strictly validated for spatial accuracy—outperforms fine-tuning on natural images, suggesting that "correctness" is more vital than "naturalness" for spatial tasks.

Results and Discussion

ESPLoRA achieves state-of-the-art performance, with the Flux.1 + ESPLoRA + TORE combination reaching scores of 0.34 in 2D spatial accuracy and 0.42 in 3D on T2I-CompBench, surpassing the previous CoMPaSS baseline. Crucially, ESPLoRA maintains full high-definition output quality without the resolution trade-offs or increased generation times seen in prior methods.

High-definition synthesis demonstrating precise spatial alignment of multiple objects.

The model also demonstrates strong generalization, improving spatial understanding in general domains beyond its urban training data. However, some limitations remain, such as "object duplication" (generating crowds to satisfy "next to" prompts) and "style confusion" (where spatial keywords inadvertently influence the overall artistic style).

Conclusion

ESPLoRA demonstrates that spatial illiteracy in diffusion models can be significantly mitigated through targeted LoRA fine-tuning and strategic prompt engineering. By exploiting model biases and utilizing strictly validated synthetic data, the framework provides a scalable, efficient path toward high-definition image synthesis with precise spatial control. Future work will focus on integrating depth maps during training to address object duplication and further decoupling style from spatial instructions.

Summary updated

Abstract

Diffusion models have revolutionized text-to-image (T2I) synthesis, producing high-quality, photorealistic images. However, they still struggle to properly render the spatial relationships described in text prompts. To address the lack of spatial information in T2I generations, existing methods typically use external network conditioning and predefined layouts, resulting in higher computational costs and reduced flexibility. Our approach builds upon a curated dataset of spatially explicit prompts, meticulously extracted and synthesized from LAION-400M to ensure precise alignment between textual descriptions and spatial layouts. Alongside this dataset, we present ESPLoRA, a flexible fine-tuning framework based on Low-Rank Adaptation, specifically designed to enhance spatial consistency in generative models without increasing generation time or compromising the quality of the outputs. In addition to ESPLoRA, we propose refined evaluation metrics grounded in geometric constraints, capturing 3D spatial relations such as \textit{in front of} or \textit{behind}. These metrics also expose spatial biases in T2I models which, even when not fully mitigated, can be strategically exploited by our TORE algorithm to further improve the spatial consistency of generated images. Our method outperforms the current state-of-the-art framework, CoMPaSS, by 13.33% on established spatial consistency benchmarks.
BibTeX
@misc{rigo2025esplora,
  author = {Andrea Rigo and Luca Stornaiuolo and Mauro Martino and Bruno Lepri and Nicu Sebe},
  title = {{ESPLoRA: Enhanced Spatial Precision with Low-Rank Adaption in Text-to-Image Diffusion Models for High-Definition Synthesis}},
  year = {2025},
  eprint = {2504.13745},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.13745},
}
Figure