Spatial-Aware Latent Initialization for Controllable Image Generation

Wenqiang Sun, Teng Li, Zehong Lin, Jun ZhangarXiv 2024 · DOI

Abstract

While modern text-to-image (T2I) diffusion models produce high-fidelity imagery, they frequently fail to respect explicit spatial constraints, such as bounding box specifications. This paper introduces SALT (Spatial-Aware Latent iniTialization), a novel framework that replaces standard random Gaussian noise with "spatially-aware" noise. By performing DDIM inversion on a coarse reference layout, SALT provides the diffusion process with a structural "head start." When combined with a simplified Attention Guidance (AG) mechanism, the resulting SALT-AG method achieves superior layout accuracy and visual quality without requiring model retraining or extensive optimization.

Introduction

Current T2I models like Stable Diffusion excel at semantic synthesis but struggle with precise spatial control. Even when provided with bounding boxes, these models often ignore the requested layout. Existing training-free interventions typically rely on manipulating cross-attention maps during the denoising process. However, these methods often conflict with the initial random noise, which may possess inherent spatial biases incompatible with the user's instructions. This "uphill battle" against initialization leads to either failed layouts or degraded image quality due to overly aggressive guidance.

The SALT-AG Framework

The proposed solution, SALT-AG, addresses the root cause of layout failure by aligning the initial noise with the target spatial configuration.

1. Spatial-Aware Latent Initialization (SALT)

Instead of starting from pure random noise, SALT generates a "draft" reference image by placing object masks within the specified bounding boxes against a neutral background. The framework then applies DDIM Inversion to this draft. This process reverses the diffusion steps to identify the specific noise latent that would naturally lead to the target layout. By using this inverted latent as the starting point, the model begins generation with a pre-existing structural bias toward the desired coordinates.

Figure 1: The SALT process demonstrated with a dog and frisbee. The initial layout (left) is used to create a spatially-aware latent (middle), leading to a final generation (right) that respects the bounding boxes.

2. Simplified Attention Guidance (AG)

Because the SALT initialization already aligns with the target layout, the subsequent denoising process requires significantly less corrective force. Traditional methods might require 10 or more optimization steps per iteration to "push" objects into place. In contrast, SALT-AG achieves high-fidelity results with only 1–3 optimization steps, drastically reducing computational overhead while preserving image quality.

Experimental Evaluation

The authors evaluated SALT-AG using the COCO (Common Objects in Context) dataset, specifically focusing on subsets with single and multiple objects (COCO-single and COCO-multiple).

Key Findings

  • Layout Fidelity: SALT-AG significantly outperformed previous state-of-the-art training-free methods. Quantitative metrics showed improvements in Intersection over Union (IoU) and [email protected] by over 15% and 25%, respectively.
  • Multi-Object Handling: The method demonstrates robust performance even when managing complex scenes with multiple overlapping or distinct bounding boxes.
Figure 5: Multi-object generation using SALT-AG. The model successfully places two birds in the specified regions of the lake scene while maintaining high visual consistency.
  • Efficiency and Quality: By reducing the intensity of attention guidance, SALT-AG avoids the visual artifacts common in high-guidance regimes. Furthermore, the reduction in optimization steps makes the generation process significantly faster than competing training-free techniques.

Discussion and Future Work

A key insight of this research is that initial noise is not a "blank canvas" but a structured field with latent spatial preferences. SALT effectively "primes" this field. However, the authors noted a minor trade-off: strong layout guidance can occasionally lead to a slight decrease in CLIP scores, indicating a tension between spatial precision and fine-grained textual alignment. Future research will focus on balancing these two objectives and improving the generation of "untargeted" background elements.

Conclusion

SALT-AG represents a significant step forward in controllable image generation. By recognizing the importance of latent initialization, the framework provides a plug-and-play solution that enhances the spatial reliability of diffusion models without the need for costly retraining.

Reference: Sun, W., Li, T., Lin, Z., & Zhang, J. (2024). Spatial-Aware Latent Initialization for Controllable Image Generation. arXiv:2401.16157v1.

Summary updated

BibTeX
@misc{sun2024spatial,
  author = {Wenqiang Sun and Teng Li and Zehong Lin and Jun Zhang},
  title = {{Spatial-Aware Latent Initialization for Controllable Image Generation}},
  year = {2024},
  eprint = {2401.16157},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.16157},
}
Figure