DAAM Preview Image (Beta)
Hover Over Your Image to See What Each Pixel Was Listening To
- clip
- tokens
- heatmaps
- images
The party piece of the ComfyUI-DAAM pack, added in version 0.5.0 and honestly labeled Beta. Where DAAMAnalyzer answers "where did this word land?" by painting a heatmap over the image, this node answers the reverse question - "which prompt words are doing the work here?" - with your cursor. Hover over any region of the generated image and a tooltip pops up listing the top attention words for that spot, ranked by attention score.
It's the demo that makes people say "oh, that's what attention is." And because it's an output node, it's also the easiest way to end a DAAM workflow: wire in your data and you're done, no save-node gymnastics.
How it works
Same inputs as the analyzer - clip, tokens (from CLIPTextEncodeWithTokens), heatmaps (from KSamplerDAAM), images - plus one unique one: top_tokens, an integer from 1 to 10 (default 5) that sets how many words the tooltip shows. Give it more headroom if your prompt is busy; the tooltip gets crowded fast.
Under the hood it does something clever: instead of computing one overlay, it works out, for every pixel, which token indices scored highest in the raw attention maps, and saves that top-k map as a .npy file next to the image in ComfyUI's temp folder. The pack ships its own JavaScript frontend (via ComfyUI's WEB_DIRECTORY) that hooks the preview image - when you hover, the JS reads the npy, decodes the token ids back to words using the tokenizer, and renders the tooltip. All quite slick, and it's why the node has no tensor outputs: it displays in the graph and dumps to temp, end of chain.
What to watch for
- It must be the terminal node. As an output node it returns nothing, so nothing can come after it in that branch.
- Restart after installing. The hover behavior lives in the JS frontend. If you install the pack and hover does nothing, you didn't actually reload ComfyUI's frontend.
- Fresh data only. The
imagesandheatmapsinputs have to come from the sameKSamplerDAAMpass, and the tokens from the same encode that produced the conditioning - mismatched inputs give you tooltips that describe a different prompt than the one on screen. - The image is saved to the temp folder, not your output directory, so don't expect a permanent copy. Save via a normal Save Image node upstream if you want the artifact.
Install
Same single step as the rest of the pack - ComfyUI Manager (search ComfyUI-DAAM), or:
cd ComfyUI/custom_nodes
git clone https://github.com/nisaruj/comfyui-daam.git
cd comfyui-daam
python3 -s -m pip install -r requirements.txt
Restart ComfyUI, then find it under daam-nodes. Only dependency is matplotlib; no models to fetch. One honest caveat: it's a UX convenience, not analysis. If you need the actual attribution image to keep or share, use DAAMAnalyzer and save its output. This one is for poking at a render and actually understanding why the model put the hat where it did.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| tokens | TOKENS | — | |
| heatmaps | HEATMAP | — | |
| images | IMAGE | — | |
| top_tokens | INT | 51–10 | The number of top tokens that will be displayed. |
Outputs (0)
No outputs