Nodes/ComfyCollectorNodes/Latent Stats (CCN)
ComfyUI Node

Latent Stats (CCN)

What Is My Latent Actually Doing? Latent Stats (CCN) Prints the Receipt

By valkymaera·Created 4 months ago·Updated 10 days ago· 1
Latent Stats (CCN)
  • latent
  • latent
labelLatent

Latent Stats (CCN) does one thing: it looks at the latent flowing through it, prints a little report to your console, and passes the latent on completely untouched. Think of it as a voltage meter taped onto a wire. It changes nothing - you wire it inline, run, and read the numbers.

Why would you care? Because "my img2img came out weird" is most often actually "my latent distribution was off," and you can't debug what you can't see. This node tells you the shape, min, max, mean, and standard deviation of the latent tensor. Those five numbers answer real questions. Is your starting latent way outside the range the model expects? The min/max will show it. Is the distribution sitting lopsided, mean nowhere near zero? That's a signal before you ever click sample. Flow models especially - the whole architecture shift documented in the KB is about how current models sample differently than SDXL-era ones - will tolerate only so much upstream weirdness, and the stats give you a concrete number to compare against a known-good run.

It's also the perfect companion to the pack's other latent tinkering nodes. If you're about to hit Latent Scale (CCN) or Latent Normalize (CCN), put a Latent Stats on each side of the transformation and you can see exactly what the node did in mean and std terms, instead of eyeballing a preview and guessing. That's the workflow where this node stops being a toy.

The inputs are minimal:

  • latent - the LATENT you want to inspect.
  • label - a string that tags the report in the console. If you're monitoring three points in a graph, label them "before", "after", "hi_res" or whatever, because otherwise you're scrolling through identical blocks of numbers trying to remember which was which.

Output is a single latent, an exact pass-through of what came in. It does not clone or copy - same tensors, same dict, same everything. Zero side effects, which is the whole point of a probe node. It also forces a GPU sync when it reads .item() for the min/max, so it adds a small stall to your run; that's the price of information, and it's tiny compared to a sampling pass.

Install

It's part of ComfyCollectorNodes, so: ComfyUI Manager, search "ComfyCollectorNodes", install. Or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/valkymaera/ComfyCollectorNodes

Restart ComfyUI, look under ComfyCollectorNodes → Latent for "Latent Stats (CCN)". No extra dependencies - the pack ships on stock ComfyUI plus safetensors, which you already have. No model downloads, no license keys.

Common issues

The only real complaint people have is the one I flagged above: the numbers go to the console, not to a node in your graph. If you run ComfyUI as a service or with a hidden terminal, you'll see nothing. Run it in a window you can read, or wire the latent through anyway and check the log after the queue finishes. And keep the label honest - you will absolutely forget which "shape: [1, 16, 40, 40]" belonged to which branch. If you need to pipe the numbers somewhere programmatically, the pack's Inspect Tensor (CCN) is the sibling that digs into raw tensors more deeply; this one is the quick sanity check.

CategoryComfyCollectorNodes/Latent

Inputs (2)

NameTypeDefaultDescription
latentLATENT
labelSTRINGLatent

Outputs (1)

NameTypeDescription
latentLATENT