ComfyUI Node

Manga Toner

Real screentone, not a cheap halftone filter

By TrophiHunter·Created about a year ago·Updated about a year ago· 5
Manga Toner
  • image
  • IMAGE
num_zones5
scale_factor1.00
edge_strength1.00
edge_threshold0.080
edge_dilate1

Screentone - the dotted shading on printed manga - is one of those effects that looks trivial until you try to fake it, and then it looks like a halftone filter threw up on your image. This Manga Toner node does it the way the pros actually do: it slices the image into brightness zones and fills each zone with a real dot pattern at a different density, then redraws edges as crisp black lines. Feed it a clean illustration or a cel-shaded AI render and you get something that reads as genuinely printed.

How it works

The image is converted to luma and split into num_zones (3–10) brightness bands. Each band gets its own dot pattern - the code generates an actual dot grid per zone, with tighter spacing for darker zones (that's the classic manga trick: darker shading = denser dots). Then a Sobel edge detector finds the outlines and re-ink-ifies them: edge_strength controls how aggressively edges get knocked to black, edge_threshold decides what counts as an edge, and edge_dilate thickens the line work.

The scale_factor knob is the fun one. It upscales the working resolution before generating dots - raise it and the dot texture gets finer and more detailed (with a compute cost); leave it at 1 for standard density. The result is three-channel (repeated gray), so it drops neatly into any RGB pipeline even though the output is grayscale in spirit.

Inputs that matter

  • num_zones - how many distinct shading steps. Low (3–4) = bold, posterized poster look; high (7+) = smooth photographic-toned shading
  • scale_factor - dot density. Higher is finer detail
  • edge_threshold - sensitivity of the inking. Too high and edges vanish into the dots; too low and everything gets an ink outline
  • edge_strength / edge_dilate - how hard and how thick the line work lands

One IMAGE in, one IMAGE out. The author's example workflow pairs it with Pixel Art and Monitor Filter as the "retro treatment" branch, but it stands alone on any flat illustration.

Install

Standard pack install, no special dependencies:

cd ComfyUI/custom_nodes
git clone https://github.com/TrophiHunter/ComfyUI_Photography_Nodes

Restart, then find it under TrophiHunter/Photography (ComfyUI Manager: search "Photography Nodes"). The whole pack is pure torch/PIL/numpy with no requirements.txt, so there's nothing extra to install or download.

Where people get burned

The effect wants flat, clean input. Feed it a noisy photo and the zones fragment and the dots smear - run a posterize or a strong contrast pass first, or accept that this node is for illustration-style work, not photographs. Also, don't mistake the default scale_factor of 1 for broken output if the dots look chunky; that's the intended printed-density look. Crank it to 4–8 for a modern, fine-screen finish.

CategoryTrophiHunter/Photography

Inputs (6)

NameTypeDefaultDescription
imageIMAGE
num_zonesINT53–10
scale_factorFLOAT1.000.1–20
edge_strengthFLOAT1.000–1
edge_thresholdFLOAT0.0800–1
edge_dilateINT10–100

Outputs (1)

NameTypeDescription
IMAGEIMAGE