Nodes/ComfyUI_KubaNodes/kubakub scan to line
ComfyUI Node

kubakub scan to line

A phone photo of a drawing becomes a clean line on the matrix: finds the paper (or use 4 corners), straightens it, removes paper colour, shadows and grain. Pencil keeps the greys, ink gives clean black. Draw on a print of the festival template and the scan lands exactly on it. A batch of photos (drawn animation) is scanned frame by frame.

By kubakubkub·Created 15 days ago·Updated 3 days ago· 9
kubakub scan to line
  • photo
  • drawing
  • line
  • projection
  • found
  • corners
  • report
◄width0►
◄height0►
◄linepencil►
◄clean0.50►
◄boost1.00►
◄dots_in_linefalse►
◄corners►
Categorykubakub/2d/sketch

Inputs (8)

NameTypeDefaultDescription
photoIMAGEPhoto(s) of the drawing; the paper should be brighter than the table.
widthINT00–16384Matrix width (link it from project settings); 0 = the paper's own size.
heightINT00–16384Matrix height; 0 = from the width and the paper's proportions.
lineCOMBOpencilpencil = keep the soft greys of the stroke; ink = clean black and white.
cleanFLOAT0.500–1How much paper grain and faint marks are removed (1 = only strong lines).
boostFLOAT1.000.2–4Makes light pencil darker (above 1) or keeps it delicate (below 1).
dots_in_lineoptBOOLEANfalseOff: coloured marker dots (names for regions from sketch) are left out of the line and projection outputs. On: they stay.
cornersoptSTRINGPaper corners in the photo (tl tr br bl, pixels) when the automatic search picks the wrong shape. Empty = automatic.

Outputs (6)

NameTypeDescription
drawingIMAGEThe drawing on white, coloured strokes kept.
lineMASKLine strength 0..1 (for regions from sketch and line overlay).
projectionIMAGEWhite lines on black: ready to project as they are.
foundIMAGEThe photo with the paper outline that was used.
cornersSTRINGThe corners used (copy them into 'corners' to fix them).
reportSTRINGOne line per photo: how the paper was found, its size in the photo (pixels), the size it was straightened to and the corners used.