⚖️ Judge
ComfyUI's if statement, in one node
- any_a
- any_b
- result
The ⚖️ Judge is the brain of this pack. It compares two values, runs a condition, and spits out a single BOOLEAN - and that boolean is what lets the rest of your graph make decisions. Pair it with the Switch (condition in, one of two branches out) and you've built the ComfyUI equivalent of an if statement. On its own it's also just a handy "am I looking at the thing I think I'm looking at" checker.
The inputs are any_a (required), a condition dropdown, and any_b (optional). The output is one BOOLEAN named result. The condition list is where the power is, and it's worth reading the actual options because several of them don't even need any_b connected:
- Comparisons:
A == B,A != B,A > B,A < B,A >= B,A <= B - Membership:
A contains B - Self-checks:
A is empty,A is not empty,A is true,A is false - Length checks:
length == B,length > B,length < B
That last row is the sleeper feature. "Is this image bigger than 512 wide?" - you can't compare an IMAGE tensor with >, but length gives you the batch size of a tensor, the length of a list or string. The A is empty family is how you build fallback logic: an empty latent, a zero-length prompt, a None input all collapse to a single boolean you can route.
How it actually works matters for debugging. The source is a plain Python compare - a == b, a > b, and so on, with a safe len() wrapper and a contains check that tries b in a and falls back to string comparison. Two consequences: it's real Python semantics, so comparing an IMAGE to a FLOAT just... returns False (no crash, no explanation - if a Judge seems permanently "wrong," that's why); and any condition that throws returns False rather than an error. If A > B gives you False on things you'd swear are bigger, you're comparing types that can't be compared, and the answer you get is the Python answer: False. For the length conditions, B is cast to int, so a FLOAT B like 2.7 becomes 2.
One more thing that trips people: the node recolors itself green when the result is true and red when it's false, so you can debug a chain of Judges by eye. And because the whole pack uses the IS_CHANGED → float("NaN") trick, the Judge re-evaluates every run - your conditions respond to live values instead of stale cache.
It's a genuinely useful utility, but set expectations: this is a comparison node, not a logic solver. "Check which image is brighter" or "does this prompt mention the sky" is beyond it - you'd want a real analysis node upstream (an image analyzer, a CLIP-based classifier) feeding it a number, then Judge does the > or == part. Use Judge for the plumbing comparisons and let specialist nodes do the measuring.
Install is pack-wide: ComfyUI Manager, search "ComfyUI-Logic-nodes", or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/playboy-dongan/ComfyUI-Logic-nodes
Restart and you'll find it under ⚡ Logic. No models, no dependencies. The README shows a slightly different clone URL; if it 404s, the -nodes one above is the real repo.
If you're building an automation-heavy graph, Judge + Switch + Blocker is the trio you'll reach for every single time.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| any_a | * | — | |
| condition | COMBO | A == B | 14 options: A == B, A != B, A > B, A < B, A >= B, A <= B, +8 |
| any_bopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| result | BOOLEAN | — |