Nodes/ComfyUI-Apt_Preset/Image_precision_Converter
ComfyUI Node

Image_precision_Converter

Quantize an image down to 4-bit color

By cardenluo·Created 2 years ago·Updated 17 days ago· 309
Image_precision_Converter
  • image
  • low_precision
target_precision8-bit (uint8)

Despite living in the resize folder, this node has nothing to do with resolution - it's a color-depth reducer. Feed it an image and it hands back the same image with its per-channel precision knocked down, which in plain terms means fewer distinct color values per pixel and visible banding where there used to be a smooth gradient. Think posterize, but framed as a bit-depth conversion rather than a stylistic filter.

How it works

A normal image is 8-bit per channel - 256 possible values for red, green and blue each, which is what "uint8" means. This node can also target 4-bit ("uint4"), which is only 16 values per channel. Dropping from 256 to 16 levels doesn't blur anything; it buckets each pixel's value into the nearest of those 16 steps. Skies band into visible stripes, skin tones flatten into blocks, and anything that relied on subtle gradation gets chunky. It's the same math a retro-game palette reducer or a deliberately lo-fi filter uses - you're throwing away precision on purpose.

Where this is actually useful: testing how a downstream model or a compression pipeline handles degraded input, building a stylized/retro look on purpose, or exaggerating banding artifacts for a specific aesthetic. It is not an upscaler, not a compressor, and it won't reduce your file size on its own - it just collapses the value range before whatever you do next.

The inputs and outputs that matter

Only two fields, and one of them is basically the whole node:

  • image (IMAGE) - what you're quantizing.
  • target_precision - a dropdown with exactly two options: 8-bit (uint8) (the default, i.e. no-op - a normal image) and 4-bit (uint4). There's no in-between here; the schema only exposes these two levels, so if you want a gentler posterize (say, 5- or 6-bit) this isn't the node for it.

The single output is low_precision (IMAGE) - wire it straight into whatever comes next, whether that's a save node, a further effect, or back into a sampler as img2img input if you want the banding to bleed into the generation.

How to install it

Easiest path is ComfyUI Manager - search ComfyUI-Apt_Preset, install, restart. By hand:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset
pip install -r requirements.txt

then restart. The repo ships an install.bat for double-click installs on Windows, but on Linux (which is what comfy.icu's executor runs) that script doesn't apply - pip install -r requirements.txt is the real install step. No model downloads needed for this particular node; it's pure pixel math.

Common issues

This is one node inside a genuinely large pack - over a hundred nodes spanning loaders, video, audio and data-processing tools - and its requirements.txt reflects that scope: onnxruntime, gguf, transparent-background, scenedetect, soundfile and more, none of which this specific node touches. That's the trade-off of an all-in-one pack - one install pulls in dependencies for nodes you may never use, and there's a real report on r/comfyui of a fresh ComfyUI-Apt_Preset install failing to import outright. If you hit that, don't guess: scroll up in the ComfyUI console - the actual missing-package error prints above the generic IMPORT FAILED line - fix that package, then re-run pip install -r requirements.txt (or use Manager's reinstall).

The other thing to know going in: don't expect subtlety. If you were hoping for a mild "reduce a bit of noise" effect, 4-bit (uint4) is a much harder cut than it sounds - 16 levels per channel is a dramatic drop from 256, and there's no dial to soften it. If the result looks too aggressive, this node genuinely only has the one other setting (8-bit, which does nothing), so the fix is to not use 4-bit rather than to tune it down.

CategoryApt_Preset/image/ImgResize

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
target_precisionCOMBO8-bit (uint8)2 options: 8-bit (uint8), 4-bit (uint4)

Outputs (1)

NameTypeDescription
low_precisionIMAGE