ComfyUI custom nodes for Diffusion Attentive Attribution Maps (DAAM)
This extension enables visualization of cross-attention heatmaps within Stable Diffusion models, showing exactly which parts of the image correspond to specific words in the prompt — good for analyzing and debugging model outputs and LoRA training.
👉 Example workflows are available in workflows.
This project was adapted from the SD Web UI implementation. Special thanks to @kousw for the original work!
- ✅ Positive / Negative prompt heatmap visualization
- ✅ SDXL, SD1.5, SD3 support
- ✅ Flux Dev support (Beta)
Now Available on Comfy Registry and Custom Node Manager!
Clone this repo into your ComfyUI custom_nodes
directory:
git clone https://github.com/nisaruj/comfyui-daam.git
Then install the required packages
cd comfyui-daam
python3 -s -m pip install -r requirements.txt
Restart ComfyUI.
Identical to CLIPTextEncode
but also outputs the tokenized prompt required for the analysis.
A hooked version of KSampler
. During sampling, it records attention maps for later analysis.
Outputs:
latent
— standard latent outputpos_heatmaps
— positive prompt's raw heatmaps for input into the analyzerneg_heatmaps
— negative prompt's raw heatmaps for input into the analyzer
This node generates overlay heatmaps that show which parts of the image correspond to selected words in the prompt.
Inputs:
clip
— CLIP model used to encode the attention texttokens
— fromCLIPTextEncodeWithTokens
heatmaps
— fromKSamplerDAAM
images
— the output images to overlay the heatmaps- A text box for comma-separated words to generate heatmaps
Output:
- A batch of images with word-level heatmaps overlaid
Prompt: A photo of corgi with a cowboy hat riding a skateboard in the park
Attention words: corgi,skateboard,hat,park
-
0.4.0
- Flux and SD3 initial support
- Code Refactor and Minor bug fixes
-
0.3.0
- Negative prompt support
- Code Refactor and Minor bug fixes
-
0.2.0
- Added support for batched inputs
- SD 1.5 models compatibility
- Bug fixes and stability improvements
-
0.1.1
- Initial Version with SDXL support