ComfyUI Node: GaussianBlur

Class Name

GaussianBlur

Category
background-edit
Author
yondonfu (Account age: 4198days)
Extension
ComfyUI-Background-Edit
Latest Updated
2024-12-31
Github Stars
0.02K

How to Install ComfyUI-Background-Edit

Install this extension via the ComfyUI Manager by searching for ComfyUI-Background-Edit
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Background-Edit 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

GaussianBlur Description

Apply Gaussian blur effect to images for noise reduction and soft-focus aesthetic enhancement using PyTorch and torchvision.

GaussianBlur:

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.

GaussianBlur Input Parameters:

images

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.

kernel_size

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.

sigma

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.

mode

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.

GaussianBlur Output Parameters:

IMAGE

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.

GaussianBlur Usage Tips:

  • To achieve a subtle blur effect, start with a smaller kernel_size and sigma, and gradually increase them until you reach the desired level of smoothness.
  • Utilize the "cuda" mode if you have a compatible GPU, as it can significantly speed up the blurring process, especially for large images or batches.
  • Experiment with different sigma values to find the perfect balance between blurring and retaining important details in your image.

GaussianBlur Common Errors and Solutions:

invalid mode

  • Explanation: This error occurs when the mode parameter is set to a value other than "cuda" or "cpu".
  • Solution: Ensure that the mode parameter is correctly set to either "cuda" or "cpu" to match your hardware configuration.

RuntimeError: CUDA error: out of memory

  • Explanation: This error indicates that there is not enough GPU memory available to perform the blurring operation.
  • Solution: Try reducing the batch size or the kernel_size, or switch to "cpu" mode if GPU memory is insufficient.

GaussianBlur Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Background-Edit
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.