Visit ComfyUI Online for ready-to-use ComfyUI environment
Apply Gaussian blur effect to images for noise reduction and soft-focus aesthetic enhancement using PyTorch and torchvision.
The GaussianBlur node is designed to apply a Gaussian blur effect to images, which is a common technique used in image processing to reduce noise and detail. This node is particularly useful for creating a smooth, soft-focus effect that can enhance the aesthetic quality of an image or prepare it for further processing. By blurring the image, you can achieve a more visually appealing background or soften harsh edges, making it an essential tool for AI artists looking to refine their digital artwork. The GaussianBlur node leverages the power of PyTorch and the torchvision library to perform efficient and high-quality blurring operations, ensuring that your images maintain their integrity while achieving the desired effect.
This parameter represents the input image or batch of images that you want to apply the Gaussian blur to. The images should be provided as a tensor in the BHWC format, where B is the batch size, H is the height, W is the width, and C is the number of channels. The function of this parameter is to serve as the primary data that will be processed by the node.
The kernel_size
parameter determines the size of the Gaussian kernel used for blurring. It must be an odd integer, with a default value of 61, a minimum of 1, and it increases in steps of 2. A larger kernel size results in a more pronounced blur effect, as it considers a larger area of the image for averaging pixel values. This parameter significantly impacts the degree of blurring applied to the image.
The sigma
parameter controls the standard deviation of the Gaussian distribution used in the blur process. It has a default value of 5, with a minimum of 1 and increases in steps of 1. A higher sigma value results in a smoother and more diffused blur effect, as it spreads the influence of each pixel over a wider area. This parameter is crucial for adjusting the intensity of the blur.
The mode
parameter specifies the device on which the blurring operation will be executed. It can be set to either "cuda" or "cpu", with "cuda" as the default option. Choosing "cuda" allows the operation to leverage GPU acceleration for faster processing, while "cpu" will perform the operation on the central processing unit. This parameter is important for optimizing performance based on your hardware capabilities.
The output of the GaussianBlur node is an image or batch of images that have been processed with the Gaussian blur effect. The output is returned as a tensor in the BHWC format, maintaining the original batch size, height, width, and number of channels. This blurred image can be used directly in your artwork or as a pre-processed input for further image manipulation tasks.
kernel_size
and sigma
, and gradually increase them until you reach the desired level of smoothness.sigma
values to find the perfect balance between blurring and retaining important details in your image.mode
parameter is set to a value other than "cuda" or "cpu".mode
parameter is correctly set to either "cuda" or "cpu" to match your hardware configuration.kernel_size
, or switch to "cpu" mode if GPU memory is insufficient.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.