Mix Palettes
Blend two palettes color by color, position by position
- palette_a
- palette_b
- mixed_palette
Mix Palettes is where this pack starts to feel like a real tool instead of a toy. Give it two palettes and a ratio, and it blends them position by position: slot 0 of A mixes with slot 0 of B, slot 1 with slot 1, and so on. You end up with one palette that's part A, part B, at every index. It's the palette-level version of Mix Colors, and it's the fastest way to make a whole ramp "lean warmer" or "go a bit more pastel" without touching a single slider.
The offset input is the interesting one. It shifts palette B before the mix - offset=2 means B's color 0 pairs with A's color 2. That's your alignment tool: if the shadows in A correspond to the midtones in B, offset aligns them so the blend produces a coherent ramp instead of a muddy smear. It's a small feature, but it's exactly the kind of thing you can't do by blending colors one at a time.
How it works
The node calls PixelPalette.mix_with_palette(other, ratio, color_space, offset). For each index, it checks whether palette A and palette B (at index - offset) both have a color there; if both exist, it mixes them with the same RGB/HSV machinery as Mix Colors; if only one exists, that color is copied through untouched. So the output length is the max of the two palette lengths - unmatched tail colors survive as-is rather than disappearing. Same RGB-vs-HSV caveat applies: RGB is linear and mud-prone, HSV follows the color wheel. For palette blending, HSV tends to keep ramps looking alive.
Inputs and outputs
palette_a,palette_b(PIXEL_PALETTE).ratio(FLOAT, 0.0–1.0, default 0.5) - 0.0 = all A, 1.0 = all B.color_space-rgborhsv.offset(INT, 0–255, default 0) - index shift applied to B.
Output: mixed_palette, a new PIXEL_PALETTE.
Installing
Part of the Pixel Palette Art pack. ComfyUI Manager → "Pixel Palette Art", or:
cd ComfyUI/custom_nodes
git clone https://github.com/ranska/pixel_palette_art.git
Restart ComfyUI; it's under pixel_art/palette. Only Pillow - no models or downloads.
Common issues
Unequal palette lengths are the subtle trap. It's not an error, and it won't warn you - the extra colors just get copied through unblended. If your mixed ramp suddenly has a hard tail of unchanged colors, that's why. Trim with Copy Subset first so both palettes are the same length, and the blend covers everything.
The offset can also hide in plain sight: forget it's set to 3 and your "blend" will look misaligned in a way that's hard to diagnose. Zero it out to sanity-check. And as ever, the output is an object - pair it with Palette View to see whether the blend actually landed where you wanted.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| palette_a | PIXEL_PALETTE | Première palette | |
| palette_b | PIXEL_PALETTE | Deuxième palette | |
| ratio | FLOAT | 0.500–1 | Ratio du mélange (0.0 = tout A, 1.0 = tout B) |
| color_space | COMBO | rgb | Espace colorimétrique pour le mélange |
| offset | INT | 00–255 | Décalage d'index pour la palette B |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| mixed_palette | PIXEL_PALETTE | — |