Image Type Detector
Find out whether your IMAGE is a batch or a single frame, and get both
- image
- single_image
- batch_images
- batch_count
- is_single
Image Type Detector answers a question ComfyUI makes surprisingly easy to lose track of: is this tensor a single image or a batch? It looks at the batch dimension and hands you the answer four different ways - the first frame, the full batch, the count, and a boolean telling you which case you're in. It's a diagnostic and a routing primitive rolled into one, and if you've ever built a workflow that needs to behave differently for one image versus many, you already know why that matters.
The mechanism is completely transparent: it checks the tensor's shape, and its four outputs are all derived from that single number. single_image is always the first frame as a [1, H, W, C] tensor - valid whether the input was a batch or not. batch_images is the full input, unchanged. batch_count is the integer frame count. is_single is a boolean, true only when the batch size is exactly 1. Because single_image and batch_images are both always valid, you can wire either downstream without knowing the input shape in advance - which is the node's real trick: it never fails, it just tells you what you have.
Where you'd actually use it: routing. Imagine a node graph that takes either a single reference photo or a folder of them - with this node, you can read is_single and switch paths, or read batch_count to decide how many iterations a loop needs. It's also a legit debugging tool: stick it in a workflow that's misbehaving, read the count, and you instantly know whether your "single image" was secretly a 12-frame batch all along. That kind of thing has saved more than one confused afternoon.
The honest caveat is that it's a niche utility with zero computation. If you're comfortable reading tensor shapes or you already have a batch-count node from another pack, this is redundant - and there are plenty of those floating around. But if you want a self-documenting node that always outputs valid data in both the single and batch cases, this one is cleanly designed for exactly that, and its "always succeeds" contract is genuinely nice in a workflow you plan to hand to other people.
There's nothing to misconfigure - one image input, no parameters. Install is the pack standard: ComfyUI Manager → search "AnotherUtils", or cd ComfyUI/custom_nodes && git clone https://github.com/marcoc2/ComfyUI-AnotherUtils, then restart. No dependencies beyond torch, which is already ComfyUI.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| single_image | IMAGE | — |
| batch_images | IMAGE | — |
| batch_count | INT | — |
| is_single | BOOLEAN | — |