Nodes/Dream Project Animation Nodes/πŸ“Š Analyze Palette
ComfyUI Node

πŸ“Š Analyze Palette

Measure your color before it drifts away

By alt-key-projectΒ·Created 3 years agoΒ·Updated 2 years agoΒ· 114
πŸ“Š Analyze Palette
  • palette
  • brightness
  • contrast
  • redness
  • greenness
  • blueness

Long Deforum-style animations share one infuriating failure mode: they start with gorgeous colors and slowly, frame by frame, drift into darkness or shift hue until the ending looks nothing like the start. The Dream Project pack's answer is palettes - a compact summary of the colors in an image - and Analyze Palette [Dream] is the instrument that reads them. Feed it a palette and it tells you, in plain numbers, how bright, contrasty, red, green, and blue the source was. Those numbers become control signals that keep the next frame in line.

How it works

A palette in this pack is just a list of sampled RGB colors, produced by nodes like Sample Image as Palette [Dream]. Analyze Palette averages every color's channel values and normalizes them to the 0–1 range, giving five readouts:

  • brightness - average luminance (mean of R, G, B).
  • contrast - a histogram-based spread measure: how far the colors are from a single flat tone.
  • redness / greenness / blueness - the average of each channel on its own.

All five are FLOATs in the 0–1 range, so 1.0 is "fully saturated red" and 0.5 is "mid gray." There's one input - palette - and nothing else to set.

Where it wires in

The killer use case is color coherence over time. You sample a palette from your first frame, analyze it, and use the brightness/redness/greenness/blueness numbers to control a Palette Color Align [Dream] or Palette Color Shift [Dream] further down the graph - nudging every subsequent frame's palette back toward the original. The author's own workflow does exactly this: his early videos darkened frame by frame, and palette-based alignment fixed it. You can also just use it as a monitoring node - analyze a frame's palette, view the numbers, and see at a glance whether your video is drifting before you burn hours on a long render.

Installing it

Ships with Dream Project Animation Nodes - ComfyUI Manager (search Dream Project Animation) or clone https://github.com/alt-key-project/comfyui-dream-project into custom_nodes, pip install -r requirements.txt, restart. No model downloads.

Common issues

The most confusing bit is the input type: Analyze Palette takes an RGB_PALETTE, not an image. If you plug an IMAGE in and get a connection error, that's expected - run it through Sample Image as Palette (or Sample Image Area as Palette) first. Second, remember these are averages: a palette that's half pure red and half pure blue reads as "balanced" even though it's anything but. For spotting drift, brightness is usually the most honest signal. And because the values are normalized 0–1, not 0–255, don't be surprised when a "bright" image reads 0.7 rather than 200.

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

Inputs (1)

NameTypeDefaultDescription
paletteRGB_PALETTEβ€”

Outputs (5)

NameTypeDescription
brightnessFLOATβ€”
contrastFLOATβ€”
rednessFLOATβ€”
greennessFLOATβ€”
bluenessFLOATβ€”