Nodes/comfyui_ds/Simple Document Scanner
ComfyUI Node

Simple Document Scanner

The document scanner with the knobs removed — three presets, one output

By harishcmgit·Created 7 months ago·Updated 7 months ago· 0
Simple Document Scanner
  • image
  • scanned_image
enhancementauto

If the full DocumentScanner node feels like a wall of sliders, SimpleDocumentScanner is the version someone else tuned for you. It takes an image, an enhancement preset, and hands back one cleaned-up scan. That's the entire interface: two inputs, one output. No edge thresholds, no blur kernel, no debug view, no GrabCut toggle - all of those are fixed internally to the same sensible defaults the big node ships with (edge thresholds 20/70, blur kernel 5, preprocessing on).

It's from the same harishcmgit/comfyui_ds pack as the full Document Scanner node, and under the hood it's genuinely the same code. The node literally instantiates the full scanner, picks a preset, and calls it with the defaults. No API, no model download, no key - pure OpenCV.

The presets

  • auto - maps to the sharpening enhancement. General purpose; good when you don't know what you're scanning.
  • text - maps to adaptive_threshold. Local adaptive thresholding, so it handles uneven lighting on a page better than a single global cutoff. This is the one for receipts, notes, and anything with mostly-black-on-white content.
  • photo - maps to clahe. Contrast-limited adaptive histogram equalization on the luminance channel. Pick this when there's actual image content - a magazine page, a drawing, mixed material - and you don't want it flattened to pure black and white.

The output is a single scanned_image IMAGE tensor, ready for SaveImage, a VAE encode, or upscaling. It also batches: feed it a list of images and it processes them all.

Installing it

Same pack, same install, so it arrives with the others:

cd ComfyUI/custom_nodes
git clone https://github.com/harishcmgit/comfyui_ds

Then restart ComfyUI. Or just search comfyui_ds in ComfyUI Manager. Dependencies are opencv-python and numpy (torch ships with ComfyUI), and there are no models to download - note the README mentions a requirements.txt that the shipped repo doesn't actually include, so pip install opencv-python covers you if OpenCV is missing.

The honest trade-off

This is the node I'd hand to someone who just wants scans out of their graph without learning Canny thresholds. But "fixed internally" cuts both ways: if detection misbehaves on a particular photo, you have exactly zero knobs to turn. There's no debug output here to see what the detector saw, either. The failure mode is the same as its bigger sibling - if the page isn't found, the node quietly returns your original image - but with the full node you at least get return_debug_edges to diagnose it. With this one, your move is to swap it out for the full DocumentScanner and tune from there.

Same caveat as every node in this young pack: a single commit, no real community track record, and custom nodes run arbitrary code. Skim the repo before you rely on it. For a genuinely simple utility, it does exactly what it says - just know what it can't show you.

Categoryimage/processing

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
enhancementCOMBOauto3 options: auto, text, photo

Outputs (1)

NameTypeDescription
scanned_imageIMAGE