SpatialLock: Precise Spatial Control in Text-to-Image Synthesis
Biao Liu, Yuanzhi Liang · 2025
Read SpatialLock: Precise Spatial Control in Text-to-Image Synthesis by Biao Liu, Yuanzhi Liang (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2511-04112.txt.
Introduction
Biao Liu and Yuanzhi Liang present SpatialLock, a framework for placing objects exactly where a text prompt wants them in generated images. Text-to-image systems now produce strong pictures and useful synthetic datasets, yet exact object location remains shaky because position data in prompts is underused.
One component injects spatial information directly through an attention layer so grounding is learned well. A second uses perception-based guidance to refine placement further. Together they generate objects in precise spatial layouts while improving overall visual quality. Experiments set a new state of the art for precise positioning, with overlap scores above nine tenths across several datasets in its tests.
Catalog record
| CREATOR | Biao Liu, Yuanzhi Liang |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 42 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2511-04112
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
SpatialLock: Precise Spatial Control in Text-to-Image Synthesis Biao Liu, Yuanzhi Liang Abstract . Text-to-Image (T2I) synthesis has made significant advancements in recent years, driving applications such as generating datasets automatically. However, precise control over object localization in generated images remains a challenge. Existing methods fail to fully utilize positional information, leading to an inadequate understanding of object spatial layouts. To address this issue, we propose SpatialLock , a novel framework that leverages perception signals and grounding information to jointly control the generation of spatial locations. SpatialLock incorporates two components: Po sition-Engaged I njection ( PoI ) and Po sition- G uided Learning ( PoG ). PoI directly integrates spatial information through an attention layer, encouraging the model to learn the grounding information effectively. PoG employs perception-based supervision to further refine object localization. Together, these components enable the model to generate objects with precise spatial arrangements and improve the visual quality of the generated images. Experiments show that SpatialLock sets a new state-of-the-art for precise object positioning, achieving IOU scores above 0.9 0.9 across multiple datasets, as shown in Figure 1 . Figure 1. In various scenarios, SpatialLock generates vivid images with more accurate position object entities compared to other methods, demonstrating the efficacy of our approach (we assess the accuracy of the generated object entities using the IOU, and the best performance is highlighted in red ). 1. Introduction Generative models have advanced significantly in recent years, particularly Diffusion Models (DMs), which exhibit exceptional generation quality due to their unique mechanisms and robust generation processes ( 29 ; 35 ; 32 ) . These capabilities have unlocked numerous new possibilities, such as generating high-quality datasets ( 43 ; 2 ) , addressing data limitations in machine learning ( 42 ) , and enabling large-scale model training ( 27 ) . However, despite their high fidelity and resolution, DMs often struggle with precise control over object localization ( 13 ) . The inherent lack of coordinate-level positional input in original DMs leads to generated instances frequently deviating from intended locations. Although recent efforts have integrated position signals as input to improve DMs’ positional control ( 21 ; 46 ; 4 ; 5 ) , existing methods still underutilize the position information. Specifically, as shown in Figure 2 , some approaches lack explicit guidance for location information ( 21 ) , while others fail to empower specific understanding ability for the position ( 46 ) . This limits their ability to fully encode spatial features, hindering the generation of images with accurate object layouts. To address the challenges of precise object localization, we propose SpatialLock , a novel T2I framework that achieves accurate spatial arrangements through the integration of grounding and perception information. SpatialLock extends a base T2I model ( 32 ) by introducing two components: Position-Engaged Injection ( PoI ) and Position-Guided Learning ( PoG ). These components enhance the model’s ability to learn spatial information and generate objects at specified locations. Specifically, PoI provides a mechanism to incorporate grounding information directly into the network during training, while PoG introduces perception supervision to further refine spatial accuracy. Together, these components improve localization precision and preserve the high fidelity of generated images, allowing the model to deliver consistent and visually accurate results. Figure 2. Compared to prior methods, our method uses cross-attention and a perception module to ensure the sufficient encoding of location information, additionally, we incorporate Enh-Fusion into the perception module to further integrate global information. Next, we describe the proposed methods in detail. PoI introduces an attention module, Grounding-Attention ( 41 ) , to process grounding information via Grounding-Tokens ( 21 ) , enabling the model to effectively integrate spatial information with visual and textual features. This module enhances the network’s capacity to learn positional relationships and ensures more accurate placement of object entities. On the other hand, PoG provides additional supervision by utilizing perception information, which guides the network to adhere strictly to the input spatial layout, and to enhance contextual understanding and mitigate the interference of perception information on the diffusion process , we integrate Enh-Fusion , a Transformer-based fusion module with stronger representation capabilities, into the PoG . Leveraging these constraints on spatial information, SpatialLock achieves a deeper understanding of the semantic information in the input data, thereby improving the positional accuracy of generated objects. Experiments demonstrate that SpatialLock achieves state-of-the-art performance in generating object entities with precision location. For instance, on the MSCOCO dataset ( 24 ) , SpatialLock achieved a 32.1 mAP, outperforming previous methods by 0.9 , and demonstrating a 1.34 improvement in FID. These results highlight the effectiveness of integrating grounding and perception signals into T2I models, enabling precise object localization with fewer trainable parameters. The primary contributions of our work are as follows: 1. We propose SpatialLock , a novel T2I framework that integrates grounding and perception information to achieve precise object localization in generated images. 2. We design and introduce two components, PoI and PoG , which enhance the ability of the model to learn positional relationships and refine spatial layouts through grounding and perception supervision, respectively. 3. SpatialLock establishes new state-of-the-art performance in image generation tasks, achieving superior results in localization precision and image fidelity. Figure 3. SpatialLock incorporates PoI and PoG into the original Stable Diffusion framework. PoI learns grounding information directly through Grounding-Attention to generate the precise positional layout, and PoG provides an extra supervisor by perception information to refine the object location. 2. Related Work Diffusion Models. Diffusion models (DMs) achieve image generation by learning the bidirectional transition between images and Gaussian noise ( 29 ; 35 ; 32 ) . This unique learning mechanism results in superior fidelity and image quality compared to traditional GANs ( 7 ; 15 ; 16 ) . Due to their outstanding performance, DMs have garnered significant research interest, with various domains exploring their application to alleviate repetitive tasks ( 38 ; 10 ) . Some researchers have integrated DMs with latent spaces, creating a transformative architecture known as Latent Diffusion Models (LDMs) ( 19 ) , which substantially improves training speed and generation efficiency. However, the original LDMs primarily control generation results through text-captions, limiting their generative capabilities ( 6 ) . To address this issue, we inject position information into the LDM framework, enabling the network to control the position of generated objects and thus address a broader spectrum of generation requirements. Generated Image with Layout. Generating images with specified layouts has always been a focal point of research, involving the synthesis of corresponding images given object bounding boxes and categories ( 5 ; 52 ) . Over the past years, notable advancements have been achieved ( 8 ; 17 ) . Earlier approaches, based on convolutional neural networks (CNNs), made significant strides ( 52 ) , with those methods primarily relying on auto-encoders (VAEs) ( 26 ) , which require fewer training resources. Subsequently, the exploration of Transformer architectures ( 41 ) has led to an increasing number of methods leveraging these mechanisms. GLIGEN ( 21 ) integrates self-attention layers into standard LDMs to extract grounding information, while LayoutDiffuse ( 5 ) adopts a customized Transformer module to encode bounding box information. GeoDiffusion ( 3 ) uses grounding,