Latent Batch Count Debug
Find Out What's Actually In Your Latent Before You Blame the Sampler
- latent
- latent
Latents are opaque. The thing on the wire labeled LATENT is actually a Python dict wrapping a tensor, and when a workflow goes wrong - you expected 16 frames and got 1, or the sampler started interpolating between the wrong images - you usually can't tell by looking. IPT-LatentBatchCountDebug is a pass-through inspection node that prints what's inside the latent to the ComfyUI console, right where the error happened.
It exists because "why does my batch have the wrong size" is one of the most common debugging sessions in this ecosystem, and the standard answer is to add print statements nobody has time to write. This is the packaged version.
How it works
Wire a latent into it and it relays it straight through untouched, so you can drop it anywhere in a chain without changing behavior. On each execution it prints a summary to the Python console: how many entries are in the latent dict, how many of those are dicts, how many are None, how many are non-dicts, and crucially whether the samples tensor is present and what its shape is. The label input is a prefix for the log line - give each debug node a name like "latent_after_ksampler" and you can tell them apart when you've got several in one graph. enabled flips the whole thing off without disconnecting it.
Inputs and outputs
latent(required, LATENT) - pass-through payload.label(optional, STRING) - prefix shown in console logs, so you know which node printed what.enabled(BOOLEAN, default true) - set false to make the node a silent relay.
Output is the same latent, unchanged.
Installing it
Part of the kinorax/comfyui-info-prompt-toolkit pack:
cd ComfyUI/custom_nodes
git clone https://github.com/kinorax/comfyui-info-prompt-toolkit.git
cd comfyui-info-prompt-toolkit
pip install -r requirements.txt
Restart ComfyUI (or use ComfyUI Manager → "ComfyUI-Info-Prompt-Toolkit"). ComfyUI 0.17.0+. No models, no heavy deps.
Where it saves you
Read the log where you'd expect samples and check the tensor shape's batch dimension. If you're doing video work or batching, a samples_missing or an unexpected batch count tells you immediately whether the problem is upstream (list-to-batch conversion, a node that collapses batches) or downstream (a node that assumes a single image). One thing to note: the output goes to the ComfyUI Python console (the terminal you launched from), not the in-browser node output panel - so keep an eye on that window, or you'll think the node is silently doing nothing. It's not; you're just looking in the wrong place.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | Pass-through latent payload | |
| enabled | BOOLEAN | true | If false, this node logs nothing and only relays latent |
| labelopt | STRING | Optional prefix shown in console logs |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |