arXiv:2609.01582cs.CVSep 2026

Manuscript Offprint

arXiv:2609.01582

SpatialGuard: Harness-Guided Verifiable Spatial Reasoning for Text-to-Image Generation

Ziyun Qian, Zizhi Chen, Yizhou Liu, Mingyang Sun, Dingkang Yang, Lihua Zhang

Abstract

Complex 3D spatial text to image generation requires models to convert natural language into stable visual geometry, not merely semantic appearance. Existing prompt-driven or layout-conditioned methods improve controllability, but often lack an optimizable and verifiable spatial intermediary before visual sampling. As a result, object relations, occlusion, visibility, and camera constraints can decay during multi-round generation. This paper presents SpatialGuard, a structured layout-guided framework for complex 3D spatial text-to-image generation. SpatialGuard parses prompts into image synthesis-oriented 3D layouts through a Spatial Layout Architect, realizes them as visual conditions and candidate images through a Visual Realizer, and uses a Visual Alignment Critic to validate consistency among prompt, layout, and image. To keep constraints stable across iterations, SpatialGuard introduces a Layout Harness that organizes rule constraints, tool invocation, shared knowledge, and feedback loops around the editable layout state. This design turns complex spatial generation from implicit prompt following into a verifiable process of planning, realization, validation, and repair. Comprehensive experiments show that SpatialGuard achieves state-of-the-art performance in complex 3D spatial layout generation and improves spatial faithfulness over existing text-to-image and layout control baselines.

1 Introduction

Complex 3D spatial text-to-image generation is a key capability for bridging natural-language interaction and controllable visual content production, with important applications in game-asset previewing (Husen et al., 2025; Li et al., 2025b), film storyboard design (Zhang et al., 2025a; Wang et al., 2026a), and embodied-intelligence simulation (Feng et al., 2026). These applications require models to translate spatial intent in natural language into stable visual geometry, rather than merely generating semantically related appearance content. Traditional prompt-driven methods (Pan et al., 2026a; Qiu et al., 2025; Han et al., 2026a; Jiang et al., 2026a) mainly rely on text-to-image models to infer spatial structure from text implicitly. Thus, in relation-dense, view-sensitive, and layout-constrained scenes, they often satisfy only local semantics and struggle to maintain global spatial consistency. Recent methods (Venkatesh et al., 2026; Qin et al., 2026; Agrawal et al., 2026; Zhang et al., 2025b) introduce layout conditions, hierarchical generation, 3D control signals, and multi-step planning to make spatial structure more explicit during generation, significantly improving the controllability of complex scenes. However, existing methods (Parihar et al., 2025; Li et al., 2025a) still face two key limitations. First, the generation process usually lacks an image-synthesis-oriented spatial layout intermediary that is optimizable and verifiable. As a result, complex spatial intent lacks a stable carrier before visual sampling, and text alone fails to provide sufficiently explicit and executable spatial constraints for subsequent synthesis. Second, when complex spatial intent requires multiple rounds of planning, generation, evaluation, and correction, large models are prone to context forgetting and constraint decay. Spatial requirements established in early stages are difficult to preserve in later interactions, weakening fidelity to the original prompt and degrading generation quality.

These limitations highlight two key requirements for complex spatial text-to-image generation. First, the model needs to form a verifiable layout representation before image sampling, allowing spatial constraints in text to be explicitly encoded, continuously optimized, and checked before generation. Second, the system needs a cross-round structured constraint enforcement mechanism, so that spatial requirements do not remain merely in prompts or

∗^{*}Corresponding authors. †\daggerProject lead.

Input Prompt: 'A desk anchors the image. A chair sits in front of the desk. A bookshelf stands to the right of the desk. A cat lounges clearly front-left of the desk, and a trash can sits front-right of the desk. The scene is a compact creative study with warm afternoon light, muted wood tones, soft shadows, and a quiet lived-in editorial style.'

Input Prompt: 'A bus is on the left side. A van is behind the bus, and an SUV is at the front-right of the bus. A pigeon walks on the ground between the bus and the SUV, while two sparrows fly above the SUV. The scene is a calm early-morning urban street with soft light and documentary realism.'

Figure

Input Prompt: 'A bed is in the center. A pillow is placed on the upper side of the bed. A lamp is on a table to the left of the bed, and a chair is positioned in front of the table. A cat is at the front-left of the bed. The scene is a serene watercolor-style bedroom with soft natural light and gentle cozy details.'

Figure

Input Prompt: 'A tractor anchors the image. A cow grazes front-left of the tractor, and a horse stands to the right of the tractor. Three hens walks in front of the tractor. The scene is a peaceful farmyard with warm realistic sunlight and a rustic countryside style.'

Figure

Figure

Figure 1: Example results of SpatialGuard on complex spatial text-to-image generation. Each case presents the input prompt, the generated 3D cube layout, and the corresponding synthesized image across urban street, farmyard, study, and bedroom scenes, demonstrating the model's ability to preserve multi-object spatial relations, directional constraints, and scene-style descriptions.

scoring signals but are stably preserved, actively retrieved, and updated according to feedback across planning, execution, verification, and revision. The former provides explicit spatial targets for image synthesis, while the latter ensures that these targets remain effective in long-chain interactions despite memory decay. Together, they indicate a stronger generation paradigm: complex 3D layouts should not only be prompted by language, but also explicitly designed, executed, and maintained.

To address these issues, we propose SpatialGuard, a structured-layout-guided generation framework for complex 3D spatial text-to-image generation. It unifies verifiable layout representation and persistent constraint enforcement within a single generation process. SpatialGuard consists of three collaborative modules. The Spatial Layout Architect parses input text into an image-synthesis-oriented 3D structured layout, providing a checkable and editable representation of complex spatial intent before sampling. The Visual Realizer converts this layout into visual conditions and synthesizes images, bringing spatial targets into pixel space. The Visual Alignment Critic evaluates consistency among text, layout, and image, and feeds deviations back to subsequent planning. These modules operate around a shared layout state, preventing text understanding, image realization, and result evaluation from becoming decoupled across multi-round interaction.

Moreover, to prevent memory decay of spatial constraints during multi-round agent planning and interaction, we first introduce the idea of an agent harness (Lin et al., 2026; Li et al.; Pan et al., 2026b) into text-to-image generation and distill it into four core mechanisms: rule constraints, tool invocation, shared knowledge, and feedback loops. Rule constraints convert spatial requirements in language into checkable layout boundaries. Tool invocation turns layout decisions into externally executable operations. Shared knowledge preserves layout versions, evaluation judgments, and revision trajectories across stages. Feedback loops reinject detected spatial deviations into layout planning and image generation. Based on the automated project workflow, SpatialGuard generates an initial 3D layout from text, performs deterministic verification according to the object list and spatial relations, iteratively invokes 3D layout rendering and image synthesis, and produces executable repair plans when spatial violations are detected. Thus, it shifts complex spatial text-to-image generation from prompt-driven implicit generation to verifiable generation guided by structured layouts and maintained by constraint mechanisms.

The main contributions of this paper are as follows:

• We propose SpatialGuard, an agentic layout generation framework for complex 3D spatial text-to-image generation, enabling closed-loop modeling from textual spatial intent to verifiable visual generation.

• We introduce the concept of agent harness into the text-to-image pipeline for the first time and build a cross-round spatial constraint enforcement mechanism to mitigate memory decay in complex spatial generation by large models.

• Comprehensive quantitative and qualitative experiments show that SpatialGuard achieves new state-of-the-art performance in complex 3D spatial text-to-image generation and significantly outperforms existing text-to-image and layout-control baselines.

References (13)