Nodes/Transparency Background Remover/Transparency Background Remover (Batch)
ComfyUI Node

Transparency Background Remover (Batch)

The batch background remover that tunes itself per image

By Limbicnation·Created about a year ago·Updated 4 months ago· 22
Transparency Background Remover (Batch)
  • images
  • images
  • masks
  • report
tolerance30
edge_sensitivity0.80
auto_adjusttrue
foreground_bias0.70
color_clusters8
edge_refinementtrue
dither_handlingtrue
binary_threshold128
progress_reportingtrue

If you've got a folder of images to cut - a sprite sheet, a product run, a stack of renders - the single-image node gets old fast. This is the pack's batch variant, and its one meaningful difference is that per-image auto-adjustment is ON by default. Every frame gets its own parameter tuning from content analysis instead of one settings profile applied blindly to the whole batch. That's exactly the difference that matters when your batch mixes dark and light backgrounds, or clean sprites with noisy photos.

You feed it images (plural - any batch tensor from a Load Images node) plus the base settings: tolerance, edge_sensitivity, foreground_bias, color_clusters, with auto_adjust defaulting to true. Optional controls are edge_refinement, dither_handling, binary_threshold, and progress_reporting. Worth noting what's not here: no output_size, no scaling_method. The batch node processes everything at original size, so if you want everything delivered at a fixed 1024 square, add a resize node after it.

Outputs

Three of them, and only two are normal: images and masks - stacked tensors in the same order you fed in, ready to feed a Save Image / Save Mask pair or further processing. The third is report, a STRING summary of the run, produced when progress_reporting is on. Stock ComfyUI has little that consumes a bare string, so treat it as a debug aid: flip progress_reporting on when a batch misbehaves and read what it tuned, flip it off when you don't want the overhead.

Install

Same pack, same steps as the flagship:

cd ComfyUI/custom_nodes
git clone https://github.com/Limbicnation/ComfyUI-TransparencyBackgroundRemover.git
cd ComfyUI-TransparencyBackgroundRemover
pip install -r requirements.txt

Or search "Transparency Background Remover" in ComfyUI Manager. Restart and it's under image/processing. Note this node does not need the heavier optional deps - it's the same CV engine as the flagship, so scikit-learn matters (install the pack's install.bat/install.sh if you see the sklearn warning) but ultralytics and the GrabCut machinery are irrelevant to it. The memory math is the usual batch concern: each image costs a few multiples of its own size in temporary buffers, so very large batches are better split up than run in one shot.

Categoryimage/processing

Inputs (10)

NameTypeDefaultDescription
imagesIMAGE
toleranceINT300–255Base color similarity threshold for background detection (0-255)
edge_sensitivityFLOAT0.800–1Base edge detection sensitivity (0-1)
auto_adjustBOOLEANtrueAutomatically adjust parameters based on image content
foreground_biasFLOAT0.700–1Bias towards foreground preservation (0-1)
color_clustersINT82–20Number of color clusters for background detection
edge_refinementoptBOOLEANtrueApply edge refinement post-processing
dither_handlingoptBOOLEANtrueEnable dithered pattern detection and handling
binary_thresholdoptINT1280–255Threshold for binary alpha mask (0-255)
progress_reportingoptBOOLEANtrueGenerate detailed processing report

Outputs (3)

NameTypeDescription
imagesIMAGE
masksMASK
reportSTRING