ComfyUI Node
Latent Residue Cleaner (Advanced)
A ComfyUI node in image/filters with 14 inputs and 1 output.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| resolution_scaling | BOOLEAN | false | When enabled, spatial parameters (kernel size, sigmas) are automatically scaled based on input resolution. Useful when processing images at different megapixel sizes. |
| scrub_edge_sigma_s | FLOAT | 1280–256 | Edge Preserving: spatial sigma. Auto-scaled by resolution. |
| scrub_edge_sigma_r | FLOAT | 0.010–1 | Edge Preserving: color sigma (0-1) |
| scrub_bilateral_d | INT | 2561–512 | Bilateral: pixel neighborhood diameter. Auto-scaled by resolution. |
| scrub_bilateral_sigma_color | FLOAT | 20–300 | Bilateral: sigma in color space |
| scrub_bilateral_sigma_space | FLOAT | 800–300 | Bilateral: sigma in coordinate space. Auto-scaled by resolution. |
| bilateral_mode | COMBO | Separable Cross-Bilateral | Separable 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_iterations | INT | 31–4 | Number of bilateral filter iterations. More iterations = closer to Full 2D quality but slower. 3 is recommended. Full 2D Bilateral ignores this. |
| flat_snap_threshold | INT | 10–25 | Max color difference (0-255) between adjacent pixels to be connected. 0 = disable Flat Snap entirely. |
| flat_snap_min_area | FLOAT | 0.010.001–100 | Minimum 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_spread | INT | 10–128 | Max color distance (0-255) from region mean to snap a pixel. 0 = no spread limit (snap all pixels in qualifying regions). |
| hue_snap_near_extreme | INT | 10–128 | How close to pure white/black (0-255) to snap hue. 0 = disable Hue Snap. |
| debug | BOOLEAN | false | Show 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)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |