Nodes/ComfyUI-LexTools/ImageFilterByIntScoreNode
ComfyUI Node

ImageFilterByIntScoreNode

The integer-flavored bouncer for your outputs

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

ImageFilterByIntScoreNode is the same idea as the pack's float filter - keep the image if its score beats the threshold, drop it if not - but it works on whole-number scores. If your scoring pipeline produces integers (aesthetic scores, rank values, or anything that's already an INT), this is the version that fits without conversion. Feed it an image, its integer score, and a threshold, and only the images above the line come out the other side.

It's the workhorse of an automated curation loop. The pattern: generate a batch, score each image with a node that emits an INT, pass score and image through this filter, and let it decide what's worth keeping while you go do something else. For prompt sweeps where you're ranking on a 1–10 aesthetic scale, integer thresholds are the natural fit - no floats, no fuzziness, just "this is a 7, keep it" against a cutoff of 6.

How it works

A threshold comparison, nothing more:

  • score (INT, default 0) - the image's score, wired from whatever produced it.
  • threshold (INT, default 0) - the cutoff. Pass the image through only if the score clears it.
  • image (IMAGE) - the image to potentially pass along.

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

Per-batch, it evaluates each image in sequence, so the output batch is a subset of the input, in order. If nothing clears the bar, nothing comes out.

The same blank-output trap

The author's README flags this for both filter nodes, and it applies here: it "may throw errors if the following node in the sequence does not handle blank outputs." When an entire batch fails the threshold, the node emits an empty result, and a downstream node that expects a real image will error out. Guard against it by putting something downstream that tolerates an empty batch, or just make sure your threshold isn't set so high that a full run can zero out. This is the #1 "why did my graph die" report for this node, so treat the README note as gospel.

There's also the sibling float version - use it when your score is fractional (say, an AI-detection confidence or a normalized aesthetic score). Picking the matching type avoids a conversion step and keeps the comparison honest.

Install

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 model downloads. Set the threshold with a couple of manual sanity checks before you let it curate unattended - a filter that's too strict quietly deletes your whole batch, and the log line won't be dramatic about it.

CategoryLexTools/ImageProcessing/Scores

Inputs (3)

NameTypeDefaultDescription
scoreINT0
thresholdINT0
imageIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE