ComfyUI Node

Image List Filter

A tiny bouncer for image batches that don't meet your size minimum

By alessandroperilli·Created about a year ago·Updated 10 months ago· 4
Image List Filter
  • images
  • fallback_image
  • images
  • removed_indices
width_min0
height_min0

Image List Filter is a bouncer for image lists: it takes a batch, throws out anything smaller than your minimums, and hands back what survived. It's the sort of node you don't know you need until you're looping a workflow that occasionally produces a tiny, useless image and you want it gone before it hits the saver or the comparison grid.

It's part of the Open Creative Studio Nodes pack - the companion suite for the OCS workflow (formerly AP Workflow) - and, per the README, it's a rework of Kijai's Image Batch Filter from ComfyUI-KJNodes. Kijai is a name you'll see all over serious video and workflow tooling, so the lineage is a good sign.

How it works

The node runs in list mode (INPUT_IS_LIST = True), so the images input expects a batch of images, and it filters frame-by-frame. You set a width_min and height_min; an image is dropped if its width is at or below width_min, or its height is at or below height_min. In plain terms: set 512 for both and you keep anything strictly bigger than 512×512. Set either to 0 and that dimension imposes no limit at all.

The edge case is handled well: if filtering wipes out the whole batch, and you've wired in the optional fallback_image, the node returns a single-image list containing that fallback. The fallback is normalized for you - uint8 becomes float 0–1, and it gets an explicit batch dimension - specifically so downstream PIL previews don't throw a "Cannot handle this data type" error. Small touches like that tell you someone actually ran this against real workflows.

Inputs that matter

  • images - the batch to filter.
  • width_min / height_min - your cutoffs. 0 = no limit. The two you'll actually set.
  • fallback_image - optional; only used if everything gets filtered out.

Outputs

  • images - the filtered list (a list output, so it wires into anything that accepts a batch).
  • removed_indices - a plain string like 0, 4, 7 listing which positions got dropped. It's a STRING, not a fancy index tensor, so treat it as diagnostic rather than machine input. Useful when you want to know what got rejected, not just that something did.

Install

ComfyUI Manager → search "Open Creative Studio Nodes" → install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/alessandroperilli/OCS_Nodes

No dependencies beyond what ComfyUI already bundles, and no models to fetch.

Where people get burned

  • The threshold is "drop ≤", not "keep ≥". A minimum of 512 removes 512×512 images too. That caught more than one person off guard, and it's worth knowing before you set 512 meaning "at least 512".
  • The fallback only fires when the whole list dies. It's a safety net for total wipeout, not a per-image replacement.
  • It needs a real list upstream. If your source node outputs a single image rather than a batch, this node has nothing to iterate - make sure the thing feeding images actually produces a list.
CategoryOCS Nodes

Inputs (4)

NameTypeDefaultDescription
imagesIMAGE
width_minINT0
height_minINT0
fallback_imageoptIMAGE

Outputs (2)

NameTypeDescription
imagesIMAGE
removed_indicesSTRING