Nodes/Latent Residue Cleaner/Latent Residue Cleaner (Advanced)
ComfyUI Node

Latent Residue Cleaner (Advanced)

A ComfyUI node in image/filters with 14 inputs and 1 output.

By L33chKing·Created 4 months ago·Updated 4 months ago· 14
Latent Residue Cleaner (Advanced)
  • image
  • image
resolution_scalingfalse
scrub_edge_sigma_s128
scrub_edge_sigma_r0.01
scrub_bilateral_d256
scrub_bilateral_sigma_color2
scrub_bilateral_sigma_space80
bilateral_modeSeparable Cross-Bilateral
bilateral_iterations3
flat_snap_threshold1
flat_snap_min_area0.01
flat_snap_max_spread1
hue_snap_near_extreme1
debugfalse
Categoryimage/filters

Inputs (14)

NameTypeDefaultDescription
imageIMAGE
resolution_scalingBOOLEANfalseWhen enabled, spatial parameters (kernel size, sigmas) are automatically scaled based on input resolution. Useful when processing images at different megapixel sizes.
scrub_edge_sigma_sFLOAT1280–256Edge Preserving: spatial sigma. Auto-scaled by resolution.
scrub_edge_sigma_rFLOAT0.010–1Edge Preserving: color sigma (0-1)
scrub_bilateral_dINT2561–512Bilateral: pixel neighborhood diameter. Auto-scaled by resolution.
scrub_bilateral_sigma_colorFLOAT20–300Bilateral: sigma in color space
scrub_bilateral_sigma_spaceFLOAT800–300Bilateral: sigma in coordinate space. Auto-scaled by resolution.
bilateral_modeCOMBOSeparable Cross-BilateralSeparable Cross-Bilateral: iterative H+V cross-bilateral using original as color reference, fast and accurate. Bilateral Grid: iterative per-channel grid. Full 2D Bilateral: exact OpenCV match, slow.
bilateral_iterationsINT31–4Number of bilateral filter iterations. More iterations = closer to Full 2D quality but slower. 3 is recommended. Full 2D Bilateral ignores this.
flat_snap_thresholdINT10–25Max color difference (0-255) between adjacent pixels to be connected. 0 = disable Flat Snap entirely.
flat_snap_min_areaFLOAT0.010.001–100Minimum region size as percentage of the largest region found. E.g. 1.0 = regions must be at least 1% the size of the biggest region to be snapped.
flat_snap_max_spreadINT10–128Max color distance (0-255) from region mean to snap a pixel. 0 = no spread limit (snap all pixels in qualifying regions).
hue_snap_near_extremeINT10–128How close to pure white/black (0-255) to snap hue. 0 = disable Hue Snap.
debugBOOLEANfalseShow 2x2 preview grid: top row = input vs final output, bottom row = after Latent Scrub vs after Flat Snap. All with noise-expose effect.

Outputs (1)

NameTypeDescription
imageIMAGE