Nodes/ComfyUI-Rennart/🎨 Generate Posterize Gradient (Rennart)
ComfyUI Node

🎨 Generate Posterize Gradient (Rennart)

Hard-step gradient bands from a text recipe

By Rennart2025·Created 4 days ago·Updated 4 days ago· 2
🎨 Generate Posterize Gradient (Rennart)
    • IMAGE
    width512
    height512
    direction
    gradient_stops0:0,0,0 25:255,255,255 75:0,0,0

    Rennart Generate Posterize Gradient is the edgier sibling of the pack's smooth gradient node. Same family, same text-based stop syntax, but instead of interpolating smoothly between colors, it renders each interval as a solid band and steps to the next color at each stop. The result is a flat, posterized strip - the kind of hard-edged color ramp you'd get from a cheap halftone or a 90s vector graphic, not a buttery blend. If you're building retro flat-color looks, cel-style backgrounds, or just want a deterministic color ramp to use as a mask or reference image, this is the node.

    How it works

    The core is numpy linspace plus boolean masks, deliberately avoiding any per-pixel loops. It builds a position map across the image (0–100, horizontal or vertical), fills the whole canvas with the first stop's color, then for every interval between stops it paints all pixels inside that range with the start color of the interval. Pixels at or past the final stop get the last color. So your stops define hard boundaries, and there's no blending anywhere - that's the whole difference between this node and Rennart Generate Gradient, which linearly interpolates across the same syntax.

    This is also the mechanism behind the classic posterize gotcha: the visual outcome depends on where your stops land. Three stops at 0:black / 25:white / 75:black (the default) gives you a white band between positions 25 and 75, with black everywhere else. Move the stops and the bands move and re-size; you get exactly as many bands as you have stops minus one, plus the clamped end region.

    The inputs that matter

    • width / height - 64–4096, default 512.
    • direction - horizontal or vertical.
    • gradient_stops - same format as the smooth node: one stop per line, position:r,g,b, positions 0–100, RGB 0–255. The default 0:0,0,0 / 25:255,255,255 / 75:0,0,0 is a black-white-black demo worth studying once, since it shows exactly how interval painting works.

    Output is one IMAGE tensor, normalized 0–1, ready to plug into anything that takes an image.

    Install and gotchas

    Same pack, same install:

    # ComfyUI Manager: search "ComfyUI-Rennart", or:
    cd ComfyUI/custom_nodes
    git clone https://github.com/Rennart2025/ComfyUI-Rennart
    

    Restart ComfyUI and look under Rennart/Image. No models, no extra deps beyond torch/numpy.

    Two traps worth flagging. First, unlike the smooth variant, there's no tolerance input here - the posterizing is baked in, so if you want partial banding, this isn't the node (grab the smooth one and crank its tolerance instead). Second, the parsing strips all spaces, so a stop like 50:255, 255, 255 is fine but you can't rely on whitespace formatting to make things readable - keep the values tight. And if you're choosing between the two gradient nodes, this is the one to reach for when you want the bands; the other is for when you want a blend. Both are fast enough to regenerate on every tweak, so don't be shy about iterating on the stop text until the bands land where you want them.

    CategoryRennart/Image

    Inputs (4)

    NameTypeDefaultDescription
    widthINT51264–4096
    heightINT51264–4096
    directionCOMBO2 options: horizontal, vertical
    gradient_stopsSTRING0:0,0,0 25:255,255,255 75:0,0,0

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE