Nodes/Krea 2 and MiniMax H3 Pixel Art Refiners/MiniMax H3 Pixel Art Refiner
ComfyUI Node

MiniMax H3 Pixel Art Refiner

Same grid collapse, now with batch palettes and grid offsets

By envy-ai·Created 3 days ago·Updated about 18 hours ago· 9
MiniMax H3 Pixel Art Refiner
  • image
  • palette_image
  • IMAGE
width64
height64
colors24
color_reduction_firsttrue
scale_to_originaltrue
allow_uneven_gridfalse
shared_palettefalse
x_offset0.00
y_offset0.00
auto_offsetfalse

If you're running MiniMax H3 for video and want the output to read as actual pixel animation rather than "retro-looking", you need the same deterministic clean-up pass stills need: collapse the pseudo-pixel grid to real pixels and quantize the palette. This is the batch-shaped version, and it's the one you want the moment you have more than one frame.

Three refiners ship in this pack. Krea 2 Pixel Art Refiner is the minimum-viable version for a single image. MiniMax H3 Pixel Art Autorefiner detects the grid for you. This one - plain MiniMax H3 Pixel Art Refiner - sits in the middle and is the superset: everything the Krea 2 node does, plus the four controls that matter for animation.

What it does, and what it adds

The core is identical to its siblings, and it works: unique colours map to a weighted OKLab k-means palette capped at colors, then each grid cell picks its most frequent 8-bit RGB value, ties broken by perceptual closeness to the cell's centre pixel in OKLab, then raster order. Deterministic, modal rather than averaged, so highlights survive.

What's extra here:

  • shared_palette (default off) builds one palette across the entire batch instead of one per image. Turn this on for video. Per-frame palettes are the single worst thing you can do to an animation - the palette drifts frame to frame and every flat region shimmers. One palette for the whole batch is what makes the result look like it was drawn, not regenerated.
  • palette_image (optional) is the hard lock: use the colours from a reference image as the palette for every frame. Feed it a sprite sheet, an Aseprite export, or a period palette. If your reference has no more unique RGB values than colors, those exact colours are used untouched; bigger palettes get perceptually reduced first, and the first input image's upper-left colour is appended so a differing background stays available. This overrides shared_palette.
  • x_offset / y_offset shift the grid by a fraction of one logical pixel (0.0–1.0), for when the model's pixel grid doesn't start where the image edge does. Landing half a pixel off-phase gives you a characteristic smear down every edge; nudging to 0.2 or 0.5 fixes it outright. Offsets wrap at the outer edges rather than cropping, so check the borders after a big shift.
  • auto_offset detects the X and Y grid phase for every image separately and overrides the manual offsets, looking for the strongest repeating edge phase along each axis. A flat margin contributes nothing, and an axis with no repetition falls back to zero. Cheap to try, usually right.
  • allow_uneven_grid drops the divisibility requirement the Krea 2 node enforces. Cells end up very slightly different sizes, which is fine for a preview and mildly wrong for a real asset - prefer a grid that divides evenly when you can.

color_reduction_first and scale_to_original behave exactly as on the Krea 2 node: reduce-then-collapse is the default and keeps the output strictly palette-conformant; turning scale_to_original off returns the true logical resolution instead of re-expanding to input size.

In goes image - a single image, an image batch, or a decoded video-frame batch. Out comes one IMAGE output, batch preserved, and the batch/shared_palette/palette_image/offset machinery is the reason to pick this node over the Krea 2 one.

Installing

Same pack, same one-time install. In ComfyUI Manager, search ComfyUI-Krea2-Pixel-Art-Refiner. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/envy-ai/ComfyUI-Krea2-Pixel-Art-Refiner.git krea2_pixel_art_refiner

Restart, then find this node under image/minimax. No weights, no API key, nothing to download. The pack declares exactly one dependency, opencv-python-headless>=4.8; that's for the autorefiner's edge detection, and the pack is written against ComfyUI's newer comfy_api node API, so an old install that errors on import just needs updating.

Where people get burned

The divisibility error, again. Without allow_uneven_grid, 1024x768 must be divisible by logical grid 64x64 is a hard failure. Video resolutions are the usual trigger - 1280×720 divides nicely by 64×36, not by 64×64.

Palette per frame instead of per batch. Leave shared_palette off on a 60-frame batch and you'll spend an evening wondering why the colours crawl.

Offsets fighting auto_offset. auto_offset wins - if it's on, your manual x_offset and y_offset are ignored entirely. Turn detection off before you hand-tune.

Setting colors too high. 24 is already generous for game art. Above roughly 32 you're paying in palette drift what you gain in shading, and the point of the pass is that the palette is limited. Want more shades inside a small palette? Dither elsewhere; this node doesn't dither, and adding a dither pass after it is what most people do.

Wire the output into Save Image for stills, or Create Video for animation. If your clip contains repeated animation cycles rather than continuous motion, run the result through Pixel Art Animation Pose Compositor next - that's what it's for.

Categoryimage/minimax

Inputs (12)

NameTypeDefaultDescription
imageIMAGE
widthINT641–16384Number of logical pixels across the refined image.
heightINT641–16384Number of logical pixels down the refined image.
colorsINT242–256Maximum number of colors in each image's palette.
color_reduction_firstBOOLEANtrueReduce the palette before grid collapse. Disable for collapse-then-reduce behavior.
scale_to_originalBOOLEANtrueExpand the logical pixel grid back to the input dimensions.
allow_uneven_gridBOOLEANfalseAllow input dimensions that are not evenly divisible by the logical grid.
shared_paletteBOOLEANfalseGenerate one palette from the entire image batch instead of a separate palette for each image.
x_offsetFLOAT0.000–1Shift the grid right by this fraction of one logical pixel.
y_offsetFLOAT0.000–1Shift the grid down by this fraction of one logical pixel.
auto_offsetBOOLEANfalseDetect the X and Y grid phase separately for each image. Overrides x_offset and y_offset.
palette_imageoptIMAGEUse this image's colors as the palette for the entire batch. Palettes above colors are reduced first. Overrides shared_palette.

Outputs (1)

NameTypeDescription
IMAGEIMAGE