Continuous, Subject-Specific Attribute Control in T2I Models by Identifying Semantic Directions

Stefan Andreas Baumann, Felix Krause, Michael Neumayr, Nick Stracke, Melvin Sevi, Vincent Tao Hu, Björn Ommer · Submission to ICLR 2025 · Withdrawn

Overview

Researchers from CompVis @ LMU Munich have developed a novel approach to achieve fine-grained, subject-specific control in text-to-image (T2I) models. By identifying "semantic directions" within CLIP token embeddings, their method allows users to continuously modulate specific attributes—such as making one person in a group older or a specific car more expensive. Crucially, this is achieved without modifying the underlying model weights or increasing inference time.

What Problem Does This Paper Address?

While modern text-to-image diffusion models like Stable Diffusion produce stunning visuals, they are notoriously difficult to "steer" with precision. If a user wants to change a specific attribute of a single person in a generated image, they typically face two imperfect options:

  1. Global Control: Methods like Concept Sliders can apply an attribute globally (e.g., making everyone in the image look older), but they struggle to target just one individual.
  2. Discrete Prompt Editing: Methods like Prompt-to-Prompt allow users to change text from "a man" to "an old man." However, this is a binary jump. It is nearly impossible to achieve "slightly older" or "much older" on a continuous scale without losing the original image's composition and breaking visual continuity.
Standard prompt editing often fails to provide gradual control and breaks image continuity.

The core challenge is achieving subject-specific, continuous, and disentangled control all at once. This paper fills that gap by finding linear directions in the text embedding space that correspond to specific physical or semantic traits.

Methods: Finding Semantic Directions

The authors' central insight is that the token-level CLIP embeddings used by diffusion models are locally smooth and exhibit subject-specificity. By modifying only the embedding of a specific subject token (e.g., the vector for "woman"), the resulting visual changes remain localized to that subject in the final image.

They propose two distinct ways to find these "semantic directions" ($\Delta e$):

  • Contrastive Prompts (Simple): A straightforward, optimization-free approach that calculates the difference between the embeddings of a neutral prompt (e.g., "a woman") and a positive prompt (e.g., "an old woman").
  • Learning-based Robust Directions (Advanced): To avoid unintended side effects—such as a "price" direction accidentally flipping a car's orientation—the authors utilize a reconstruction loss objective. They backpropagate through the diffusion model to find directions in the embedding space that most accurately match the desired changes in the model's noise prediction space.

At inference time, the learned direction vector is simply added to the target token's embedding, scaled by a factor ($\lambda$) that acts as a continuous "slider."

Key Insights and Results

The researchers primarily evaluated their method using Stable Diffusion XL (SDXL), identifying directions for a wide variety of attributes including age, smile, elegance, vehicle price, and hair length. They also demonstrated impressive "zero-shot" transferability to other models, including Stable Diffusion 1.5, SDXL Turbo, aMUSEd, and PixArt-$\alpha$.

  • Subject-Specificity and Disentanglement: In quantitative tests using multi-subject prompts, the method achieved a high "Subject-Specificity Ratio" (3.35), meaning the attribute change was heavily concentrated on the target subject rather than leaking to others. Using metrics like LPIPS (perceptual change) and $\Delta$Id (identity change), the authors showed that their learned directions modify the target attribute while preserving the subject's unique identity far better than standard prompt editing.
  • Zero Inference Cost: Unlike many control methods that require extra cross-attention layers or multiple denoising passes, this method only requires a single vector addition before the diffusion process begins. It maintains the base generation speed of SDXL (~12 seconds on an A100), whereas competing localized control methods like MasaCtrl can take over 150 seconds.
  • Additivity: Because these are linear directions, they are composable. You can add a "smile" direction and an "age" direction to the same subject simultaneously without interference.
Continuous, subject-specific control: The proposed method smoothly ages the woman while preserving the man's identity and the background.

Limitations and Future Work

While highly effective, the authors acknowledge a few limitations. First is attribute leakage: diffusion models sometimes "mix up" attributes between subjects due to the inherent nature of their cross-attention mechanisms (e.g., heavily aging one person might slightly age the person next to them). Second, the current work relies on a linear assumption. Future work could explore non-linear manifolds in the CLIP embedding space for even more complex attribute modulations. Finally, the quality of the control is ultimately bounded by the semantic richness of the underlying text encoder (like CLIP or T5) used by the T2I model.

Summary updated

BibTeX
@misc{baumann2024continuous,
  author = {Stefan Andreas Baumann and Felix Krause and Michael Neumayr and Nick Stracke and Melvin Sevi and Vincent Tao Hu and Björn Ommer},
  title = {{Continuous, Subject-Specific Attribute Control in T2I Models by Identifying Semantic Directions}},
  year = {2024},
  eprint = {2403.17064},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.17064},
}
Figure