ComfyUI Node

MX_Posterize

Strip an image down to a handful of colors, dither optional

By Intersection98·Created 2 years ago·Updated 2 years ago· 13
MX_Posterize
  • image
  • IMAGE
colors16
dither

MX_Posterize reduces an image to a limited palette - 16 colors, 8 colors, whatever you set - flattening gradients into bold bands of flat color. It's the classic posterize look: smooth skies become visible bands, skin tones collapse into a few shades, and everything gets a graphic, almost silk-screen quality. It's one of those effects you either want exactly or never, and this node makes the "exactly" case one input away.

It's part of Intersection98/ComfyUI-MX-post-processing-nodes. Under the hood it's implemented as the pack's Quantize class, which tells you the mechanism: proper color quantization, not a cheap hack.

How it works

The node uses Pillow's quantize - it builds an adaptive palette of colors entries fitted to your actual image (rather than a fixed 8-bit grid), then maps every pixel to its nearest palette color. That adaptive step matters: the palette is chosen per-image, so a sunset posterizes differently from a portrait, and the dominant hues stay dominant instead of being forced into predefined buckets.

The dither input is where you get a choice. With none, flat bands of color with hard edges - the stark, graphic look. With floyd-steinberg, error-diffusion dithering scatters tiny dots of color between bands, which tricks the eye into seeing smooth gradients with far fewer colors. Floyd–Steinberg is the standard pick when you want a low-color count without the posterized banding, e.g. for a web-optimized palette.

The inputs that matter

  • image - your IMAGE tensor.
  • colors - 1 to 256, default 16. The size of the palette. 16 is a classic poster count; 4–8 gets aggressively graphic; 256 is nearly lossless. Lower counts with dither = none give the strongest, most stylized bands.
  • dither - none or floyd-steinberg.

Output is a single IMAGE, same resolution, now quantized.

Install

Standard MX pack install. ComfyUI Manager (search MX or ComfyUI-MX-post-processing-nodes), or:

cd ComfyUI/custom_nodes
git clone https://github.com/Intersection98/ComfyUI_MX_post_processing-nodes
cd ComfyUI_MX_post_processing-nodes
pip install -r requirements.txt

Restart ComfyUI; it sits under postprocessing/Color Adjustments. No models, no downloads - pure Pillow.

Where people get burned

The two big ones. First, no-dither posterization destroys fine detail on purpose, and at low colors counts it can create ugly banding across skin and sky - if that's not the look you wanted, enable floyd-steinberg rather than raising colors, because dithering is what actually rescues gradients. Second, the quantization palette is rebuilt per image, which means posterizing a batch (e.g. a video's frames) gives each frame a slightly different palette - colors will visibly shift frame to frame. For consistent styling across a series, posterize each frame and run them through a common LUT or MX_ColorMatch afterwards. And if your posterize looks nothing like the "retro poster" you had in mind, remember this node is color-quantization, not the Solarize-style threshold inversion - different effect, same pack.

Categorypostprocessing/Color Adjustments

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
colorsINT161–256
ditherCOMBO2 options: none, floyd-steinberg

Outputs (1)

NameTypeDescription
IMAGEIMAGE