ComfyUI Node
🎨PixelArt Palette Converter
A ComfyUI node in image/PixelArt🕹️ with 22 inputs and 1 output.
🎨PixelArt Palette Converter
- images
- paletteList
- IMAGE
â—„paletteGAMEBOYâ–ş
â—„resize_w512â–ş
â—„resize_h512â–ş
â—„resize_typecontainâ–ş
â—„pixelizeImage.quantizeâ–ş
â—„grid_pixelate_grid_scan_size2â–ş
â—„reduce_colors_before_palette_swapfalseâ–ş
â—„reduce_colors_methodImage.quantizeâ–ş
â—„reduce_colors_max_colors128â–ş
â—„apply_pixeldetector_max_colorstrueâ–ş
â—„image_quantize_reduce_methodMAXCOVERAGEâ–ş
â—„opencv_settingsOpenCV.kmeans: only when reducing is enabled.
RANDOM_CENTERS: Fast but doesn't guarantee same labels for the same image.
PP_CENTERS: Slow but will yield optimum and consistent results for same input image.
attempts: to run criteria_max_iterations so it gets the best labels. Increasing this value will slow down the runtime a lot, but improves the colors!
â–ş
â—„opencv_kmeans_centersRANDOM_CENTERSâ–ş
â—„opencv_kmeans_attempts10â–ş
â—„opencv_criteria_max_iterations10â–ş
â—„pycluster_kmeans_metricsEUCLIDEAN_SQUAREâ–ş
â—„cleanupClean up colors: Iterate and eliminate pixels while there was none left covering less than the 'cleanup_pixels_threshold' of the image.
Optionally, enable the 'reduce colors' option, which runs before this cleanup. Good cleanup_threshold values: between .01 & .05â–ş
â—„cleanup_colorsfalseâ–ş
â—„cleanup_pixels_threshold0.020â–ş
â—„ditherâ–ľâ–ş
Categoryimage/PixelArt🕹️
Inputs (22)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| palette | COMBO | GAMEBOY | 2 options: NES, GAMEBOY |
| resize_w | INT | 5120–2048 | — |
| resize_h | INT | 5120–2048 | — |
| resize_type | COMBO | contain | 3 options: contain, fit, stretch |
| pixelize | COMBO | Image.quantize | 3 options: Image.quantize, Grid.pixelate, NP.quantize |
| grid_pixelate_grid_scan_size | INT | 21–32 | — |
| reduce_colors_before_palette_swap | BOOLEAN | false | — |
| reduce_colors_method | COMBO | Image.quantize | 4 options: Image.quantize, OpenCV.kmeans.reduce, Pycluster.kmeans.reduce, Pycluster.kmedians.reduce |
| reduce_colors_max_colors | INT | 1281–256 | — |
| apply_pixeldetector_max_colors | BOOLEAN | true | — |
| image_quantize_reduce_method | COMBO | MAXCOVERAGE | 3 options: MAXCOVERAGE, MEDIANCUT, FASTOCTREE |
| opencv_settings | STRING | OpenCV.kmeans: only when reducing is enabled. RANDOM_CENTERS: Fast but doesn't guarantee same labels for the same image. PP_CENTERS: Slow but will yield optimum and consistent results for same input image. attempts: to run criteria_max_iterations so it gets the best labels. Increasing this value will slow down the runtime a lot, but improves the colors! | — |
| opencv_kmeans_centers | COMBO | RANDOM_CENTERS | 2 options: RANDOM_CENTERS, PP_CENTERS |
| opencv_kmeans_attempts | INT | 101–150 | — |
| opencv_criteria_max_iterations | INT | 101–150 | — |
| pycluster_kmeans_metrics | COMBO | EUCLIDEAN_SQUARE | 6 options: EUCLIDEAN, EUCLIDEAN_SQUARE, MANHATTAN, CHEBYSHEV, CANBERRA, CHI_SQUARE |
| cleanup | STRING | Clean up colors: Iterate and eliminate pixels while there was none left covering less than the 'cleanup_pixels_threshold' of the image. Optionally, enable the 'reduce colors' option, which runs before this cleanup. Good cleanup_threshold values: between .01 & .05 | — |
| cleanup_colors | BOOLEAN | false | — |
| cleanup_pixels_threshold | FLOAT | 0.0200.001–1 | — |
| dither | COMBO | 6 options: none, floyd-steinberg, bayer-2, bayer-4, bayer-8, bayer-16 | |
| paletteListopt | LIST | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |