Nodes/ComfyUI-LexTools/ImageFilterByFloatScoreNode
ComfyUI Node

ImageFilterByFloatScoreNode

Keep only the images that score high enough

By SOELexicon·Created 3 years ago·Updated about a year ago· 33
ImageFilterByFloatScoreNode
  • image
  • IMAGE
score0.00
threshold0.00

Here's the node that makes a scored batch actually useful: ImageFilterByFloatScoreNode takes an image and its score, compares the score against a threshold you set, and only passes the image through if it clears the bar. Everything below the threshold silently disappears. Generate fifty images, score them, and this node hands you just the keepers - the ones above your quality line.

It sits at the business end of the pack's scoring pipeline. The chain is: generate → score (ImageQualityScoreNode or similar) → filter → whatever comes next. In a batch workflow that's the difference between saving a folder of fifty and saving the seven that are worth keeping. It's the "curate my outputs automatically" node, and it's the reason you'd bother scoring at all instead of eyeballing the previews.

How it works

Straightforward comparison logic - no model, no math beyond a threshold check:

  • score (FLOAT) - the quality score for the current image, wired from your scoring node.
  • threshold (FLOAT) - the cutoff. Score above threshold → image passes through; at or below → image is dropped.
  • image (IMAGE) - the image itself, so the node can pass it along when it clears the bar.

Output: IMAGE - the same image, unchanged, only when it meets the threshold.

The node works per-image on the batch: it processes each image in sequence, and the ones that fail just don't come out. In a batched run that means the output batch can be smaller than the input batch, and it will stay in score order.

The catch the README warns about

This is where people get burned, and the author says so in the README: the node "may throw errors if the following node in the sequence does not handle blank outputs." When every image in a batch fails the threshold, the node has nothing to emit - and a downstream node that expects a non-empty IMAGE will throw. The fix is to make sure whatever follows (a save node, a preview, a sorter) tolerates an empty batch, or to arrange the graph so there's always at least one image above the bar. If your run dies with a mysterious empty-tensor error right after a filter, that's it.

Also worth knowing: there's a sibling ImageFilterByIntScoreNode for integer scores. Use the float version for aesthetic/similarity scores and the int version when your score is a whole number - matching the type avoids a needless conversion step.

Install

Part of ComfyUI-LexTools, so the one-time pack install: ComfyUI Manager → search "ComfyUI-LexTools", or

cd ComfyUI/custom_nodes
git clone https://github.com/SOELexicon/ComfyUI-LexTools

then restart ComfyUI. No models, no downloads. The only dependency is your scoring node producing a float you trust - and you should sanity-check that threshold on a few known-good and known-bad images before you let it run an unattended batch, because a wrong threshold will happily delete every output you generated.

CategoryLexTools/ImageProcessing/Scores

Inputs (3)

NameTypeDefaultDescription
scoreFLOAT0.00
thresholdFLOAT0.00
imageIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE