Nodes/ComfyUI_KimNodes/🍒Transparent_ImageFilter✔️无色图像过滤
ComfyUI Node

🍒Transparent_ImageFilter✔️无色图像过滤

Filter a batch of cutouts down to the ones that aren't fully transparent

By wjl0313·Created 2 years ago·Updated 12 months ago· 54
🍒Transparent_ImageFilter✔️无色图像过滤
  • images
  • 过滤后有效图像

Transparent_Image_Filter does one thing and does it cleanly: it takes a list of images and throws out the ones that are fully transparent, keeping everything else.

You'll know the problem it solves the first time you run a batch through Split_Mask or a background-removal node and get back a list that's 60% empty 1×1 placeholders or fully-transparent frames. Downstream nodes then either choke on the empties or waste compute processing nothing. This filter sits right after the cutout step and keeps only the images that actually have content in their alpha channel.

The mechanism. For each image in the list it checks the alpha channel - if the image is RGBA and every pixel's alpha is below 0.01 (effectively zero), it's dropped. If the image has no alpha channel at all, it's treated as valid and kept. That last bit is worth knowing: the filter is a transparency filter, not a content filter. A fully black opaque image sails through because it isn't transparent.

Input. Exactly one:

  • images - an IMAGE list (the output of a node that produces multiple cutouts).

Output. 过滤后有效图像 ("filtered valid images") - an IMAGE list containing only the non-empty ones. Note the Chinese label again; it's just how this pack's author names things.

Where it fits. This is the cleanup pass in the pack's own recommended flow: Split_Mask or Transparent_Area_Cropper produce the cutouts, Transparent_Image_Filter removes the ones that came back empty, and what survives goes on to a selector (like MaxLength_ImageListSelector) or straight into a batch. It's also useful after any mask-based cropping where the mask was occasionally empty - instead of writing a check per frame, filter the list and carry on.

Gotchas. Because "empty" is defined strictly by alpha, an image that's almost transparent (a faint 0.02-alpha ghost) passes the check. If that's a problem, no amount of tweaking this node helps - it's a fixed threshold - so filter upstream by mask area instead (Mask_White_Area_Ratio is built for that). Also remember it operates on lists: feed it a single batched tensor and it treats the batch as the list, which is usually right, but a genuinely single image gets wrapped and passed through.

Install. It's part of KimNodes (wjl0313's 🍒 toolbox on the Comfy registry). ComfyUI Manager → search "ComfyUI_KimNodes", or:

cd ComfyUI/custom_nodes
git clone https://github.com/wjl0313/ComfyUI_KimNodes

then restart. Pure numpy/torch - no models, no downloads, no extra pip packages.

Troubleshooting. If everything gets filtered out, your images probably really are all-transparent - check what the upstream node is emitting (the 1×1 placeholder behavior of MaxLength_ImageListSelector and the empty-return of Split_Mask are classic sources). If nothing ever gets filtered, your inputs likely aren't RGBA at all, and the node intentionally leaves opaque images alone. And if the output count surprises you, remember the log messages: this node prints a count of filtered vs. kept per run, so check your ComfyUI console when the numbers feel off.

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

Inputs (1)

NameTypeDefaultDescription
imagesIMAGE

Outputs (1)

NameTypeDescription
过滤后有效图像IMAGE