π Compare Palettes
The node that stops long animations from drifting into a different color world
- a
- b
- brightness_multiplier
- contrast_multiplier
- red_multiplier
- green_multiplier
If you've ever run a long Deforum-style animation and watched it slowly slide from "warm sunset" into "grey mush", you've hit the exact problem this node was built to solve. Compare Palettes [Dream] takes two palettes - a reference of the colors you want, and the colors your animation is actually producing - and works out the multipliers that would turn one into the other. Feed those back into an Image Color Shift node and your frames stay glued to the intended look.
This palette machinery is the flagship feature of the Dream Project Animation Nodes pack. The author (qaozmojo of the Alt Key Project music channel) announced it on r/comfyui in September 2023 specifically because his own video "would get darker and darker" over a long sequence, and color alignment through palettes fixed it. The pack is no longer updated - the author moved on to comfyui-dream-video-batches - but the palette nodes still work and are the pack's most interesting idea.
What it actually computes
A palette in this pack is a small collection of RGB color values (sampled from an image via the "Sample Image as Palette" nodes). Compare Palettes takes two of them, a and b, and for each matched pair of colors it computes the ratio b/a for brightness, contrast, and each color channel - with a floor of 1/255 so a black pixel never causes a divide-by-zero. Those ratios get averaged across the palette and come out as the node's outputs:
brightness_multipliercontrast_multiplierred_multipliergreen_multiplier
Each output is the factor you'd multiply palette a's corresponding attribute by to get palette b's. Roughly: 1.0 means "already matching", 1.2 means "b is 20% brighter here", 0.8 means "b is dimmer".
The workflow it unlocks
The color-coherence loop the author published as an example workflow: sample a palette from your reference image, sample another from your current frame, compare them, and pipe the multipliers into Image Color Shift on the current frame. Frame after frame, the color drift gets corrected automatically instead of accumulating. It's not magic - the math is simple ratios - but for frame-by-frame animation it's exactly the right lever, and it's the reason people still reach for this pack years after it stopped being updated.
Getting it
cd ComfyUI/custom_nodes
git clone https://github.com/alt-key-project/comfyui-dream-project.git
Or install via ComfyUI Manager ("Dream Project Animation"). Pure Python, no model downloads - the whole pack only pulls in imageio, scipy, torchvision, pilgram, and evalidate. One dependency gotcha: the pack pins numpy<2.0, which can clash with newer packs. You'll find it under Dream β image β color.
Fair warning: palette quality is everything. A badly sampled palette (too few pixels, mostly background) gives you multipliers that fight the picture. Pair it with the "Sample Image as Palette" nodes and tune until the comparison numbers sit near 1.0 when things look right.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| a | RGB_PALETTE | β | |
| b | RGB_PALETTE | β |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| brightness_multiplier | FLOAT | β |
| contrast_multiplier | FLOAT | β |
| red_multiplier | FLOAT | β |
| green_multiplier | FLOAT | β |