Nodes/ComfyUI PixelArt Detector/🎨PixelArt Palette Loader
ComfyUI Node

🎨PixelArt Palette Loader

The palette loader with 50+ retro palettes baked in (and a grid preview)

By dimtoneff·Created 3 years ago·Updated 10 months ago· 429
🎨PixelArt Palette Loader
    • paletteList
    image
    render_all_palettes_in_gridfalse
    grid_settingsGrid settings. The values will be forwarded to the 'PixelArt Palette Converter to render the grid with all palettes from this node.'
    paletteList_grid_font_size40
    paletteList_grid_font_color#f40e12
    paletteList_grid_background#fff
    paletteList_grid_cols6
    paletteList_grid_add_bordertrue
    paletteList_grid_border_width3

    The Palette Converter only has two palettes built in - NES and GAMEBOY. Everything else comes from here. PixelArtLoadPalettes scans the pack's palettes/1x folder at load time and gives you a dropdown of whatever palette PNGs are sitting there: over 50 lospec community palettes ship out of the box (DawnBringer 32, PICO-8, Sweetie-16, kirokaze-gameboy, a handful of Game Boy LCD variants), and it outputs a paletteList that wires straight into the Converter's paletteList input.

    How it works

    It's a thin node built on ComfyUI's LoadImage, but instead of returning the image it returns the palette data: it opens the chosen PNG, converts to "P" mode, and hands you the color table. There's no AI here, no processing - it's a file picker that outputs a LIST. Its two real features are:

    • Adding your own palettes. Lospec lets you download any palette as a 1px PNG. Drop it into ComfyUI/custom_nodes/ComfyUI-PixelArt-Detector/palettes/1x/, restart (or reload), and it appears in the dropdown. That's the whole game - the pack's palette library is just a folder you can grow.
    • The grid preview. Flip render_all_palettes_in_grid on and the node returns all palettes as one grid image, each rendering the same source. Connect it to the Converter and the Converter draws your image under every palette with labels - the fastest way to find "the one" for a given piece. The grid widgets (font size/color, background, columns, borders) control how that sheet looks.

    The inputs that matter

    • image - the palette picker (a dropdown of palette filenames, not an image input despite the name). 56 choices in the shipped pack.
    • render_all_palettes_in_grid - off by default; the on-switch for the grid sheet.
    • paletteList_grid_cols - columns in the grid, default 6.
    • paletteList_grid_font_size / font_color / background / border - cosmetic grid controls. Defaults are red-on-white; adjust if you want a look that doesn't hurt to stare at.

    The grid_settings string widget is help text - the real controls are the widgets below it.

    Output is a single paletteList (LIST). Feed it to the Converter's paletteList input. One subtlety: when it has multiple palettes (grid mode), the Converter switches into grid-rendering mode and draws the source image under every palette instead of converting it once - so the grid is a side-by-side comparison, not a single conversion.

    Installing the pack

    This node ships in dimtoneff/ComfyUI-PixelArt-Detector. Install via ComfyUI Manager (search "ComfyUI PixelArt Detector") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/dimtoneff/ComfyUI-PixelArt-Detector
    

    Restart ComfyUI. The pack auto-installs its Python dependencies on first load (opencv-python, scipy, pyclustering, Pillow, numpy); the pyclustering prebuilt wheel only targets x86_64, so other platforms may need a manual pip install pyclustering.

    Gotchas

    • New palettes require a restart - the file list is scanned when ComfyUI loads the node, not live.
    • The dropdown is palette filenames, which are ugly (dawnbringer-32-1x.png). The "a" annotation in the grid (the label under each swatch) is just the filename's stem, so name your files nicely.
    • If the node is red in a workflow you downloaded, the palette file may not exist on your install - the pack version you cloned might be older. Update the pack.
    • Grid rendering is done by the Converter, not this node. This node only provides the list; without a Converter downstream, render_all_palettes_in_grid does nothing visible.
    Categoryimage/PixelArt🕹️

    Inputs (9)

    NameTypeDefaultDescription
    imageCOMBO56 options: 1bit-monitor-glow-1x.png, 31-1x.png, apollo-1x.png, aquaverse-1x.png, black-and-white-1x.png, blk-aqu4-1x.png, +50
    render_all_palettes_in_gridBOOLEANfalse
    grid_settingsSTRINGGrid settings. The values will be forwarded to the 'PixelArt Palette Converter to render the grid with all palettes from this node.'
    paletteList_grid_font_sizeINT4014–120
    paletteList_grid_font_colorSTRING#f40e12
    paletteList_grid_backgroundSTRING#fff
    paletteList_grid_colsINT61–20
    paletteList_grid_add_borderBOOLEANtrue
    paletteList_grid_border_widthINT31–30

    Outputs (1)

    NameTypeDescription
    paletteListLIST