TL;DR
State-of-the-art image generation models often fail at tasks requiring precise spatial reasoning, such as understanding object poses or metric distances. SpatialFusion fixes this by embedding a parallel spatial transformer into a Multimodal Large Language Model (MLLM) to predict 3D metric-depth maps, which are then used as explicit geometric scaffolds to guide a diffusion generator. This approach yields massive improvements on spatial benchmarks—even outperforming GPT-4o—while adding less than 3% inference latency.
What Problem Does This Paper Address?
While unified image generation models (which pair MLLMs for text understanding with diffusion networks for image synthesis) excel at creating realistic imagery, they are notoriously bad at spatial awareness. If you ask them to "place a monkey to the right of the fireman, from the fireman's perspective" or "position the fan exactly 1 meter from the woman," they frequently blunder.
The authors identify two root causes for this:
- Geometry-deficient understanding: MLLM internal representations correlate strongly with semantic categories but poorly with geometric attributes.
- Geometry-unconstrained synthesis: Without explicit structural guidance, the iterative denoising process of diffusion backbones relies purely on high-level semantic embeddings, failing to anchor precise spatial layouts.
Methods
SpatialFusion introduces a native, two-part mechanism to inject 3D awareness directly into the generative pipeline:
- Semantics-Guided Geometric Derivation: Using a Mixture-of-Transformers (MoT) architecture, the authors add a lightweight, parallel Spatial Transformer alongside the MLLM. By sharing self-attention layers with the MLLM, this spatial transformer extracts structural representations from the text context and predicts a dense metric-depth map of the target scene via a Dense Prediction Transformer (DPT) head.
- Geometry-Constrained Image Synthesis: To turn this depth map into guidance, a specialized Depth Adapter aligns the depth features with the diffusion model's latent space. These features are fused into the noisy latents via element-wise addition before patchification, acting as a structural residual that constrains the Diffusion Transformer (DiT).
Training Strategy
The model is trained in a progressive two-stage curriculum:
- Stage 1 (Geometric-Aware Pre-training): The MLLM and diffusion backbone are frozen. The Spatial Transformer is trained to predict depth maps using pseudo-ground-truth labels generated by a frozen 3D foundation model teacher (VGGT).
- Stage 2 (Geometry-Guided Joint Training): The diffusion backbone is unfrozen, and the entire system is optimized jointly using a combined loss function that balances image reconstruction quality with geometric accuracy.
[Text/Image Input]
│
▼
┌──────────────┐ Shared Attention ┌─────────────────────┐
│ MLLM │ ─────────────────────────> │ Spatial Transformer │
└──────────────┘ └─────────────────────┘
│ │
│ (Semantic Context) ▼ (Derives Depth Map)
│ [DPT Head]
│ │
▼ ▼
┌─────────────────────────────────────────────────────────────────┐
│ Diffusion Transformer │
│ (Latents + Semantic Context + Depth Adapter Fusion) │
└─────────────────────────────────────────────────────────────────┘
│
▼
[Spatially-Coherent Image]
Datasets
- Training: A curated, million-scale geometry-augmented dataset consisting of web-sourced and synthetic samples. Tasks are split into foundational generation, spatially-aware generation (pose, relation, measurement), and geometry-consistent editing (object addition/removal/replacement).
- Evaluation:
- Spatial Benchmarks: GenSpace (the primary benchmark for spatially-aware text-to-image generation and editing).
- Standard Benchmarks: GenEval, T2I-CompBench++, DPG-Bench (for text-to-image validation); ImgEdit-Bench and GEdit-Bench-EN (for image editing validation).
Key Insights and Ideas
- Uniform Attention Sampling Wins: When connecting the Spatial Transformer to the MLLM, sharing attention uniformly across all layers performs better than just sharing early (shallow) or late (deep) layers. Geometric reasoning requires a balanced diet of both low-level features and high-level semantic abstractions.
- Addition > Concatenation: Injecting depth features into the diffusion latent space via element-wise addition outperforms channel-wise concatenation. Addition acts as a residual constraint, preserving the model's pretrained generative priors without disrupting input dimensionality.
- 3D Awareness Boosts 2D Quality: Surprisingly, introducing 3D geometric constraints actually improves performance on non-spatial metrics like color, texture, and shape alignment. A solid structural foundation elevates overall image composition.
Key Results
- GenSpace Benchmark: SpatialFusion achieved an overall average score of 46.33 in text-to-image generation and 35.40 in image editing, comfortably beating the base model (OmniGen2) and outperforming GPT-4o (which scored 43.22 and 31.91, respectively).
- Spatial Poses & Relations: In allocentric and intrinsic spatial relationship tasks, SpatialFusion demonstrated relative accuracy gains of 23% and 31% over the strongest baselines.
- Negligible Overhead: While adding the spatial modules increases the total parameter count by 18.5%, it introduces less than a 3% latency delay per image (e.g., text-to-image generation time only increased from 12.32 seconds to 12.58 seconds on an NVIDIA H200 GPU).
Limitations and Future Work
- The Hyperparameter Balance: The authors note a strict trade-off controlled by the geometric loss weight ($\lambda$). If $\lambda$ is set too high, the network over-focuses on depth map accuracy, which inadvertently degrades the visual fidelity and realism of the final image.
- Teacher Dependency: The framework's initial geometric awareness relies heavily on the quality of the pseudo-ground-truth depth maps provided by the VGGT teacher model during pre-training. Errors in the teacher model could propagate downstream.
Summary updated