Nodes/imgutils/Imgutils Score Threshold
ComfyUI Node

Imgutils Score Threshold

A tiny boolean gate for workflow branching

By xiaden·Created 2 months ago·Updated 2 months ago· 0
Imgutils Score Threshold
    • boolean
    score0.50
    threshold0.50

    This is the least glamorous node in the imgutils pack and one of the handiest. Imgutils Score Threshold does exactly one thing: takes a score, compares it to a threshold, and outputs a BOOLEAN - True if score >= threshold. That's it. No model, no pixels, no download. It exists to be the hinge in an automated workflow.

    The two inputs are both floats from 0 to 1 (defaults 0.5 each): score and threshold. The single output is the boolean. You wire score from any node in the pack that emits one - Imgutils Metric's sharpness score, Imgutils Check, Imgutils Classify, even the LPIPS/CCIP compare distances - and the boolean feeds anything that takes a boolean: a switch node that routes between two branches, a conditioning set selector, or just a visual marker so you can see at a glance whether a batch item passed the bar.

    What you'd actually use it for

    The pattern that makes this worth having: quality gating in batch. Metric's Laplacian score → Score Threshold with threshold at 100 (matching Metric's "sharp vs blurry" cutoff) → route the boolean into a switch. Blurry generations get skipped or rerouted to a re-roll branch; sharp ones proceed to upscaling. Same shape works with tagger confidence - keep only images where a character tag clears a confidence bar - or with compare distances: "if the edit pass changed this image by less than X, don't bother saving a duplicate."

    Because it's pure comparison, it costs nothing to run and works offline. It's the kind of node you'd think you don't need until you've hand-sorted one too many hundred-image batches.

    Install

    It's part of the xiaden/comfyui-imgutils pack:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/xiaden/comfyui-imgutils.git
    cd comfyui-imgutils
    pip install -r requirements.txt
    

    Restart ComfyUI. The pack needs ComfyUI 0.25.0+ (it's built on the newer V3 node API) - this node in particular has no extra dependencies and no model downloads, so it's the one you can count on working even while the taggers are still pulling their weights on first run.

    One small gotcha: the inputs are clamped to the 0–1 range, and both default to 0.5. If you're comparing a sharpness score that naturally runs in the hundreds (Metric's Laplacian mode does exactly that), you can't type 100 into this node's threshold - the widget caps at 1. The fix is to wire score/threshold as converted inputs from a Primitive float node, which bypasses the clamp, or normalize the score upstream. It's a surprising limit, and knowing it saves you a confused five minutes.

    Categoryimgutils/utility

    Inputs (2)

    NameTypeDefaultDescription
    scoreFLOAT0.500–1Score value to evaluate.
    thresholdFLOAT0.500–1Threshold to compare against.

    Outputs (1)

    NameTypeDescription
    booleanBOOLEAN