Nodes/msch-comfyui-nodes/msch-edge-ascii (frames)
ComfyUI Node

msch-edge-ascii (frames)

EdgeASCII's strokes follow the image, not a text grid

By mariobilly·Created a day ago·Updated a day ago· 0
msch-edge-ascii (frames)
  • image
  • mask
  • image
  • effect_mask
mode
cell_size16
color#FFFF00
opacity1.00
line_width1.6
line_length0.85
edge_threshold0.055
edge_coherence0.25
blur1.2
tone_gamma1.6
fill_amount0.50
invert_tonesfalse
background
background_color#000000

First, manage expectations on the name. EdgeASCII doesn't render actual letters and digits the way a terminal-art converter does. It draws geometric strokes - lines at four angles plus halftone dots and stripes - and aligns them to the contours in your photo. Think engraved illustration, technical blueprint, or a scanline-heavy poster, not @%#*+ spam. That's honestly the better deal: classic character-map ASCII ignores image structure, while this thing tracks it, which is why it reads as intentional art instead of a filter you saw in 1995. It's a deterministic stylizer in the same family as pixel-art downsamplers (the post-processing layer the KB puts on the "the model didn't make this, a post-process did" side), so it works identically every run, on a photo you generated or one you shot, with zero model downloads.

How it reads your image

Under the hood it's a small gradient-analysis pipeline, all CPU-friendly. The image is converted to luminance, run through a Sobel-style gradient, and then - this is the clever bit - gradients are pooled into each grid cell as a structure tensor, so opposing gradients inside a cell cancel correctly instead of washing each other out. Each cell gets an edge strength, a coherence (how consistently the structure points one way), and an orientation. The stroke glyph is chosen to run perpendicular to the gradient - i.e. along the contour - from four quantized directions, so strokes hug edges rather than crossing them. Where the cell fails the strength and coherence tests, you get tone fill instead: pooled brightness, gamma-shaped, mapped to six dot/stripe levels. Nothing uses a font file; the glyphs are drawn procedurally and supersampled, so they render identically whether you're on Windows, Linux, or macOS.

The inputs that actually matter

There are a lot of widgets here, but you'll touch maybe five. mode picks the look: edge_only (strokes on contours, clean and technical), full_ascii (every cell gets a glyph, so tones come through), or mixed (strokes on edges, halftone dots only in the shadows, faces and highlights stay open - usually the nicest on portraits). cell_size is your grid spacing in pixels, and the tooltip is right: scale it with resolution. At 512 you'll want something near the default 16; at 1024, push toward 24–32 or the strokes get impractically dense. edge_threshold is sensitivity - lower it and you get more strokes, raise it and only strong contours survive. edge_coherence quietly saves you: bump it to clear out noisy areas where gradient directions fight each other. Then color (a hex string like #FFFF00), background (original or solid with background_color), and opacity to dial the whole thing back.

There's also an optional mask: white permits the effect, black excludes it, and one mask broadcasts across a whole batch - handy for keeping faces clean in full_ascii mode.

What comes out

Two outputs: image, the composited result ready for Save Image, and effect_mask, the exact alpha mask that was applied. The mask output is a nice touch - you can wire it into other compositing nodes if you want to reuse the region the effect covered, or just confirm what got styled.

Installing it

This one's easy because there's nothing to download but the code:

cd ComfyUI/custom_nodes
git clone https://github.com/mariobilly/msch-edge-ascii.git
cd msch-edge-ascii
python -m pip install -r requirements.txt

Then restart ComfyUI. Requirements are numpy, Pillow, torch, and av - you already have the first three in any working ComfyUI, and av ships with ComfyUI's own video support, so the pip step is usually a no-op. Windows portable users run the same with .\python_embeded\python.exe. One caveat from the README: as of this writing the Comfy Registry listing was still pending verification and the ComfyUI Manager entry wasn't confirmed, so don't be surprised if Manager search comes up empty - the clone above is the reliable path.

Gotchas

Worth knowing before you hit a wall: the author has superseded this standalone repo with the unified MSCH Nodes pack (mariobilly/msch-comfyui-nodes). Don't install both - you'll get duplicate node registrations. And colors are strict: they must be six hex digits (#FFFF00 or FFFF00 both work); type "yellow" and the node throws at run time with a message telling you exactly that. Finally, if the strokes look mushy, check your blur - it only smooths the detection image, never the photo you're stylizing, so a bit of it (1–2) cleans up jittery edges without softening the result.

Categoryimage/effects

Inputs (16)

NameTypeDefaultDescription
imageIMAGE
modeCOMBO3 options: edge_only, full_ascii, mixed
cell_sizeINT164–128Grid spacing in pixels. Scale this with image resolution.
colorSTRING#FFFF00
opacityFLOAT1.000–1
line_widthFLOAT1.60.5–16
line_lengthFLOAT0.850.1–1
edge_thresholdFLOAT0.0550–1Lower values create more strokes; higher values keep stronger contours.
edge_coherenceFLOAT0.250–1Raise to remove strokes from noisy areas with conflicting directions.
blurFLOAT1.20–12Smooth the detection image only; the original photo stays sharp.
tone_gammaFLOAT1.60.1–4
fill_amountFLOAT0.500–1Full ASCII: tone-pattern opacity (use 1 for dense yellow). Mixed: shadow coverage. Edge only: unused.
invert_tonesBOOLEANfalse
backgroundCOMBO2 options: original, solid
background_colorSTRING#000000
maskoptMASKWhite permits the effect, black excludes it. Single mask broadcasts over the batch.

Outputs (2)

NameTypeDescription
imageIMAGE
effect_maskMASK