Show Heatmaps (Output)
Attention, rendered right in the graph
- matrices
Some things you want to pipe into other nodes, and some things you just want to see. CdlShowHeatmaps (Output) is the see-it version - the output-node variant of ComfyDL's heatmap visualizer that renders your matrix tensors directly in the ComfyUI interface, with a colorbar, no Preview node required. It's the same engine as Show Heatmaps minus the IMAGE output; the figure goes to your screen instead of a socket.
ComfyDL borrows the "dual variant" design from the d2l toolbox it ports: every visualization has an (Output) twin for when the goal is eyeballing, and a plain twin for when the chart is data. This one is the eyeballing twin for heatmaps - and if you're doing anything with attention weights or weight matrices in this pack, it's the node that makes them legible.
The inputs
matrices- a cdlTensor, auto-promoted to 4-D like its sibling:- 2-D
[H, W]→ one heatmap - 3-D
[N, H, W]→ a row of N - 4-D
[N, M, H, W]→ an N×M grid
- 2-D
xlabel,ylabel- axis labels.figsize_w/figsize_h- per-cell size (default 2.5 each); the whole figure scales asw*cols × h*rows.cmap- matplotlib colormap, default"Reds".titles- comma-separated subplot titles (optional).
It's an output node, so there are no outputs - the render is the result.
Installing ComfyDL
The pack's standard light install:
cd ComfyUI/custom_nodes
git clone https://github.com/Cynthia-lxx/ComfyDL
cd ComfyDL && pip install -r requirements.txt
Restart ComfyUI; it's under ComfyDL → Visualization with its display name "Show Heatmaps (Output)". Or search "ComfyDL" in ComfyUI Manager. Only dependency is matplotlib.
The important differences from the plain version
Because it's an output node, ComfyUI treats it as a terminal: it always runs, and its result shows inline. That's genuinely useful for debugging attention during a run - but it also means it sits at the end of the chain. If you want the same heatmap and to keep using the image downstream, you'd wire the plain Show Heatmaps into a Preview instead; the two variants are mutually exclusive in purpose, not interchangeable.
A practical note: output nodes that always run can keep their upstream alive in ways you might not expect while you're rearranging a graph. If you're surprised that a whole branch keeps executing when you thought you'd bypassed it, check whether an (Output) node is anchoring it - that's the caching behavior, not a bug.
The shape trap
Same one as the sibling: 4-D is read as [N, M, H, W] - rows, then columns. If you feed a transposed or differently-ordered tensor, the grid renders beautifully and completely wrong. And the auto-promotion is additive (a 2-D becomes [1, 1, H, W]), so extra pre-added dims aren't ignored. When in doubt, check the input's actual shape with the pack's tensor-inspection node before rendering.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| matrices | TENSOR | — | |
| xlabel | STRING | — | |
| ylabel | STRING | — | |
| figsize_w | FLOAT | 2.50.5–20 | — |
| figsize_h | FLOAT | 2.50.5–20 | — |
| cmap | STRING | Reds | — |
| titlesopt | STRING | — | |
| max_samplesopt | INT | 2621440–1073741824 | — |
| dimsopt | STRING | auto | — |
| axis_reduceopt | COMBO | mean | 4 options: mean, max, first, mid |
| auto_selectopt | COMBO | last_n | 4 options: first_n, last_n, most_informative_n, least_informative_n |
| auto_nopt | INT | 00–3 | — |
| on_erroropt | COMBO | fallback_first_n | 2 options: error, fallback_first_n |
Outputs (0)
No outputs