Animation_RGB_Mask
Color-coded animation regions, 12 ways
- IMAGE
- num_colors
- width
- height
Ever seen those animations where different parts of an image change one after another - the background blinks first, then the mid-ground, then the subject - and wondered how the workflow knows which region is "active" at any moment? Animation_RGB_Mask is that machinery. It generates an animation of color-coded masks: each frame assigns distinct colors to distinct regions, and the regions sweep, rotate, or pulse over time according to one of 12 modes. Downstream, you interpret each color as a region id and drive per-region effects.
It's the direct sibling of Animated Shape Mask in the Eden pack. Where the shape node gives you clean grayscale sweeps, this one hands you labeled regions - think of it as a paint-by-numbers video where the palette and the regions both animate.
How it works
Internally it builds an Animation object at your width/height with num_colors colors and total_frames frames, then renders each frame and stacks them into an IMAGE batch. The modes:
- concentric_circles/rectangles_ - nested rings or boxes expanding inwards or outwards; each ring gets its own color.
- rotating_segments_ - a color wheel's worth of wedge segments spinning clockwise or counter-clockwise.
- pushing_segments_ - like rotating but the segments visibly push the previous one along the frame.
- vertical/horizontal_stripes_ - stripe columns or rows marching left/right or up/down.
The two controls you'll actually tune:
- num_colors (default 3) - how many distinct regions exist per frame. More colors = more regions, so more independent animation channels downstream.
- bands_visible_per_frame (default 1) - how many color bands are visible at once; raise it to overlap regions.
- angle (default 0) - rotates the whole pattern, which is how you angle stripes or wedges to match your subject.
Outputs are IMAGE (the stacked animation), plus num_colors, width, and height echoed as INTs.
What it's actually for
The practical pattern, which Eden's own video workflows use, is: color-code the frame, then map each distinct color to a different prompt or mask target. Region 0 gets inpainted with prompt A, region 1 with prompt B, and because the regions are color-labeled you can extract each one as a clean mask per frame. Combined with the KB's inpainting insight - that masked inpainting uniquely leaves everything else pixel-identical - you get frame-consistent regional animations without full-video regeneration. That's the whole trick behind those "objects morph in sequence" videos: it's not one prompt animating the scene, it's a labeled mask deciding where each change is allowed.
Installing
Part of edenartlab/eden_comfy_pipelines (Eden.art nodesuite), installed once for everything:
cd ComfyUI/custom_nodes
git clone https://github.com/edenartlab/eden_comfy_pipelines.git
cd eden_comfy_pipelines
pip install -r requirements.txt
Or ComfyUI Manager β search "Eden". No extra model downloads - it's pure numpy/pytorch rendering.
Gotchas
Watch your resolution: total_frames at, say, 1024Γ1024 stacked into one tensor gets heavy fast. Also, like its sibling, the output is IMAGE not MASK - if you're feeding a KSampler, convert to MASK and threshold per color first. And the echo outputs (num_colors, width, height) are handy for keeping downstream nodes in sync, but they're plain values - don't expect them to update live as you drag sliders mid-run; you'll re-run the graph like any ComfyUI node.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| total_frames | INT | 641β9223372036854776000 | β |
| num_colors | INT | 31β9223372036854776000 | β |
| bands_visible_per_frame | FLOAT | 1.00 | β |
| angle | FLOAT | 0.000β360 | β |
| mode | COMBO | 12 options: concentric_circles_inwards, concentric_circles_outwards, concentric_rectangles_inwards, concentric_rectangles_outwards, rotating_segments_clockwise, rotating_segments_counter_clockwise, +6 | |
| width | INT | 51224β9223372036854776000 | β |
| height | INT | 51224β9223372036854776000 | β |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |
| num_colors | INT | β |
| width | INT | β |
| height | INT | β |