Nodes/Eden.art nodesuite/Animation RGB Mask
ComfyUI Node Runs on cloud

Animation RGB Mask

Color-coded animation regions, 12 ways

By edenartlab·Created 3 years ago·Updated 9 days ago· 120
Animation RGB Mask
    • IMAGE
    • num_colors
    • width
    • height
    ◄total_frames64►
    ◄num_colors3►
    ◄bands_visible_per_frame1.00►
    ◄angle0.00►
    ◄mode▾►
    ◄width512►
    ◄height512►

    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.

    CategoryEden 🌱/Mask

    Inputs (7)

    NameTypeDefaultDescription
    total_framesINT641–9223372036854776000Number of frames; the pattern completes one full cycle over this length, so the clip loops.
    num_colorsINT31–9223372036854776000Number of gray levels (bands) in the pattern.
    bands_visible_per_frameFLOAT1.00How many bands fit across the frame (ignored by the segment modes).
    angleFLOAT0.000–360Unused (kept for workflow compatibility).
    modeCOMBOShape and direction of the moving bands.
    widthINT51224–9223372036854776000Output width in pixels.
    heightINT51224–9223372036854776000Output height in pixels.

    Outputs (4)

    NameTypeDescription
    IMAGEIMAGEGrayscale animation frames.
    num_colorsINTNumber of gray levels.
    widthINTWidth in pixels.
    heightINTHeight in pixels.