Nodes/ComfyUI_agilly1989_motorway/ImageQuantize_motorway_edition
ComfyUI Node

ImageQuantize_motorway_edition

Palette size plus dithering

By agilly1989·Created 2 years ago·Updated about a year ago· 7
ImageQuantize_motorway_edition
  • MOTORWAY 🚌💨
  • MOTORWAY 🚌💨
INPUT_image_keyimage
colors256
dither
OUTPUT_IMAGE_keyIMAGE

Quantization is how you force a smooth photo-like image into a limited palette - the trick behind posterization and a lot of pixel-art looks. ImageQuantize_motorway_edition is stock ComfyUI's ImageQuantize, wrapped for the MOTORWAY 🚌💨 pipe in agilly1989/ComfyUI_agilly1989_motorway.

It reads the image out of the pipe under INPUT_image_key (default "image"), reduces it to a set number of colors, and stores the result back under OUTPUT_IMAGE_key (default "IMAGE"). The only visible output is the Motorway pipe - the quantized image is parked in the pipe under that key.

Inputs that matter

  • INPUT_image_key (default "image") - pipe key of the source
  • colors (INT, 1 to 256, default 256) - how many distinct colors the result can use. Lower is more aggressively posterized
  • dither - none, floyd-steinberg, bayer-2, bayer-4, bayer-8, bayer-16
  • OUTPUT_IMAGE_key (default "IMAGE") - where the result lands

The dither choice is the aesthetic dial. With none you get hard, flat bands of color - clean and graphic. Floyd–Steinberg scatters noise between neighboring pixels so the eye blends them into more apparent colors, which keeps gradients readable at low palette counts. The bayer-* options are ordered (checkerboard-style) dithering; higher numbers give finer patterns. For pixel-art, colors around 16–64 with no dither is the classic look; for a "paint-by-numbers" poster, 8 or fewer colors lands closer to where you're going.

How it works

Standard clone mechanics: pop the Motorway, pull the image via the input key, run stock ImageQuantize with colors and dither, store the result under the output key, and return a cloned pipe so nothing upstream is mutated. Underneath, it's the exact node ComfyUI ships - the only thing this pack adds is the key-based plumbing.

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/agilly1989/ComfyUI_agilly1989_motorway

Restart ComfyUI, or install via ComfyUI Manager (search "motorway"). Pure Python, no requirements.txt, no model downloads.

Gotchas

Keys are exact and case-sensitive; a 'MotorwayClass' object has no attribute 'hash_' error means your key string matches nothing in the pipe. Mind the case default - you read "image" (lowercase) and write "IMAGE" (uppercase), so a chain of clones needs keys you set to match. And the family status: BETA, with the motorway_edition clones disabled in the 1.1.7 hotfix - if it's not in your menu, stock ImageQuantize does the identical job with wires.

Categoryagilly1989 Nodes/Motorway-ed/image/postprocessing

Inputs (5)

NameTypeDefaultDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨
INPUT_image_keySTRINGimage
colorsINT2561–256
ditherCOMBO6 options: none, floyd-steinberg, bayer-2, bayer-4, bayer-8, bayer-16
OUTPUT_IMAGE_keySTRINGIMAGE

Outputs (1)

NameTypeDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨