Introduction
Text-to-image (T2I) diffusion models like Stable Diffusion have transformed digital content creation, yet they often lack the granular control required for professional workflows. A common challenge arises when a user wishes to modify the geometry of a specific object within a generated scene—such as changing the shape of a basket on a table—without altering the surrounding environment. Standard approaches typically result in "global drift," where changing a random seed or a prompt keyword causes the entire composition, lighting, and layout to shift. This paper introduces a novel framework for object-level shape exploration, enabling users to iterate on the geometry of a single item while maintaining the integrity of the rest of the image.
The Problem: Geometry vs. Context
Existing editing tools generally fall into two categories: those that handle textural changes (like inpainting or SDEdit) and those that attempt structural edits. However, inpainting often requires tedious manual masking, and SDEdit struggles to significantly alter an object's geometry without losing the original scene's layout. The fundamental difficulty lies in decoupling the spatial structure of a specific object from the global context of the diffusion process. The authors aim to bridge this gap by providing a training-free method to localize shape variations.
Methodology: Local-Prompt-Mixing
The proposed approach, termed Local-Prompt-Mixing, is built upon three technical pillars that address the "when," "what," and "where" of object editing.
1. Temporal Control (The "When")
The authors observe that the diffusion denoising process is hierarchical. Early timesteps establish the global layout, middle steps define the specific geometry and shapes of objects, and final steps add fine-grained textures and details. By applying a "proxy word" (e.g., replacing "basket" with "tray") only during the critical middle steps, the model can alter the target object's shape without disrupting the global layout established in the early stages.
2. Proxy Word Selection (The "What")
To automate the exploration of shapes, the system searches the CLIP embedding space for tokens that are semantically related to the target object but possess different geometric profiles. For instance, using "cot" as a proxy for "tent" provides the model with a different geometric prior while maintaining semantic coherence.
3. Localization Techniques (The "Where")
To ensure the edits are strictly local, the authors employ two primary techniques:
- Attention-Based Shape Localization: The method selectively injects self-attention maps from the original generation into the new process. By preserving the attention "rows and columns" corresponding to the background and non-target objects, the system "locks" the rest of the scene in place while allowing the target object to morph.
- Self-Segmentation: The authors introduce a training-free segmentation method that clusters self-attention features using K-Means. This allows for a seamless latent-space blend at specific timesteps, ensuring the background is perfectly preserved without requiring manual masks.
Experimental Setup and Results
The study primarily utilizes Stable Diffusion. To evaluate the method, the authors curated a dataset of 150 base images generated from templates (e.g., "A {mug} with w") and produced 20 variations for each. The method was also tested on real-world images using Null-text inversion to map them into the latent space.
Key Insights
- The Geometry is in the Middle: The temporal isolation of shape is a profound insight, allowing for mid-flight prompt swapping to change object structure without changing the environment.
- Self-Attention as a Structural Anchor: Self-attention layers are shown to be the primary drivers of spatial layout. Selective injection of these maps provides a powerful, training-free mechanism for localized editing.
- Pareto Superiority: Quantitative evaluations using Intersection over Union (IoU) for diversity and CLIP similarity for faithfulness show that this method achieves a superior trade-off compared to baselines like Prompt-to-Prompt or Instruct-Pix2Pix. It offers higher shape diversity than inpainting while maintaining better image preservation than global editing methods.
Conclusion and Future Work
Local-Prompt-Mixing demonstrates that fine-grained control over object geometry is possible without expensive retraining or manual intervention. While the current method relies on discrete tokens from the CLIP vocabulary, future work may explore continuous embedding spaces for smoother shape interpolation. Additionally, while the method is robust, it remains dependent on the underlying diffusion model's internal vocabulary and may occasionally face semantic failures if a proxy word is too distant from the original context. Despite these limitations, the localization techniques presented here are general-purpose and can be integrated into other T2I editing frameworks to improve spatial control.
Summary updated