How to Blend Concepts in Diffusion Models

Lorenzo Olearo, Giorgio Longari, Simone Melzi, Alessandro Raganato, Rafael Peñaloza

TL;DR

This paper investigates how to merge semantically distinct concepts—like a "lion-cat" or a "turtle-brain"—within Stable Diffusion without any additional training or fine-tuning. By comparing three existing techniques with a novel architectural approach (UNET injection), the authors demonstrate that while visual concept blending is highly effective, the "best" method depends entirely on the specific concepts and the desired balance between shape and texture.

What Problem Does This Paper Address?

In the world of Generative AI, concepts are represented as points or volumes in a high-dimensional latent space. While we can easily generate images from these points, "reasoning" with them—specifically blending two distinct ideas into a coherent new one—remains a challenge. Standard set operations don't apply here.

The authors seek to understand how different manipulations within the diffusion pipeline affect the resulting conceptual blend. They aim to simulate the human capacity for associative thinking, creating hybrid images that maintain the recognizability of both source concepts.

Methods

The researchers fixed their environment to Stable Diffusion v1.4 and tested four distinct blending strategies:

  1. TEXTUAL (Prompt Latent Space): This method calculates the Euclidean mean of the two prompt embeddings (e.g., the average of the vectors for "dog" and "rabbit") before feeding it into the model.
  2. SWITCH (Iterative Process): The model starts the denoising process using prompt $p_1$ and then, at a specific timestep, switches to prompt $p_2$. This typically uses $p_1$ for the general shape and $p_2$ for the fine details.
  3. ALTERNATE (Step-wise): The model oscillates between prompts at every step—using $p_1$ for even timesteps and $p_2$ for odd ones.
  4. UNET (Architectural Injection): The authors' novel contribution. They exploit the U-Net's structure by injecting $p_1$ into the encoder (guiding compression) and $p_2$ into the decoder (guiding reconstruction).
Figure 1: A visualization of the proposed analysis. From left to right: (a) given two input textual concepts (“dog”, “rabbit”), (b) four different techniques are applied to explore multiple ways to blend them together through stable diffusion and (c) the obtained outputs are compared with qualitative analysis and a user study.

Datasets

The study did not require a training dataset as it utilized a pre-trained model. Instead, the authors created a qualitative benchmark consisting of 24 concept pairs divided into four macro-categories:

  • Pair of Animals: (e.g., Elephant-Duck)
  • Object + Animal: (e.g., Turtle-Brain)
  • Compound Words: (e.g., Butter-Fly, where the blend is a literal interpretation)
  • Real-life Scenarios: (e.g., Kung fu-Panda)

Evaluation was conducted via a user study involving 23 participants who ranked the outputs based on "blending effectiveness."

Key Insights and Ideas

  • The Primary-Modifier Asymmetry: Most blending methods are non-symmetric. In SWITCH and UNET, the first prompt acts as the "main" concept (the base shape), while the second acts as a modifier. Interestingly, in TEXTUAL and ALTERNATE, the second prompt often dominates the final image.
  • The "Cartoonification" Trap: In the SWITCH method, if the transition between prompts happens at the wrong time, the model struggles to bridge the gap between the two distributions. To compensate, it often removes high-frequency details, resulting in a "cartoonish" look.
  • Semantic vs. Visual Blending: TEXTUAL blending happens in the semantic space of the CLIP encoder. The other three methods are "visual" or "architectural" blends that manipulate the denoising process itself.
Comparison of the four methods across different prompt pairs.

Key Results

The user study revealed that there is no "silver bullet" for concept blending:

  • SWITCH was most frequently ranked as the best method (the "mode" winner) for categories like Object + Animal and Compound Words, but it is highly sensitive to the choice of switch-over timestep.
  • TEXTUAL performed best for Pairs of Animals, where the concepts are semantically closer.
  • UNET (the novel method) produced the most subtle blends. While it ranked lower in the user study because the hybrids were less "obvious," it was noted for its consistency across different random seeds.
  • Global Ranking: On average, SWITCH had the best mean rank (2.26), followed by TEXTUAL (2.54), ALTERNATE (2.61), and UNET (2.68).

Limitations and Future Work

The authors acknowledge several hurdles:

  • Manual Tuning: The SWITCH method requires tedious trial-and-error to find the optimal timestep for each specific pair of concepts.
  • Prompt Simplicity: The study focused on simple, one-word prompts. Complex, descriptive prompts might interact with these blending methods in unpredictable ways.
  • Ambiguity: General terms (like "pit" and "bull") are prone to misinterpretation by the model, leading to unexpected results (like a "Bull-Pit" instead of a "Pit-Bull").

Future research could look into automated ways to determine the optimal blending parameters or explore how to guarantee more specific identification of concepts to reduce ambiguity.

Summary updated

BibTeX
@inproceedings{olearo2024how,
  author = {Lorenzo Olearo and Giorgio Longari and Simone Melzi and Alessandro Raganato and Rafael Peñaloza},
  title = {{How to Blend Concepts in Diffusion Models}},
  booktitle = {ISD},
  year = {2024},
}
Figure