ComfyUI > Nodes > ImageProcessing > Bilateral Filter

ComfyUI Node: Bilateral Filter

Class Name

BilateralFilter

Category
ImageProcessing
Author
bvhari (Account age: 1432days)
Extension
ImageProcessing
Latest Updated
2024-08-03
Github Stars
0.02K

How to Install ImageProcessing

Install this extension via the ComfyUI Manager by searching for ImageProcessing
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ImageProcessing in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Bilateral Filter Description

Powerful image processing tool for noise reduction while preserving edges using bilateral filter based on spatial and radiometric similarity.

Bilateral Filter:

The BilateralFilter node is a powerful tool in image processing that helps in smoothing images while preserving edges, making it ideal for tasks where you want to reduce noise without losing important details. This node applies a bilateral filter, which is a non-linear, edge-preserving, and noise-reducing smoothing filter. It works by averaging the pixels based on both their spatial closeness and their radiometric similarity, meaning it considers both the distance between pixels and the difference in their color values. This makes it particularly useful for enhancing images where you want to maintain sharp edges, such as in portrait photography or when preparing images for further processing in AI art generation.

Bilateral Filter Input Parameters:

images

This parameter represents the input image or images that you want to process using the bilateral filter. The images should be in a format compatible with the node, typically as tensors, and they are the primary data on which the filter will be applied.

kernel_size

The kernel_size parameter determines the size of the filter kernel used in the bilateral filtering process. It affects the area around each pixel that is considered when applying the filter. A larger kernel size will result in more smoothing, as more neighboring pixels are taken into account. The minimum value is 1, the maximum is 20, and the default is 3.

sigma_color

The sigma_color parameter controls the degree to which the filter considers the color difference between pixels. A higher value allows for more color variation within the neighborhood, leading to more smoothing. This parameter is crucial for maintaining edge sharpness while reducing noise. The minimum value is 0.0, the maximum is 10.0, and the default is 0.25.

sigma_space

The sigma_space parameter influences the spatial distance that the filter considers when averaging pixels. A larger value means that pixels further away from the target pixel will have more influence, resulting in a smoother image. This parameter helps in controlling the extent of the smoothing effect. The minimum value is 0.0, the maximum is 10.0, and the default is 1.25.

Bilateral Filter Output Parameters:

IMAGE

The output of the BilateralFilter node is an image or a set of images that have been processed with the bilateral filter. This output retains the important edges and details of the original image while reducing noise and smoothing out less significant variations. The result is typically a cleaner and more visually appealing image, suitable for further artistic manipulation or as a final product.

Bilateral Filter Usage Tips:

  • Experiment with different kernel_size, sigma_color, and sigma_space values to achieve the desired balance between noise reduction and edge preservation. Smaller values will preserve more detail, while larger values will result in smoother images.
  • Use the BilateralFilter node as a preprocessing step before applying other image processing techniques or AI models to enhance the quality and clarity of the input images.

Bilateral Filter Common Errors and Solutions:

"Invalid image format"

  • Explanation: The input image is not in a compatible format or tensor shape required by the node.
  • Solution: Ensure that the input images are properly formatted as tensors and have the correct dimensions expected by the node.

"Kernel size out of range"

  • Explanation: The kernel_size parameter is set outside the allowed range of 1 to 20.
  • Solution: Adjust the kernel_size parameter to be within the specified range.

"Sigma values out of range"

  • Explanation: The sigma_color or sigma_space parameters are set outside their respective ranges of 0.0 to 10.0.
  • Solution: Ensure that both sigma_color and sigma_space are set within their valid ranges to avoid errors.

Bilateral Filter Related Nodes

Go back to the extension to check out more related nodes.
ImageProcessing
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.