Introduction
Text-to-image (T2I) models like Stable Diffusion have revolutionized digital art generation, yet they remain notoriously "space-blind." While these models excel at rendering textures and styles, they frequently fail to respect spatial relationships defined in text prompts. Common failures include missing objects, attribute leakage (e.g., swapping colors between two items), and complete disregard for positional cues like "above" or "to the right of."
Existing solutions often require users to provide manual layouts or involve computationally expensive model fine-tuning. STORM (Spatial Transport Optimization by Repositioning Attention Map) introduces a training-free alternative that automatically aligns generated images with spatial text prompts by treating attention maps as probability distributions and optimizing them via Optimal Transport theory.
The STORM Methodology
The core innovation of STORM is the Spatial Transport Optimization (STO) framework. This method intervenes in the early stages of the image denoising process—specifically the first 25 steps—where the "skeleton" or layout of the image is established.
- Attention as Distribution: STORM interprets cross-attention maps—the internal representations that link specific words to pixel regions—as distributions of "mass."
- Optimal Transport (OT): To correct an object's position, the model must move this "mass" to the target location. STORM utilizes the Sinkhorn Algorithm to calculate the most efficient transport plan for repositioning these maps without destroying the underlying image structure.
- Custom Cost Functions: The optimization is guided by two primary costs: Positional Guidance, which penalizes the model when objects appear on the wrong side of their reference points, and Non-overlap Cost, which prevents "subject blending" by ensuring distinct objects remain separate.
Experimental Results
STORM was evaluated against rigorous benchmarks including VISOR (spatial accuracy), T2I-CompBench (compositional generation), and TIFA (vision-language verification).
- Spatial Precision: On the VISOR benchmark, STORM improved spatial accuracy from 62.98% (base Stable Diffusion 1.4) to 94.39%. In more challenging "VISOR4" tests requiring consistency across multiple seeds, STORM's success rate was over 15 times higher than the base model.
- Attribute Binding: By enforcing spatial separation, STORM also mitigates attribute leakage. On T2I-CompBench, color binding scores rose from 0.37 to 0.64, demonstrating that correct placement is a prerequisite for correct coloring.
- Solving Missing Objects: A significant side effect of STORM's spatial enforcement is the reduction of missing objects. By reserving specific spatial "slots" for every noun in a prompt, the model is forced to render objects that it might otherwise ignore.
Conclusion
STORM demonstrates that precise spatial control in T2I synthesis does not require retraining or manual user input. By leveraging the mathematical elegance of Optimal Transport during the critical early phases of denoising, STORM provides a robust, "plug-and-play" solution for compositional image generation. Future work aims to optimize the inference speed of the Sinkhorn iterations and extend these spatial guarantees to the temporal domain of video generation.
Summary updated