Nodes/Dream Project Animation Nodes/🎨 Palette Color Align
ComfyUI Node

🎨 Palette Color Align

Drag one palette toward another's mood

By alt-key-projectΒ·Created 3 years agoΒ·Updated 2 years agoΒ· 114
🎨 Palette Color Align
  • palette
  • target_align
  • palette
β—„alignment_factor0.5β–Ί

Color coherence in animation usually means "keep frame 40 looking like frame 1." Palette Color Align [Dream] is the tool for steering that - it takes your palette and shifts it toward a target palette by a controllable amount, like dragging one color identity closer to another. The README's description is precise: at an alignment_factor of 0.5 the result is nearly an average of the two palettes, at 0 nothing happens, and at 1 you land close to the target. Above 1 you overshoot past it. One slider, and you've got a "how much does this look like the target" dial.

The mechanism, from the source, is a per-channel average shift. It computes the average red, green, and blue of both palettes, then moves every pixel in your palette by (target_average βˆ’ source_average) Γ— factor, clamped to valid color range. That's a global color-cast operation, not a per-pixel matching - which is exactly right for the use case, because you're adjusting the feel of a palette, not doing fine color correction.

The inputs that matter

  • palette - your source RGB_PALETTE (the one you want to change).
  • target_align - the RGB_PALETTE you're moving toward. Sample it from a reference image with Sample Image as Palette.
  • alignment_factor - 0 to 10, default 0.5. 0 = no change, 0.5 β‰ˆ average, 1 = close to target, above 1 = overshoot.

Output is a single palette - the shifted result, ready to feed Noise from Palette or any downstream color consumer.

Installing it

Part of Dream Project Animation Nodes - ComfyUI Manager (search "Dream Project Animation Nodes") or:

cd ComfyUI/custom_nodes
git clone https://github.com/alt-key-project/comfyui-dream-project.git
cd comfyui-dream-project
pip install -r requirements.txt

Restart ComfyUI. The numpy<2.0 pin is the usual install quirk.

Common issues

Two things trip people up. First, it's a cast-shift, not a histogram match - if your palettes have wildly different brightness, the shift can clamp colors to the extreme (that's the overshoot behavior, not a bug). Second, batch alignment: palettes align pairwise, so palette[i] aligns to target[i]; mismatched batch sizes give you alignment on the overlap. If you want per-channel multiplication instead of an additive shift, that's the pack's Palette Color Shift. And the pack-wide note: the README says it's unmaintained, but this node runs fine on current ComfyUI.

Category✨ Dream/πŸŒ„ image/🎨 color

Inputs (3)

NameTypeDefaultDescription
paletteRGB_PALETTEβ€”
target_alignRGB_PALETTEβ€”
alignment_factorFLOAT0.50–10β€”

Outputs (1)

NameTypeDescription
paletteRGB_PALETTEβ€”