Nodes/ComfyUI_UnfakePy_Warpper/Unfake Pixelate Tools
ComfyUI Node

Unfake Pixelate Tools

On-grid, quantized, and clean

By AhBumm·Created 11 months ago·Updated 9 months ago· 2
Unfake Pixelate Tools
  • image
  • align_img
  • align_info
max_colors0
detect_methodauto
downscale_methoddominant
cleanup_morphtrue
cleanup_jaggiesfalse
transparent_backgroundfalse

This is the node the whole pack exists for. If you've ever generated with a pixel-art LoRA - Pixel Art XL, one of the FLUX pixel LoRAs, anything in that family - you know the problem: the output looks like pixel art from across the room, and then you zoom in and it's off-grid, soft-edged, and carrying 300-plus colors. Real pixel art is a grid of aligned, flat-color blocks, and diffusion models are terrible at committing to one. This node fixes it in one pass: detect the real pixel scale, quantize to a sane palette, downscale block-by-block, and snap everything onto the grid.

Where it comes from

The pack is a ComfyUI wrapper around the unfake Python library, a Rust-accelerated port of jenissimo/unfake.js. That project's browser tool, "Unfaker," launched on r/StableDiffusion in July 2025 to a genuinely warm reception (the post sits at +639) - it was one of those "wait, this actually works" moments for people making sprites for game engines. This node hands you the same pipeline without leaving ComfyUI, and it's all CPU - no model downloads, no GPU, and roughly half a second per megapixel.

How it works

Under the hood it calls unfake.process_image_sync with a four-stage pipeline: scale detection (so it knows how big the "pixels" really are), Wu color quantization to collapse gradients into a crisp palette, block-wise downscaling using the dominant color in each block, and grid snapping so every block lands exactly. The detect_method input (auto/runs/edge) picks which scale-detection strategy gets used; auto tries both. downscale_method (dominant/median/mode/mean/content-adaptive) chooses how each block's color is decided - dominant is the default and usually the right call for pixel art, content-adaptive is higher quality but slower.

The inputs that actually matter

  • max_colors - cap on palette size (0–256). 0 means auto-detect the color count, which is the setting to leave on unless you have a specific palette size in mind, like 16 for a real retro feel.
  • cleanup_morph (default on) - morphological cleanup that fills stray holes and smooths 1-pixel noise. Leave it on.
  • cleanup_jaggies (default off) - removes the stair-step artifacts on diagonal edges. It's more aggressive; turn it on when edges look ragged, off when it's eating fine detail.
  • transparent_background - flood-fills the background out from the edges and hands you an alpha channel. Great for sprites, but it assumes a uniform background touching the borders.

Two outputs come back: align_img (the cleaned image) and align_info, a short string like 128x128px_c16 - final size plus color count. Wire align_img into a preview or save; the string is handy for filenames or a text display.

Installing it

ComfyUI Manager → Install Custom Nodes → search for ComfyUI_UnfakePy_Warpper (the pack displays as ComfyUI_UnfakePy_Warpper). Or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/AhBumm/ComfyUI_UnfakePy_Warpper

Restart ComfyUI. The pack's real dependencies, straight from its requirements.txt, are unfake==1.0.7 and nest_asyncio - the unfake install pulls in opencv-python, Pillow, and NumPy, and needs Python 3.10+. Nothing else, no weights to fetch. (The README is famously thin - "Warp Unfake.py for ComfyUI" - so the source and PyPI metadata are the ground truth here.)

Where people get burned

The most common complaint in the original tool's thread is the same one you'll hit here: when part of the image isn't aligned to the pixel grid - eyes are the classic - the quantizer can blend two colors into one muddy pixel because it has to decide what that block "really" was. That's a property of the source, not a bug. If you're losing detail, try max_colors up or content-adaptive downscaling. And remember this node is a cleaner, not an upscaler - the output comes back at the pixel art's true scale (a "128x128" render stays 128x128, just clean). Pair it with an integer upscaler like this pack's Image Upscale By Integer when you need to display it big.

CategoryBillBum/PixelTools

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
max_colorsINT00–256
detect_methodCOMBOauto3 options: auto, runs, edge
downscale_methodCOMBOdominant5 options: dominant, median, mode, mean, content-adaptive
cleanup_morphBOOLEANtrue
cleanup_jaggiesBOOLEANfalse
transparent_backgroundBOOLEANfalse

Outputs (2)

NameTypeDescription
align_imgIMAGE
align_infoSTRING