PIL Effects (Mexx)
44 image filters, one dropdown — the line-art extraction is the reason to install
- image
- result_img
PIL Effects (Mexx) is a single IMAGE input, a dropdown with 44 choices, and one IMAGE out. That's the whole node, and it's basically a pocket Photoshop made of Pillow filters. Drop an image in, pick an effect, get the result straight back as a tensor you can keep wiring around your graph.
The headline feature is the 线稿 (line-art) family, LINE0 through LINE5. These extract clean sketch lines from a photo or render, and that's the thing this pack does that nothing else in base ComfyUI does with zero setup. The README is essentially a gallery of these filters, which tells you what the author cared about. Line art feeds straight into a ControlNet lineart model - that's the classic "reference + lineart" pipeline the KB notes keeps characters consistent across scenes. It also works as a quick sketch pass for a scribble ControlNet, or just to get a printable outline without touching GIMP.
The filters that matter
- 线稿-LINE0 / LINE1 - the two most interesting. These are a hand-rolled gradient-relief algorithm, not a stock filter: it computes image gradients, models a virtual light source, and shades a 3D "depth" surface. LINE1 adds a Gaussian blur and a sharpen pass before the same math, so it's smoother. Output is white with dark edges - exactly what a lineart ControlNet wants.
- 线稿-LINE2 through LINE5 - progressively fiddlier chains of
FIND_EDGES/CONTOUR, sharpen, and invert. Different flavors of edge map; LINE3.x are tuned variants. - 边缘检测-FIND_EDGES / 轮廓-CONTOUR / 灰度-L / 浮雕-EMBOSS / 反相-INVERT - the useful everyday ones.
- Everything else is stock Pillow: blur (BLUR, BOX_BLUR, GAUSSIAN_BLUR), sharpen (SHARPEN, UNSHARP_MASK, EDGE_ENHANCE), a median-filter denoise (去燥-中值滤波器), flips, rotations, and hardcoded contrast and color presets (对比度_0.8 to 5.0, 色彩_0.5 to 1.5).
How it works
The node converts your image tensor to a PIL Image, runs the chosen Pillow ImageFilter chain, and converts back. NO just passes the image through. It's decorated with a batch wrapper, so a batched image (say, frames out of a video pipeline) gets each frame processed independently - the effects are applied per-image, not across the batch.
The inputs you'll set
- image - any IMAGE tensor.
- image_filter - the dropdown. All 44 choices are in Chinese, which is the one real hurdle. Map: 线稿 = line art, 边缘检测 = edge detect, 轮廓 = contour, 灰度 = grayscale, 锐化 = sharpen, 模糊 = blur, 反相 = invert, 去燥-中值滤波器 = median denoise, 浮雕 = emboss, 对比度 = contrast, 色彩 = color, 翻转 = flip, 旋转 = rotate, 框 = white frame border.
- Output:
result_img(IMAGE) - wire it anywhere an image goes.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/SoftMeng/ComfyUI-PIL
Restart ComfyUI. Or use ComfyUI Manager and search "ComfyUI-PIL". That's the whole install: no requirements.txt, no model downloads, no extra pip. It only needs Pillow and numpy, which ComfyUI already ships. The clone does pull in roughly 55 MB of bundled Chinese fonts, but those belong to the sibling PIL TITLE node.
Gotchas
The dropdown is Chinese, no tooltips - bookmark the map above. The contrast and color adjustments are fixed presets, not sliders; you can't dial in 1.35, you get the 0.8/1.2/1.5/2.0/3.0/5.0 menu. The LINE filters output grayscale-ish RGB (not alpha), so don't expect transparency to survive. And for the record: this is a tiny side project from SoftMeng, the author better known for ComfyUI-DeepCache-Fix - it has essentially no community footprint, so treat it as a nice utility, not a maintained platform.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| image_filter | COMBO | NO | 44 options: NO, 线稿-LINE0, 线稿-LINE1, 线稿-LINE2, 线稿-LINE3, 线稿-LINE3.1, +38 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| result_img | IMAGE | — |