ComfyUI Node Runs on cloud

PencilSketch

The classic invert-blur-dodge recipe, one node

By EllangoK·Created 3 years ago·Updated 2 years ago· 256
PencilSketch
  • image
  • IMAGE
blur_radius5
sharpen_alpha1.0

The pencil sketch effect is one of the oldest filter recipes in image editing, and it's been reimplemented in every tool from GIMP to Photoshop to a thousand web filters. It works so well it became a cliché, but there's a reason it keeps getting rebuilt: the result is genuinely good. PencilSketch is that classic recipe - grayscale, invert, blur, color-dodge - packaged as a single node, with an optional sharpening pass on top. Feed it a render and out comes a hand-drawn, white-paper sketch.

How it works

The recipe is four steps, and understanding them explains why the sliders do what they do:

  1. The image is converted to grayscale.
  2. It's inverted (bright becomes dark).
  3. That inverted copy is blurred.
  4. The blurred, inverted copy is "dodged" against the original grayscale (original / (1 - blurred_inverted)), which turns it into the classic pencil-line image: dark where the original had edges, paper-white where it was flat.
  • blur_radius (1–31, default 5) - how much the inverted layer is blurred, which controls line weight. Small radii give tight, scribbly linework; big radii give soft, broad strokes. This is the main artistic dial.
  • sharpen_alpha (0–10, default 1) - a final sharpen pass applied to the sketch. 0 skips it entirely; higher values crisp the lines. If your sketch looks smudgy, bump this a touch before you start fighting the radius.

Output is a single IMAGE.

Install

PencilSketch is one of ~22 nodes in ComfyUI-post-processing-nodes.

  • ComfyUI Manager: search "post processing nodes", install, restart.
  • Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/EllangoK/ComfyUI-post-processing-nodes

Restart after. No requirements.txt, no downloads - it's torch conv2d and tensor ops. It's under postprocessing → Effects in the node menu.

The honest take

This is a faithful implementation of an old filter, which means two things. First, it works - a 1024px render becomes a convincing sketch with defaults and a bit of sharpen_alpha. Second, it has the old filter's limitations: it operates on the whole image, so busy backgrounds turn into gray scribble soup, and it has no notion of "pencil pressure." For a clean line-art look on a simple subject it's great; for a full scene you'll get more mileage from ControlNet's lineart preprocessors feeding a sketch-conditioned model. As a quick stylization pass, it's exactly what it says on the tin.

Categorypostprocessing/Effects

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
blur_radiusINT51–31
sharpen_alphaFLOAT1.00–10

Outputs (1)

NameTypeDescription
IMAGEIMAGE