#431 · Primary category: Computer Vision

daam

diffusion explainable-ai generative-ai huggingface pytorch stable-diffusion

Diffusion attentive attribution maps for interpreting Stable Diffusion.

Project last updated:04/05/24

GitHub Stars

802

Forks

70

Contributors

9

License

MIT

Why we included this project

Stable Diffusion is something of a black box: you type a prompt, get an image, and usually can't say why a particular region of the picture came out the way it did. DAAM opens that box. It reads the cross-attention layers of a diffusion pipeline and, for each word in your prompt, produces a heat map showing where that concept actually landed in the generated image. That turns prompt debugging from guesswork into something you can look at directly, and it's a reasonable way to check whether a model is attending to the right regions before you trust its output. You can use it as a small CLI that drops per-word heat maps next to your generated image, or as a Python library wrapped around any Diffusers pipeline, with SDXL support included. For researchers and teams doing interpretability work on generative vision models, it's a solid, documented starting point.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category