ComfyUI PixelArt Detector v1.0

Generate, downscale and restore pixel art images with SDXL.

Save a picture as Webp (+optional JPEG) file in Comfy + Workflow loading.

Important

If you have an older version of the nodes, delete the node and add it again. Location of the nodes: "Image/PixelArt"

Description:

Pixel Art manipulation code based on: https://github.com/Astropulse/pixeldetector

This adds 4 custom nodes:

  • PixelArt Detector (+Save) - this node is All in One reduce palette, resize, saving image node
  • PixelArt Detector (mage->) - this node will downscale and reduce the palette and forward the image to another node
  • PixelArt Palette Converter - this node will change the palette of your input. There are a couple of embedded palettes. For more, please use the Palette Loader
  • PixelArt Palette Loader - this node comes with a lot of custom palettes which can be an input to the PixelArt Palette Converter "paletteList" input

The plugin also adds a script to Comfy to drag and drop generated webp|jpeg files into the UI to load the workflows.

The nodes are able to manipulate the pixel art image in ways that it should look pixel perfect (downscales, changes palette, upscales etc.).

Important

You can disable the embedded resize function in the nodes by setting W & H to 0.

Installation:

Use git clone https://github.com/dimtoneff/ComfyUI-PixelArt-Detector in your ComfyUI custom_nodes directory

Usage

Use LoRa: https://civitai.com/models/120096/pixel-art-xl

Drag the workflow.json file in your ComfyUI

Set the resize inputs to 0 to disable upscaling in the "Save" node.

Reduce palettes or completely exchange palettes on your images.

Extra info about the "PixelArt Detector (+Save)" Node:

There is a compression slider and a lossy/lossless option for webp. The compression slider is a bit misleading.

In lossless mode, it only affects the "effort" taken to compress where 100 is the smallest possible size and 1 is the biggest possible size, it's a tradeoff for saving speed.

In lossy mode, that's the other way around, where 100 is the biggest possible size with the least compression and 1 is the smallest possible size with maximum compression.

There is an option to save a JPEG alongside the webp file.

Extra info about the "PixelArt Palette Converter" Node:

The grid_size option is for the pixelize grid.Pixelate option. Size of 1 is pixel by pixel. Very slow. Increazing the size improves speed but kills quality.xperiment or not use that option.

Extra info about the "PixelArt Palette Converter" and "PixelArt Palette Loader" Nodes:

Included palettes from: https://lospec.com/palette-list

Important

If you like some palette, download the 1px one and add it to the "ComfyUI-PixelArt-Detector\palettes\1x" directory.

Here are some examples:

Example Example

Example Example

Example Example

Example Example

Example Example

Screenshot

Nodes: Example

Workflow view: Example

Examples

Normal image:

Example Example

Reduced palette:

Example Example

Example Example

Upscaled:

Example

Example

Credits

Big thanks to https://github.com/Astropulse/pixeldetector for the main code.

Big thanks to https://github.com/Kaharos94/ComfyUI-Saveaswebp for the webp saving code.

Big thanks to https://github.com/paultron for numpy-ifying the downscale calculation and making it tons faster.

Big thanks to https://lospec.com/palette-list and the creators of the awesome palettes.

S
Description
No description provided
Readme MIT
19 MiB
Languages
Python 83%
JavaScript 17%