Nodes/bsz-cui-extras/BSZ Latent Debug
ComfyUI Node

BSZ Latent Debug

What's actually inside your latent?

By Beinsezii·Created 3 years ago·Updated 2 years ago· 27
BSZ Latent Debug
  • latent

    BSZ Latent Debug is a diagnostic node: it prints a report about a latent tensor to the console and produces nothing visible. No outputs, no preview - if your latent manipulation is coming out wrong, this is the node that tells you why, by showing you the numbers inside.

    Why you'd reach for it

    Latent manipulation is opaque. You drag sliders, decode, and the result is... something. When it's wrong, you can't see the intermediate state - there's no "inspect latent" button in stock ComfyUI. This node dumps the latent's structure and per-channel statistics to the terminal so you can check whether your manipulation did what you think it did. It's the debugging companion for the rest of this pack's latent nodes, especially BSZ Latent Fill and the pixelbuster/latentbuster code nodes.

    What it prints

    Give it a latent input and it logs to stdout (the console you launched ComfyUI from - check there, not the UI):

    • the full latent dict structure,
    • the sample size (batch × channels × height × width),
    • and for the first batch entry, per channel: min, max, and average value.

    The min/max/avg per channel is the useful part. If you filled a channel with a = 50 and the printout shows max 50 but an average nowhere near 50, you've learned something about how the data is laid out. If a manipulation produced a max that explodes past a channel's natural range, you've found your artifact.

    Inputs and outputs

    • Input: latent (required).
    • Outputs: none. This is an output node - it exists only for its side effect. Don't wire anything out of it.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/Beinsezii/bsz-cui-extras
    

    restart, or install via ComfyUI Manager. Pure Python, no dependencies.

    Notes

    Two things to remember. First: the terminal, not the UI. People run this node, see nothing on the canvas, and assume it's broken - it's not, the report went to the console. Second: it reports on the first batch item only, so it's a spot-check, not a full audit. And a tip from running this kind of tool: put it before and after a manipulation node and diff the channel stats - that tells you in one run whether the node you're testing actually moved the channels you expected it to.

    Categorybeinsezii/latent/advanced

    Inputs (1)

    NameTypeDefaultDescription
    latentLATENT

    Outputs (0)

    No outputs