ComfyUI Node

PettyPaintBlurs

A Gaussian blur that runs where the tensor already is

By mephisto83·Created 2 years ago·Updated 2 years ago· 3
PettyPaintBlurs
  • images
  • IMAGE
blur_radius1
sigma1.0

Blurring an image in ComfyUI shouldn't be a research project, but the core distribution's image utilities are oddly thin on the basics. PettyPaintBlurs is a plain Gaussian blur: give it images, pick a radius and a sigma, get blurred images back. Nothing exotic - no motion blur, no bokeh, just the smooth F.pad + conv2d Gaussian that does exactly what it says.

Where it actually earns its keep is as a helper in the margins of bigger pipelines. Softening a background plate so the subject pops. Blurring a mask (via the pack's PettyPaintMasksToImages) so a composite edge feathers instead of snapping. Rounding off the hard edges of a generated tile before it goes into a blend. It's the kind of node you add, use once per workflow, and stop noticing - which is the compliment it deserves.

How it works

Under the hood it builds a proper Gaussian kernel from a radius and sigma (kernel size is radius*2+1), pads the image with reflection so edges don't go dark, and runs a grouped 2D convolution over the channels on the GPU. The two knobs split cleanly: blur_radius controls how wide the kernel is (1–31), sigma controls how much the kernel spreads (0.1–10). Wider radius with small sigma gives a tight, sharp-edged blur; wide radius with large sigma gives the heavy, soft diffusion look. It processes each image in a batch and returns them all, and it keeps tensors on the GPU while working then hands them back to the intermediate device - which is why it's fast enough to drop into a loop without thinking about it.

The inputs and outputs

  • images - the IMAGE(s) to blur.
  • blur_radius - integer 1–31, default 1. Kernel half-width.
  • sigma - float 0.1–10, default 1.0. Blur spread.
  • Output: one IMAGE (a batch of blurred images).

Installing it

It's part of the petty-paint pack:

cd ComfyUI/custom_nodes
git clone https://github.com/mephisto83/petty-paint-comfyui-node

Restart ComfyUI, or use ComfyUI Manager and search "petty-paint-comfyui-node". Declared dependency is Flask==2.1.2, unused here.

Common issues

Two small gotchas. First, the output comes back as a list rather than a single tensor, so a few downstream nodes will want an index before accepting it - if you get a "list has no attribute shape" style error, that's the cause. Second, the code has an early-out when blur_radius is 0 - but the input schema's minimum is 1, so you can't actually hit the no-op branch from the UI; set radius to 1 with a tiny sigma if you want a barely-there blur. Also, blurring doesn't change resolution or fix compression artifacts - it hides them - so if you're blurring to disguise upscale problems, you're treating the symptom, not the cause.

Categoryimage/postprocessing

Inputs (3)

NameTypeDefaultDescription
imagesIMAGE
blur_radiusINT11–31
sigmaFLOAT1.00.1–10

Outputs (1)

NameTypeDescription
IMAGEIMAGE