Nodes/ComfyUI Model Bending/Read Activation Probe
ComfyUI Node

Read Activation Probe

Heat maps and a JSON report of what your model just did

By abuzreq·Created 2 years ago·Updated 11 days ago· 26
Read Activation Probe
  • probe
  • latent
  • reference
  • activations
  • heatmap
  • report
◄statstd►
◄alert_ratio10.0►

Every probe is a recording with no reader until you add this node. Read Activation Probe takes the recording, draws you a picture of it, writes you a JSON report, and passes the raw numbers on so something else can use them.

Think of it as the oscilloscope end of the probe cable. Activation Probe sits inside the model; this is where you look.

What you get

Three outputs, and you'll want all of them eventually:

  • activations - the snapshot itself, in the form Steering Vector (from Activations) wants. This is the output that makes the steer-from-two-prompts workflow possible.
  • heatmap - an IMAGE: rows are the probed sites in model order (top to bottom, so it reads in the order the data flows), columns are denoising steps. Take it to Preview Image or a Save node.
  • report - a JSON string. Wire it to Show Text or Preview Any. It's structured, not prose.

The heat map is deliberately small - a labelled grid, a couple of hundred pixels tall per site, with a legend. Don't try to upscale it into a poster; it's a diagnostic, and the values are printed into the cells when there's room.

Inputs that matter

  • probe - from an Activation Probe node.
  • latent - the tooltip says it straight: connect the output of the sampler that used the probed model, so this node runs after sampling. It's a sequencing device. Without it, ComfyUI would happily evaluate the reader before the run had happened.
  • stat - which number to plot: std, rms, mean, absmax or dead_frac. std is the "where is the energy" view and the sensible default. dead_frac is the "is this layer even alive" view.
  • alert_ratio - default 10. Any step where std differs from the reference by this factor (either direction) becomes an alert.
  • reference - optional ACTIVATIONS from an unbent run's reader. This changes everything: the map switches to log2 of bent ÷ reference, centred colour scale, red = bigger, blue = smaller, with the numbers shown as ×2, ×8 and so on. Cells where the activation went non-finite are painted magenta and labelled NaN.

How it works

Without a reference the heat map is log10(|value|) over the whole grid, viridis, absolute. With one, it's log2(bent / reference) clamped to ±3, which is a three-stop range either way - ×8 up or ÷8 down fills the scale. The reference is resampled to your run's step count by position, so the two runs don't have to use the same number of steps (useful when you compare a 20-step run against a 30-step one).

The report is where the details live. Per site it gives you the chosen stat at the first step, the last step and its max, plus std ratios against the reference. Then a list of alerts: nonfinite when a step produced NaN or Inf, dead_channels when more than half the channels of that site are flat, and blowup / collapse when the std ratio crosses your alert_ratio in either direction.

That alert list is genuinely the best thing here. "My bend exploded the middle block at step 3" is not something you can see by eyeballing the image.

Install

Manager → "ComfyUI Model Bending", or:

cd ComfyUI/custom_nodes
git clone https://github.com/abuzreq/ComfyUI-Model-Bending
pip install -r ComfyUI-Model-Bending/requirements.txt

Dependencies are kornia and scikit-learn. Restart ComfyUI afterwards; custom nodes don't appear until it restarts, and the console messages all carry a [model-bending] prefix.

Where people get burned

  • Reading before the sampler runs. Same error as the probe's: the node refuses with a message telling you to wire the capture's latent input to the sampler's output. If you see it, your wiring is wrong, not your settings.
  • Forgetting the reference and reading absolute numbers as ratios. Absolute values tell you which layers carry energy at which step. They do not tell you whether your bend changed anything - that needs the reference wire.
  • Comparing runs that differ in more than the bend. Activations scale with the latent shape, so matching resolution, model and prompt matters. Different seeds are fine; different checkpoints are not.
  • Expecting the heat map to be a picture of your image. It isn't. It's a per-site, per-step table rendered as colour. The feature maps are a different node in this pack entirely.
Categorymodel_bending/probe

Inputs (5)

NameTypeDefaultDescription
probePROBE—
latentLATENTConnect the output of the sampler that used the probed model, so this node runs after sampling
statCOMBOstd5 options: std, rms, mean, absmax, dead_frac
alert_ratioFLOAT10.01–1000Alert when std differs from the reference by this factor
referenceoptACTIVATIONSActivations of an unbent run: shows bent / unbent ratios

Outputs (3)

NameTypeDescription
activationsACTIVATIONS—
heatmapIMAGE—
reportSTRING—