Nodes/ComfyUI-Info-Prompt-Toolkit/Image Batch Count Debug
ComfyUI Node

Image Batch Count Debug

Find out why your 'batch of 1' isn't

By kinorax·Created 5 months ago·Updated about a month ago· 2
Image Batch Count Debug
  • image
  • image
enabledtrue
label

Image Batch Count Debug is a pass-through node with a job that sounds too simple to be useful: it takes an image, logs the size of the batch to the ComfyUI console, and hands the image straight back. It exists because batch-size confusion is one of the most infuriating failure modes in ComfyUI - the one where your output count doesn't match what you asked for and nothing on screen explains why.

The problem it solves

Images in ComfyUI travel as tensors with a batch dimension, and any number of upstream nodes can silently change it. A mask loaded from a file, a Batch or list node, an image directory reader, a frame sequence - each can inflate or shuffle the batch in ways that aren't obvious from the graph. You set batch 4, get 12 outputs, and stare at the canvas. This node makes the invisible visible: whatever batch count is flowing through the socket at that exact point gets printed to the Python console, prefixed with an optional label so you can tell several probes apart.

The pass-through behavior is the point, not an afterthought. Because it just relays the image untouched, you can drop it anywhere in the chain without changing anything - probe the count before a node, after a node, and suddenly you know exactly where the batch changed.

Inputs and output

  • image - required, the payload you want to inspect (and pass through).
  • enabled - default true. Flip it to false and the node logs nothing, just relaying the image. Leave a probe in place, disable it when you're done, and never re-wire.
  • label - optional text prefix for the console line, so "after_sampler: 4" means something instead of a bare number.

Output is the same image, unchanged. That's the whole contract.

How to use it like someone who's done this before

Drop one right after a suspicious node, run the prompt, and read the ComfyUI console - the log line appears there, not in the UI. When the count is right, disable the probe rather than deleting it; it'll be there when the workflow changes and breaks again. The console-relay pattern is the same one this pack uses for its metadata debug node (Image Info Count Debug), so you can probe image batches on one side and image_info lists on the other with the same muscle memory.

One honest caveat: it reports the batch size, not the cause. You still have to bisect the graph to find where the batch changed - but knowing where it changed is 80% of the debugging, and that's what this node gives you cheaply.

Installing it

Ships in the ComfyUI-Info-Prompt-Toolkit pack. Via ComfyUI Manager - search "Info Prompt Toolkit" - or:

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. No model downloads. Small single-author pack (GPL-3.0), modest community footprint - but a debug node that does exactly one thing and disappears when you need it to is a better tool than most graph-visualization ideas.

CategoryInfo-Prompt-Toolkit/Debug

Inputs (3)

NameTypeDefaultDescription
imageIMAGEPass-through image payload
enabledBOOLEANtrueIf false, this node logs nothing and only relays image
labeloptSTRINGOptional prefix shown in console logs

Outputs (1)

NameTypeDescription
imageIMAGE