Nodes/ComfyUI_KimNodes/🍒Image_PixelFilter✔️图像像素过滤
ComfyUI Node

🍒Image_PixelFilter✔️图像像素过滤

Image_PixelFilter drops the tiny frames from a batch before you waste a step on them

By wjl0313·Created 2 years ago·Updated 12 months ago· 54
🍒Image_PixelFilter✔️图像像素过滤
  • images
  • 过滤后图像
  • 原始图像
  • 被过滤小图像
像素阈值512

If you've ever run a big batch through an upscaler or a detailer and watched it burn minutes on a 320px thumbnail, you know the pain Image_PixelFilter exists to remove. It's a size gate for image lists: set a minimum edge length, and it splits your batch into the images that are big enough to bother processing and the ones that aren't.

It's a Selector-category node, and its job is exactly what the upscaling playbook says to do first: don't spend generative compute on sources that don't have the detail to benefit. Small, soft images upscaled by an AI model mostly produce larger soft images; filtering them out before the expensive pass is free quality control.

How it works

You feed it an images list and a 像素阈值 (pixel threshold, default 512). It walks every image, computes the max of its height and width, and compares against the threshold: images whose largest edge is below the threshold get separated out, everything else passes. It returns three lists:

  • 过滤后图像 - the images that cleared the bar.
  • 原始图像 - every image, unfiltered (handy when you want the "before" for comparison or a pass-through).
  • 被过滤小图像 - the ones that were rejected.

Two behavioral quirks, both deliberate: if everything gets filtered out, the 过滤后图像 output falls back to a placeholder (the first original image), and if nothing gets filtered, the 被过滤小图像 output gets the same placeholder treatment. So the node always returns non-empty lists, which keeps downstream list consumers from choking - but it means "all passed" and "all failed" look suspiciously similar unless you check the console, where it prints the counts.

The inputs that matter

  • images - the batch to gate.
  • 像素阈值 - minimum largest-edge length in pixels. 512 is a sane default for SDXL-era pipelines; raise it if you only want hires-worthy frames.

Installation

Standard KimNodes pack install - Manager → search "ComfyUI_KimNodes" → Install → Restart, or git clone https://github.com/wjl0313/ComfyUI_KimNodes into custom_nodes. No extra dependencies.

Common issues

  • "Everything came through" - check the console for the printed counts; with the placeholder behavior, "nothing filtered" looks like a normal result. Also confirm you're feeding a list, not a single batch tensor.
  • You expected center-crop or aspect-based filtering - it's a simple max-edge check, nothing smarter. Tall-but-narrow images pass on their long edge, which is usually what you want anyway.
  • Placeholder images polluting output - if you chain this straight into a save node, the placeholder frames can get saved too. It's safer to feed the 过滤后图像 output into something that ignores single black frames, or just accept the quirk.

It's a small, honest utility - the kind of thing that saves you a custom Python node the first time you point it at a mixed-resolution folder.

Category🍒 Kim-Nodes/✔️Selector |选择器

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
像素阈值INT5121–4096

Outputs (3)

NameTypeDescription
过滤后图像IMAGE
原始图像IMAGE
被过滤小图像IMAGE