Nodes/ComfyUI-Img2DrawingAssistants/Img2Sketch Assistant (Grayscale)
ComfyUI Node

Img2Sketch Assistant (Grayscale)

Same pencil look, one fewer color knob

By Isi-dev·Created 2 years ago·Updated 11 months ago· 22
Img2Sketch Assistant (Grayscale)
  • image
  • sketch
  • grayscale image
line_strength1.0
shading_effect41
details225
smoothness2.0
contrast100
noise_removal0

If your end goal is a black-and-white sketch, this is the node you want from the ComfyUI-Img2DrawingAssistants pack - and honestly, it's the one I'd reach for most. It's the grayscale-only sibling of the Img2Sketch Assistant, minus the color chrome (no artist dropdown, no line color, no background repaint) and plus one thing the color version doesn't have: a contrast slider. Same trick, cleaner panel.

Like everything else in the pack, there's no model behind it. It's pure OpenCV running on CPU, so it converts an image to a pencil-sketch look in a fraction of a second, with nothing to download and no GPU requirement.

How it works

The engine is the classic pencil-sketch algorithm: grayscale the image, blur it with a Gaussian kernel sized by shading_effect, then divide the original by its own blur. That division is what turns edges and dark strokes into pencil marks - where a pixel matches the local average you get flat paper, where it deviates you get graphite. It's the same "divide by a blur" trick as the color version, just without the ink-recoloring step bolted on afterward.

The one extra input here is contrast (1–150, default 100), which multiplies the dark pixels to push shadows deeper and make the sketch read punchier. Crank it to 130–150 for a bold, high-contrast drawing; drop it below 100 for a softer, lighter touch.

The inputs that matter

  • shading_effect (5–105, default 41) - the blur kernel; the main knob between "tight detailed strokes" and "broad soft shading."
  • details (50–255, default 225) - what counts as a line; higher pulls more of the image into the ink.
  • smoothness (1–5, default 2) - a downscale-and-reupscale smoothing pass; higher = softer, simpler output.
  • contrast (1–150, default 100) - shadow depth, unique to this node.
  • noise_removal (0–5, default 0) - kills speckle on dirty inputs.

Both defaults for smoothness and details are a hair softer than the color version's, which suits a grayscale sketch nicely.

Outputs

Two IMAGE outputs: sketch, the processed pencil rendering (wire it to Preview or Save Image), and grayscale image, the plain desaturated source untouched by the pencil effect. Both are technically 3-channel tensors, but they look grayscale - easy to confuse, and the difference is "processed" vs. "raw."

Install

ComfyUI Manager, search ComfyUI-Img2DrawingAssistants, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/Isi-dev/ComfyUI-Img2DrawingAssistants

No model files. Dependencies are torch, numpy, opencv-python - torch and numpy come with ComfyUI; cv2 is the only real install, and Manager handles it. Same heads-up as the rest of the pack: it wants the full opencv-python build where ComfyUI ships opencv-python-headless; they coexist, but pip occasionally churns over which one owns cv2.

Troubleshooting

Quality tracks input, as the author notes for the whole pack - flat, well-lit images sketch best. Feed it a noisy screenshot and you'll want noise_removal at 2–3. If the output looks anemic, push contrast up before touching line_strength; and if you're feeding the result into a ControlNet scribble or lineart preprocessor, use the processed sketch output, not the raw grayscale one, or you'll get gray mush instead of clean line guidance.

It's a thin node by design - there's no artist choice and no background repaint, because the color variant already covers that. If you never need colored pencil, this simpler version is the better fit.

Categoryimage

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
line_strengthFLOAT1.01–10
shading_effectINT415–105
detailsINT22550–255
smoothnessFLOAT2.01–5
contrastFLOAT1001–150
noise_removalINT00–5

Outputs (2)

NameTypeDescription
sketchIMAGE
grayscale imageIMAGE