Is Empty
The test that makes an optional branch actually optional
- any_input
- is_empty
Optional inputs are ComfyUI's nicest feature until you need to make a decision based on one. Is Empty turns "is anything plugged in here, and does it say anything" into a boolean you can route on.
What it's for
Say your workflow has an optional prompt add-on - a style string that some runs need and most don't. You want a single graph that handles both cases: with the string, append it and tag the metadata; without it, skip both. ComfyUI will happily run with the input unconnected, but the decision has to happen somewhere, and that somewhere is a boolean.
Or say you have three optional branches - an inpaint patch, a ControlNet patch, a refiner - and one downstream consumer. The fallback-switch pattern handles that: whichever branch is live wins. But the branch needs to announce whether it's live, and "did the user wire anything into this slot" is exactly the question this node answers.
It's the detector for the plumbing layer. Wire a value in, get True or False out, feed that into a switch or into Set Value (Global) for use elsewhere on the canvas.
How it works
One optional input, any_input, typed * - the wildcard, so it accepts an image, a latent, a string, a model, anything. Because it's optional, leaving it disconnected is legal and arrives as None.
The logic is three checks, straight from the source:
- If the input is
None- disconnected - outputTrue. - If the input is a string that is blank once you strip whitespace, output
True. - Otherwise, output
False.
The single output is is_empty, a BOOLEAN. The author's tooltip spells out the contract: "True if the input is empty/None, False otherwise."
That second check is the useful one and also the one to understand precisely: a text box containing a single space, or a newline, counts as empty. That's usually what you want - a prompt of " " should not be treated as content - but it means the test is string-aware rather than byte-count-aware.
Installing it
ComfyUI-MDSNodes by MarwanDSAI. ComfyUI Manager: search ComfyUI-MDSNodes or MDSNodes, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/MarwanDSAI/comfyui-mdsnodes
# restart ComfyUI
No pip installs, no model downloads - the repo's requirements.txt is empty and the README says the pack runs on stock ComfyUI dependencies.
Search Is Empty, category MDSNodes/logic, next to the float and string switches that will consume its output.
Common issues
It says False when you expected True. Look at what's actually wired in. A CLIP Text Encode output is a CONDITIONING object, not a string - a conditioning built from an empty prompt is still a non-empty object, so False is correct and unhelpful. Run your emptiness test on the text, before encoding, not on the conditioning after.
It says True on every run, whatever you do. If nothing is wired to any_input, it's None and stays None. It's an optional socket, so the graph won't complain - the node just does its job quietly and reports empty. That silent-empty behaviour is the top cause of "my branch never fires."
A whole tensor of zeros came back False. Deliberate: the node checks for None and for blank strings, not for content. An all-zero latent or a black image is data as far as it's concerned. If your real question is "did the model produce anything," this isn't the node.
Missing from the node list. Shipped in pack version 1.8.0 (September 2026). Update in Manager and restart - node registration only happens at server start.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| any_inputopt | * | The input to evaluate. If disconnected or an empty string, the node outputs True. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| is_empty | BOOLEAN | True if the input is empty/None, False otherwise. |