Is Image Empty
Is Image Empty is really a black-frame detector — and that's the useful part
- image
- is_empty
"Is Image Empty" sounds like a sanity check for "did I get an image at all?" It isn't. Read the source and you'll find it does exactly one thing: returns True if every single pixel in the image is exactly zero - i.e. the image is a solid black frame. That's a much narrower job than the name implies, and honestly a more useful one.
Why you'd reach for it
Failure detection. When a generation pass produces nothing - an inpaint that denoised to black, an upscaler that returned a blank, a bad batch item - ComfyUI doesn't raise an error. It just hands you a black tensor and moves on. Feed that output through Is Image Empty, wire the boolean into any of the ubiquitous boolean/any switch nodes, and you can route around the failure: re-run with a new seed, fall back to a different model, or just skip the broken branch. It's the "did this actually produce output" gate that the stock graph doesn't give you.
How it works
The node runs torch.all(image == 0.0) over the whole tensor. One nonzero pixel anywhere and it's False. It doesn't look at content, brightness, or batch size - pure "is everything zero." The source comments mention CHW layout, but the check is shape-agnostic, so you don't need to worry about channel order.
Inputs and outputs
One required input, image (IMAGE). One output, is_empty (BOOLEAN). That's the whole node. Wire the boolean into a switch that takes a boolean on its select input and you're branching your workflow on whether generation succeeded.
The trap
A near-black image is not empty. If your pipeline produces something dim but not literally zero - a vignette, a dark-but-present frame, a whisper of noise - this returns False even though it's visually nothing. And the reverse also holds: an intentionally solid-black image reads as empty. It's a binary, literal check, not a "perceptually empty" one. If you need a luminance threshold, this isn't your node; you'd want an image-stats node that reports mean brightness.
Install
It ships in the tiny ComfyUI_Accessories pack - six nodes, one Python file, zero dependencies. ComfyUI Manager → Install Custom Nodes → search "ComfyUI_Accessories", or:
cd ComfyUI/custom_nodes && git clone https://github.com/var1ableX/ComfyUI_Accessories
then restart. No models to download, no requirements.txt to fight.
Common issues
As of this writing the GitHub head is in a broken state: __init__.py still imports GetRandomDimensions, which was deleted in the latest commit, so the whole pack throws an ImportError and none of these nodes appear. If you install and see a load error, check the repo for a fix - or patch it yourself, which is a one-line job: in __init__.py, drop GetRandomDimensions from the import and from NODE_CLASS_MAPPINGS. And mind the semantics: "empty" means all-black, not "nothing connected." An unconnected input isn't a valid IMAGE, and ComfyUI will refuse to run the node rather than treating it as empty.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| is_empty | BOOLEAN | — |