Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI-Krea2-Pixel-Art-Refiner > Krea 2 Pixel Art Refiner

ComfyUI Node: Krea 2 Pixel Art Refiner

Class Name

Krea2PixelArtRefiner

Category
image/krea2
Author
envy-ai (Account age: 826days)
Extension
ComfyUI-Krea2-Pixel-Art-Refiner
Latest Updated
2026-11-08
Github Stars
0.04K

How to Install ComfyUI-Krea2-Pixel-Art-Refiner

Install this extension via the ComfyUI Manager by searching for ComfyUI-Krea2-Pixel-Art-Refiner
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Krea2-Pixel-Art-Refiner in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Krea 2 Pixel Art Refiner Description

Refines images into crisp pixel art using perceptual palette reduction and grid collapse.

Krea 2 Pixel Art Refiner:

Krea2PixelArtRefiner, displayed as Krea 2 Pixel Art Refiner in the image/krea2 category, refines images into a more consistent pixel-art style by combining perceptual palette reduction with a regular pixel-grid collapse. Palette reduction simplifies the image’s colors, while grid collapse replaces each rectangular cell with its most frequently occurring color rather than blending the colors together. This helps create flat, clearly defined pixel blocks instead of the softened transitions associated with ordinary image resizing. When multiple colors are equally frequent within a cell, the provided implementation favors the color perceptually closest to the cell’s center color. You can choose which refinement operation happens first, allowing you to compare color simplification before pixel cleanup with pixel cleanup before color simplification. The node is useful for consolidating excessive color variation and regularizing pixel structure, but it relies on a grid you specify rather than automatically detecting the artwork’s existing pixel layout.

Krea 2 Pixel Art Refiner Input Parameters:

image

The required IMAGE to refine, which may contain one image or a batch of images. The node uses its dimensions to validate the logical pixel grid and requires at least three image channels, as found in RGB images. Each image in a batch receives its own palette reduction; this node does not offer a shared palette across the batch. Your source should have enough resolution to contain the intended grid, and its width and height must divide evenly by the corresponding logical grid dimensions. There is no default image or numeric range for this connection.

width

A required INT specifying the number of logical pixels across the refined image, not the size of each pixel block. The default is 64, the minimum is 1, the maximum is 16384, and the step is 1. A lower value creates fewer, wider blocks and removes more horizontal detail, while a higher value preserves more horizontal detail. The actual usable value is also limited by your source: it cannot exceed the source image width and must divide that width evenly. For example, a 512-pixel-wide image with width set to 64 is divided into cells that are 8 source pixels wide. When scale_to_original is disabled, this setting becomes the output image width; when enabled, it determines the logical grid while the output retains the source width.

height

A required INT specifying the number of logical pixels down the refined image. The default is 64, the minimum is 1, the maximum is 16384, and the step is 1. Lower values create fewer, taller blocks and simplify vertical detail, while higher values retain more vertical detail. The value cannot exceed the source image height and must divide that height evenly. For example, a 512-pixel-tall image with height set to 64 produces cells that are 8 source pixels tall. Together with width, this setting determines the grid’s proportions: mismatched horizontal and vertical cell sizes create rectangular rather than square pixel blocks. When scale_to_original is disabled, height is the output image height.

colors

A required INT setting the maximum number of colors requested for each image’s reduced palette. The default is 24, the minimum is 2, the maximum is 256, and the step is 1. Smaller values produce stronger color simplification and can help establish a limited-palette aesthetic, but may merge subtle shading or important details into the same color. Larger values retain more color variation, though they may also preserve unwanted variations in the source. This is a maximum rather than a requirement to use exactly that many colors, so the final image may contain fewer colors. Its effect also depends on processing order: before grid collapse it changes the colors competing within each cell, while after grid collapse it simplifies the colors of the already-established logical pixels.

color_reduction_first

A required BOOLEAN with options True and False; the default is True. When True, the node reduces each source image’s palette before collapsing the grid, allowing similar colors to be consolidated before the most frequent color in each cell is selected. When False, it first chooses the representative color for each grid cell from the original image, then reduces the palette of the collapsed result. These operations are not interchangeable: consolidating colors first can change which color wins within a cell, whereas collapsing first bases that choice on the original color frequencies. Comparing both settings is useful when small features, noisy shading, or uneven color variations affect the result.

scale_to_original

A required BOOLEAN with options True and False; the default is True. When True, the node expands the logical pixel grid back to the source image’s width and height, preserving the larger image dimensions while displaying the refined grid as pixel blocks. When False, it returns the compact logical grid itself, with dimensions equal to width by height. For example, refining a 512 × 512 image with a 64 × 64 grid produces a 512 × 512 result when enabled and a 64 × 64 result when disabled. Choose True when your workflow needs the original canvas size, or False when you need the actual low-resolution pixel artwork.

Krea 2 Pixel Art Refiner Output Parameters:

IMAGE

The IMAGE containing the refined result, or a batch of refined results when the input contains multiple images. Each result combines palette reduction with modal grid collapse in the selected order, so its visible content consists of representative grid-cell colors with a simplified palette. With scale_to_original enabled, the output retains the source image’s dimensions; with it disabled, the output dimensions are exactly width by height. This distinction matters when saving sprites, assembling sprite sheets, or passing the result into later image-processing nodes: a visually blocky large image and its compact logical-grid version represent the same grid at different canvas sizes. The output is an image rather than a separate palette, grid map, or analysis report.

Krea 2 Pixel Art Refiner Usage Tips:

  • Start with a source whose dimensions divide cleanly by your intended grid. For a 512 × 512 source, a 64 × 64 grid produces 8 × 8 source-pixel cells, while a 128 × 128 grid produces 4 × 4 cells.
  • Match the grid to the detail you want to preserve. If facial features, outlines, or small objects disappear, increase width and height to another valid divisor of the source dimensions before increasing colors.
  • Keep cell proportions in mind. For square pixel blocks, the source width divided by width should equal the source height divided by height. For example, a 768 × 512 source with a 96 × 64 logical grid produces square 8 × 8 blocks.
  • Use the default colors value of 24 as a starting point, then compare lower values such as 8 or 16 for stronger simplification and higher values such as 32 or 64 for more shading. Check important details at the actual logical resolution rather than judging only an enlarged preview.
  • Compare color_reduction_first set to True and False on difficult images. True can consolidate similar shades before cell selection, while False lets the original color frequencies determine each cell’s representative color before palette simplification.
  • Disable scale_to_original when preparing a compact sprite or low-resolution asset. Enable it when you need the original canvas dimensions for compositing or presentation.
  • If palette processing is expensive, consider color_reduction_first set to False together with scale_to_original set to False. In that configuration, palette reduction runs on the smaller logical-grid image rather than the full-resolution source, although total processing time still depends on your image, batch, and hardware.
  • Do not expect automatic grid detection, offset adjustment, uneven-grid support, or shared batch palettes. These controls are not part of this node’s interface; align or resize your source beforehand if its existing pixel structure does not match the chosen grid.

Krea 2 Pixel Art Refiner Common Errors and Solutions:

Krea 2 pixel art refinement requires at least 3 image channels, got 1

  • Explanation: The source has fewer than three image channels. This example shows a single-channel image, such as a grayscale tensor or mask supplied as an image; the number in the message reflects the actual channel count.
  • Solution: Convert the source into an RGB IMAGE before connecting it. If you are starting from a mask, use an appropriate mask-to-image conversion that produces an RGB image.

Logical grid 1024x64 cannot exceed image size 512x512

  • Explanation: At least one logical grid dimension is larger than the corresponding source dimension. The dimensions shown here are an example; the actual error reports your grid and image sizes. This node collapses an existing image into a grid rather than creating a grid with more cells than available source pixels.
  • Solution: Reduce width and height so neither exceeds the corresponding source dimension. For this example, a 64 × 64 or 128 × 128 grid fits the source. Also check divisibility, because fitting within the image is necessary but not sufficient.

Image size 500x500 must be divisible by logical grid 64x64

  • Explanation: The source cannot be divided into equally sized cells using the selected grid. Here, 500 is not evenly divisible by 64. The actual error includes your source and grid dimensions, and this node has no option to allow uneven cells.
  • Solution: Resize or crop the source to compatible dimensions, such as 512 × 512 for a 64 × 64 grid, or select a grid that divides the existing source evenly, such as 50 × 50 for a 500 × 500 image. Check both axes independently.

Out of memory or CUDA out of memory

  • Explanation: This is a possible framework or hardware error rather than a custom validation message from the node. Palette reduction and grid-color counting create intermediate data, so large source images or batches can exceed available memory; the exact wording depends on your environment.
  • Solution: Process fewer images at once, reduce the source resolution while keeping it divisible by the desired grid, and release memory used by other workflow stages where possible. You can also try color_reduction_first set to False with scale_to_original set to False to reduce the image size used by the palette-reduction stage, though the initial grid collapse still processes the source image.

Krea 2 Pixel Art Refiner Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Krea2-Pixel-Art-Refiner
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Krea 2 Pixel Art Refiner