Nodes/comfyui_color_detection/Detect Yellowish Image
ComfyUI Node

Detect Yellowish Image

Is Your Render Jaundiced? A Two-Second Yellow-Cast Check

By purewater2011·Created about a year ago·Updated about a year ago· 1
Detect Yellowish Image
  • image
  • is_yellowish
  • yellow_percentage
  • b_channel_mean
  • result_text
threshold140.0

You know the feeling: a portrait renders and the skin looks like it's been on a nicotine patch, or you swapped a VAE and the whole frame went sickly warm. Squinting at two images side by side and deciding "hmm, that one's a bit yellow" is not a workflow. IsYellowish gives you an actual number. It's a tiny, pure-computation node from the comfyui_color_detection pack that answers one question - is this image yellow-tinted? - in a few milliseconds on CPU.

It's not going to blow anyone's mind, and the author clearly made it for their own skin-tone and color-review pipeline, but it slots neatly into a ComfyUI graph as a QA step: run it on your output, and either log the verdict or let the boolean decide which branch your workflow takes next.

How it works

The node doesn't use a model and doesn't call anything - no API, no key, no downloaded weights. It's plain OpenCV color science. The image gets converted from ComfyUI's RGB tensor to BGR, then into the LAB color space. That's the smart part: LAB was designed so that its b channel is literally the blue→yellow axis, centered on a neutral 128. Above 128 means yellower, below means bluer. So "how yellow is this" becomes "what's the mean of the b channel," which is a one-liner and, honestly, the right way to do it.

From there it computes three things: the mean b value across the whole image, the percentage of pixels whose b exceeds your threshold, and a boolean for whether the mean crosses it.

The inputs and outputs that matter

Only two inputs, and you'll mostly touch one:

  • image - a standard ComfyUI IMAGE.
  • threshold (default 140, min 128, max 160) - "how yellow is yellow." Since neutral LAB b is 128, the author clamped the floor at 128 so you can't declare everything yellow. The default of 140 sits just above neutral, which is sensitive - it'll flag subtle casts. Push it toward 160 to only catch seriously warm images, or drop it near 128 to hunt for the faintest tint.

Outputs, in order:

  • is_yellowish (BOOLEAN) - wire this into a switch/condition node to auto-route: yellow → run a color-fix node, clean → straight to save.
  • yellow_percentage (FLOAT) - fraction of pixels above threshold; 0.0–1.0. More informative than the mean, because it tells you how much of the frame is affected, not just the average.
  • b_channel_mean (FLOAT) - the raw mean b value. Above ~128 = a warm cast overall.
  • result_text (STRING) - a ready-made summary. Two notes: it comes back in Chinese (the author's language), and it's built for a text/display node, not machine-parsing - if you want the numbers downstream, read the FLOAT outputs, not this string.

Install

Via ComfyUI Manager, search "Yellow Detection" and hit install, or do it manually:

cd ComfyUI/custom_nodes/
git clone https://github.com/purewater2011/comfyui_color_detection

Then restart ComfyUI. That's it - there are no model files to download. The pack's requirements.txt asks for opencv-python, numpy, and pillow. You almost certainly already have all three (ComfyUI ships numpy and pillow, and opencv shows up in a hundred other packs), but the declaration is why the install step is over in one restart.

Where people get burned

  • It's a single-image node. The code squeezes the tensor down before running cv2 - feed it a batch and it'll misbehave. If you're analyzing a folder of outputs, iterate over the batch and feed frames one at a time.
  • The mean is global, so it can lie. A big cool-blue background will drag the average down and mask a genuinely yellow face in the center. That's what yellow_percentage is for - trust the per-pixel count over the mean when the frame has mixed content.
  • This is a heuristic, not a colorimeter. Threshold 140 vs 150 is "how strict do you feel," not a calibrated measurement. Tune it against images you've eyeballed and call it a day.
Categoryimage/analysis

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
thresholdFLOAT140.0128–160

Outputs (4)

NameTypeDescription
is_yellowishBOOLEAN
yellow_percentageFLOAT
b_channel_meanFLOAT
result_textSTRING