ComfyUI > Nodes > WAS Node Suite > Image Median Filter

ComfyUI Node: Image Median Filter

Class Name

Image Median Filter

Category
WAS Suite/Image/Filter
Author
WASasquatch (Account age: 4688days)
Extension
WAS Node Suite
Latest Updated
2024-08-25
Github Stars
1.07K

How to Install WAS Node Suite

Install this extension via the ComfyUI Manager by searching for WAS Node Suite
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter WAS Node Suite 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Image Median Filter Description

Enhance images by reducing noise, smoothing textures, preserving edges with median filter for AI artists.

Image Median Filter:

The Image Median Filter node is designed to enhance your images by reducing noise and smoothing out textures while preserving edges. This node applies a median filter, which is particularly effective for removing salt-and-pepper noise and other types of random noise from images. By replacing each pixel's value with the median value of the intensities in its neighborhood, the filter helps in maintaining the sharpness of edges while eliminating unwanted noise. This makes it an essential tool for AI artists looking to clean up their images without losing important details.

Image Median Filter Input Parameters:

image

This parameter accepts the image you want to process. The image should be in a format compatible with the node, typically as a tensor.

diameter

This integer parameter defines the diameter of the pixel neighborhood used during the filtering process. A larger diameter will consider more pixels around each point, leading to a stronger smoothing effect. The value ranges from 0.1 to 255, with a default of 2.0. Adjusting this value allows you to control the extent of noise reduction and detail preservation.

sigma_color

This float parameter controls the filter's sensitivity to color differences. A higher value means the filter will consider a wider range of colors as similar, leading to more aggressive smoothing. The value ranges from -255.0 to 255.0, with a default of 10.0. Fine-tuning this parameter helps in balancing between noise reduction and color detail retention.

sigma_space

This float parameter determines the filter's sensitivity to spatial differences. A higher value means the filter will consider a larger spatial area around each pixel, resulting in more extensive smoothing. The value ranges from -255.0 to 255.0, with a default of 10.0. Adjusting this parameter allows you to control the spatial extent of the filtering effect.

Image Median Filter Output Parameters:

IMAGE

The output is the processed image with the median filter applied. This image will have reduced noise and smoother textures while preserving important edges and details. The output is typically in the same format as the input image, usually as a tensor.

Image Median Filter Usage Tips:

  • For images with a lot of fine details, start with a smaller diameter and gradually increase it to find the right balance between noise reduction and detail preservation.
  • Adjust the sigma_color and sigma_space parameters in tandem to fine-tune the filter's effect. Higher values will result in more aggressive smoothing, which can be useful for very noisy images.
  • Use this filter as a preprocessing step before applying other image enhancement techniques to ensure a cleaner and more refined final result.

Image Median Filter Common Errors and Solutions:

ValueError: Invalid diameter value

  • Explanation: This error occurs when the diameter value is set outside the allowed range.
  • Solution: Ensure that the diameter value is between 0.1 and 255.

ValueError: Invalid sigma_color value

  • Explanation: This error occurs when the sigma_color value is set outside the allowed range.
  • Solution: Ensure that the sigma_color value is between -255.0 and 255.0.

ValueError: Invalid sigma_space value

  • Explanation: This error occurs when the sigma_space value is set outside the allowed range.
  • Solution: Ensure that the sigma_space value is between -255.0 and 255.0.

TypeError: Input image is not in the correct format

  • Explanation: This error occurs when the input image is not provided in a compatible format.
  • Solution: Ensure that the input image is in a tensor format compatible with the node.

Image Median Filter Related Nodes

Go back to the extension to check out more related nodes.
WAS Node Suite
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.