Nodes/Deforum Nodes/(deforum) ColorMatch Parameters
ComfyUI Node

(deforum) ColorMatch Parameters

Pick your anchor and color space

By XmYx·Created 3 years ago·Updated 3 months ago· 198
(deforum) ColorMatch Parameters
  • deforum_data
  • deforum_data
color_coherence
color_coherence_image_path
color_coherence_video_every_N_frames1
color_force_grayscalefalse
legacy_colormatchfalse

(deforum) ColorMatch Parameters is where you configure color coherence; the (deforum) Color Match node is where it happens. This is the parameters half of that pair - a config node in the deforum/parameters chain that decides whether to fight color drift, what to anchor the video's colors to, and which color space to do the matching in. It merges five settings into the deforum_data dict that flows to the rest of the pipeline, and it's where beginners should look first when their animation's colors crawl away from them over time.

The inputs that matter

  • color_coherence - the big one: None, HSV, LAB, RGB, Video Input, Image. None disables coherence entirely (color drift allowed). HSV and LAB are the usual picks for keeping natural colors - HSV matches hue/saturation, LAB works on perceptual color, and both preserve detail better than the naive RGB. Video Input anchors against frames of an init video; Image anchors against a static image (used with the image-path setting below).
  • color_coherence_image_path - when color_coherence is Image, this is the path to the reference image the animation will be graded toward.
  • color_coherence_video_every_N_frames - for Video Input mode: how often to refresh the color sample from the init video. Default 1 means grab a fresh reference every frame; higher values sample less often.
  • color_force_grayscale - force every frame to grayscale. A one-click noir filter, essentially; also a clean way to test whether coherence itself (vs. hue) is what's fixing your drift.
  • legacy_colormatch - use the old Deforum color-matching algorithm instead of the newer one. Flip it if the modern matcher produces oversaturation or artifacts on your content; it's a compatibility switch from the A1111 Deforum days.

How it works

Like every Deforum parameters node, it inherits the pack's config-merging base: take the incoming deforum_data dict, update it with these settings, pass it along. Nothing is computed here - the actual color remapping happens later in the Color Match node on each frame, which reads color_coherence (and the sample) out of this dict. So this node is configuration-as-data: chain it after (deforum) Base Parameters in the params row, and make sure the dict reaches the pipeline that runs the per-frame color node.

Installing it

Part of Deforum Nodes (XmYx). ComfyUI Manager → "Deforum Nodes", or:

cd ComfyUI/custom_nodes
git clone https://github.com/XmYx/deforum-comfy-nodes.git

Restart and let first-boot install.py finish (opencv-contrib-python, moviepy, numpy<2.0.0, deforum-studio backend). Python 3.10 per the README.

Where people get burned

The classic trap: setting color_coherence to Image but leaving color_coherence_image_path empty - the node then has no anchor, and behavior gets unpredictable. Set the path when you pick the mode. The second one is treating color_force_grayscale as a styling extra instead of what it is: a hard switch that strips all color from every frame, so don't leave it on by accident. And if your colors look oversaturated after enabling coherence, try LAB instead of HSV, or the legacy_colormatch toggle - the two algorithms genuinely disagree on aggressive content.

Categorydeforum/parameters

Inputs (6)

NameTypeDefaultDescription
color_coherenceCOMBO6 options: None, HSV, LAB, RGB, Video Input, Image
color_coherence_image_pathSTRING
color_coherence_video_every_N_framesINT1
color_force_grayscaleBOOLEANfalse
legacy_colormatchBOOLEANfalse
deforum_dataoptdeforum_data

Outputs (1)

NameTypeDescription
deforum_datadeforum_data