GithubHelp home page GithubHelp logo

comfyui-pixelart-detector's Introduction

ComfyUI PixelArt Detector v1.0

Generate, downscale, change palletes 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". I've added some example workflow in the workflow.json. The example images might have outdated workflows with older node versions embedded inside.

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 (Image->) - 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. Use the Palette Loader for more
  • 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:

To use these nodes, simply open a terminal in ComfyUI/custom_nodes/ and run:

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

Restart ComfyUI afterwards.

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. Experiment 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.

comfyui-pixelart-detector's People

Contributors

dimtoneff avatar

Watchers

Joel Navez CT avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.