Diffusion Explainer: Visual Explanation for Text-to-image Stable Diffusion

Seongmin Lee, Benjamin Hoover, Hendrik Strobelt, Zijie J. Wang, Shengyun Peng, Austin P. Wright, Kevin Li, Haekyu Park, Haoyang Yang, Duen Horng Polo Chau · DOI

Abstract

Diffusion Explainer is the first interactive, web-based visualization tool designed to help non-experts understand how Stable Diffusion generates images from text. By integrating high-level architectural overviews with low-level operational details and comparative "trajectory" views, it makes the complex, iterative denoising process intuitive and accessible.

Introduction: Bridging the AI Literacy Gap

While diffusion models like Stable Diffusion have transformed digital creativity, they remain "black boxes" to the average user. Existing educational resources typically fall into two camps: high-level summaries that skip the underlying mechanics, or dense technical papers filled with mathematics and code that alienate non-experts.

The authors identify a major gap in AI literacy: explaining the interplay between text encoding (CLIP), iterative denoising (UNet), and hyperparameters like "guidance scale" without requiring a PhD. Understanding these mechanics is becoming crucial for designers, policymakers, and artists who need to communicate effectively with AI systems and understand their limitations.

System Design and Methods

The researchers developed Diffusion Explainer, a tool built on a standard web stack (HTML/CSS/JS/D3.js) that runs directly in a user's browser. The tool employs several key technical features to demystify the diffusion process:

  • Multi-Level Abstraction: The tool uses a "zoomable" interface. Users start at a high-level overview of the pipeline and can click into components (like the Text Representation Generator) to see underlying operations like tokenization and vector encoding.
  • Animation of the Denoising Process: It visually demonstrates how random noise is gradually refined into a coherent image over 50 timesteps, controlled by a "Timestep Controller."
  • Interactive Hyperparameters: Users can toggle between different guidance scales (e.g., 0, 1, 7, 20) to see how the strength of the text prompt affects the final output in real-time.
Overview of the Diffusion Explainer interface, illustrating the end-to-end pipeline from prompt selection to image generation.

To ensure a smooth experience without requiring a high-end GPU, the tool uses pre-computed data for a set of representative prompts rather than generating images on-the-fly.

Visualizing the Denoising Trajectory

One of the most powerful features of Diffusion Explainer is the Refinement Comparison View. To show how prompts "steer" generation, the authors used UMAP (Uniform Manifold Approximation and Projection) to project high-dimensional image representations into a 2D space. This allows users to see the "evolution trajectory" of two similar prompts side-by-side.

The comparison view visualizes the 'evolution trajectory' of two prompts, showing how specific keywords steer the image representation in latent space.

By showing how adding a single word like "Pixar" causes the image representation to veer toward a different cluster of features, the tool makes the abstract concept of "guidance" visible. This "Aha!" moment helps users build functional intuition about how prompt engineering works, bridging the gap between high-level views and low-level operations.

Evaluation and Impact

The tool was evaluated using a group of 56 non-experts recruited via Prolific, representing diverse fields like art, finance, and healthcare. The researchers conducted a within-subjects study comparing Diffusion Explainer to a top-ranked technical blog post.

  • Preference: 78.5% (44 out of 56) of participants preferred Diffusion Explainer over the traditional blog post.
  • Learning Gains: Participants scored significantly higher on understanding complex concepts after using the tool. For example, the understanding of "guidance scale" was rated 4.29/5 for the tool versus 2.91/5 for the blog post.
  • Real-World Reach: Since its launch, the tool has been accessed by over 10,300 users across 124 countries, proving a massive appetite for accessible AI education.

Limitations and Future Work

Because the tool relies on pre-computed data to remain accessible on low-power devices, users cannot currently enter their own custom prompts. The authors suggest that as WebGPU technology matures, future versions could support real-time, user-defined generation. Additionally, while the tool excels at explaining the process, it simplifies some of the deeper mathematical nuances of the UNet's internal layers to avoid overwhelming the user. Future work could expand the tool to explain more recent advancements like ControlNet or LoRA.

Summary updated

BibTeX
@inproceedings{lee2024diffusion,
  author = {Seongmin Lee and Benjamin Hoover and Hendrik Strobelt and Zijie J. Wang and Shengyun Peng and Austin P. Wright and Kevin Li and Haekyu Park and Haoyang Yang and Duen Horng Polo Chau},
  title = {{Diffusion Explainer: Visual Explanation for Text-to-image Stable Diffusion}},
  booktitle = {IEEE VIS},
  year = {2024},
  doi = {10.1109/vis55277.2024.00027},
}
Figure