Light or Dark
A color-difference switch that picks your render for you
- image1
- image2
- IMAGE
- brightness
- contrast
- saturation
- color diff
"Light or Dark" sounds like it should be about exposure. It isn't. It's a comparator dressed up as a switcher: feed it two images, it measures the average color difference between them in CIELAB space, and if that difference clears your threshold it hands you image 2 - otherwise you get image 1. Along with the winning image it also emits that side's brightness, contrast, and saturation as numbers, and those float outputs are the actual point. You can make the rest of your graph react to the comparison instead of eyeballing it.
It ships in Cyber-BlackCat's ComfyUI-MoneyMaker pack, also branded "ComfyUI-Yuan," a grab-bag of image and mask utilities from a solo author. Everything in the pack is pure tensor math - no models, no API keys, no VRAM beyond what's already in your graph. Fun fact about the name: yuan is Chinese currency, and the README's pitch is that these nodes will "make you earn some real money." Take that with the same salt as most marketing, but the nodes are real.
How it works
Both images get converted to CIELAB via scikit-image, a mask is built from the non-transparent pixels, and the node computes a per-pixel distance in that color space, averaged over the pixels that actually differ. That average is compared against threshold (default 32). Under the threshold, the images are judged close enough and image 1 wins; otherwise image 2 takes it. If the shapes don't match, image 2 is bilinearly resized to image 1 first. The winner is clamped to 0–1 and returned, and the measured difference is printed to your console on every run.
The inputs that matter
image1/image2- the two candidates. Which is "the reference" is up to you; it only matters how far apart they are.threshold- the trip point. 32 in Lab-ish distance units is a fairly generous "different" bar. Drop toward 5–15 if you want it to flip on subtle changes.brightness1/contrast1/saturation1and the...2triplet - two full parameter sets, one per image, each in the 0–3 range with 1 as neutral. Only the winning side's values ever come out.
Outputs and where they go
IMAGE- whichever image won.brightness,contrast,saturation- the winner's values as floats.color diff- the measured difference, mostly a debugging meter.
Here's the trick that makes it worth installing: wire the float outputs into nodes that take numeric widgets and you get deterministic branching in a graph. Two different strengths in, one picked at runtime, no scripting, no conditional routing through the Python you don't want to write. That's the only real reason to prefer this over a plain blend node.
Honest take: it's niche. For most of us, comparing two renders by eye is faster and less mystifying. And the hard-switch behavior - one image or the other, no lerp - is a feature for automation but a limitation for creative mixing. Reach for it when you want a reproducible "pick" baked into the workflow, not when you're judging aesthetics.
Install
Same for every node in this pack. Easiest is ComfyUI Manager - search "MoneyMaker" (pack title "ComfyUI-Yuan") and install. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Cyber-BlackCat/ComfyUI-MoneyMaker
Then restart ComfyUI. requirements.txt lists torch, torchvision, numpy, pillow, opencv-python, and scikit-image - most are already in any working ComfyUI install; scikit-image is the one that might be missing, and Manager or pip install -r requirements.txt in your ComfyUI environment handles it. No model files to download anywhere in this pack.
Gotchas
The comparison runs on the first image of the batch, so batched inputs won't each get their own judgment. It prints a Color Difference in Difference Area: line to the console every single run - harmless, but it'll fill your log if you let it. And don't expect smoothness: this is a switch, not a fade, so the output jumps between the two candidates rather than blending.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| image1 | IMAGE | — | |
| image2 | IMAGE | — | |
| threshold | FLOAT | 32.000.1–100 | — |
| brightness1 | FLOAT | 1.000–3 | — |
| contrast1 | FLOAT | 1.000–3 | — |
| saturation1 | FLOAT | 1.000–3 | — |
| brightness2 | FLOAT | 1.000–3 | — |
| contrast2 | FLOAT | 1.000–3 | — |
| saturation2 | FLOAT | 1.000–3 | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| brightness | FLOAT | — |
| contrast | FLOAT | — |
| saturation | FLOAT | — |
| color diff | FLOAT | — |