Nodes/Orion4D_layer_manager/🎨 Fill / Gradient Generator v2
ComfyUI Node

🎨 Fill / Gradient Generator v2

A gradient generator that also hands you the masks

By orion4dΒ·Created about a month agoΒ·Updated about a month agoΒ· 2
🎨 Fill / Gradient Generator v2
    • image
    • full_mask
    • border_mask
    • settings_json
    β—„width1024β–Ί
    β—„height1024β–Ί
    β—„fill_modesolidβ–Ί
    β—„color_count1β–Ί
    β—„color_1#FFFFFFβ–Ί
    β—„color_2#FFFFFFβ–Ί
    β—„color_3#FFFFFFβ–Ί
    β—„color_4#FFFFFFβ–Ί
    β—„invertfalseβ–Ί
    β—„angle0β–Ί
    β—„center_x0.50β–Ί
    β—„center_y0.50β–Ί
    β—„inner_border_px0β–Ί
    β—„border_color#FFFFFFβ–Ί
    β—„border_opacity1.00β–Ί

    Most ComfyUI nodes need an input image to do anything. The Fill / Gradient Generator v2 is one of the exceptions: give it a width, a height and some colors and it renders a fill or gradient from nothing. It's part of the Orion4D Layer Manager pack, and it earns its keep in layer work three ways - as a background canvas, as a source of gradient mats for compositing, and as a way to mint a border/frame mask without touching a paint app.

    How it works

    The generator is a pure pixel pass, no neural anything. It builds normalized coordinates across the canvas, computes a distance or projection per pixel depending on the fill mode, and maps that to a 0–1 gradient position that walks your color stops. The six modes - solid, linear, radial, angular, reflected, diamond - are just different ways of computing that position: angle rotates the linear/angular projection, and center_x/center_y (normalized 0–1, both default 0.5) move the radial/diamond center around. invert flips the position so the gradient runs backwards.

    The genuinely useful part is that it outputs masks alongside the image. full_mask is a white rectangle of the whole canvas. border_mask is white only along the canvas edges, sized by inner_border_px (0–200). You can wire those masks straight into other nodes - a border mask is exactly what you want for adding a matte frame to a composite, and a full mask is the "paint everything here" token that keeps a mask-based pipeline flowing. There's also a settings_json STRING output that round-trips the whole configuration, so the state is never lost between the node and its editor app.

    The inputs that matter

    • width, height - canvas size, up to 8192. Bigger is slower but it's just numpy math, so even 4K renders in a blink.
    • fill_mode - the shape of the gradient. solid ignores the stops and just fills with color_1.
    • color_count (1–4) plus color_1…color_4 - how many stops, and their hex colors. Only the active count is used.
    • invert, angle, center_x/center_y - the geometry knobs above.
    • inner_border_px, border_color, border_opacity - an inner border strip drawn inside the canvas edge. Set 0 to skip.

    Outputs

    image (RGB), full_mask (MASK), border_mask (MASK), and settings_json (STRING). The typical chain: use the gradient as a background layer, feed the border mask into a compositing or blur node to build the frame effect.

    Install

    Same as the rest of the pack - no models, no extra dependencies, just the NumPy/Pillow/PyTorch a stock ComfyUI already ships:

    cd ComfyUI/custom_nodes
    git clone https://github.com/orion4d/Orion4D_layer_manager
    

    Restart ComfyUI. Or via ComfyUI Manager β†’ "Install Custom Nodes" β†’ search Orion4D_layer_manager. The pack ships preset gradients in presets_gradients/ (a "Black to White Linear" and "Warm Radial" to start), and the editor app lets you save your own.

    Common issues

    • Gradient doesn't look like the preview. The editor app is the reference preview, but the Python backend is the final output - hit Run after Apply so the two agree. That's true of every node in this pack.
    • center_x/center_y feel inverted or off. They're normalized canvas coordinates (0–1), not pixels - 0.5, 0.5 is dead center. If your radial's heart isn't where you dragged it in the app, it's usually a stale run rather than a wrong value.
    • Border mask is white everywhere. inner_border_px defaults to 0, which means no border. Set it to something like 20 and the mask flips on.
    CategoryOrion4D_Layer

    Inputs (15)

    NameTypeDefaultDescription
    widthINT10241–8192β€”
    heightINT10241–8192β€”
    fill_modeCOMBOsolid6 options: solid, linear, radial, angular, reflected, diamond
    color_countCOMBO14 options: 1, 2, 3, 4
    color_1STRING#FFFFFFβ€”
    color_2STRING#FFFFFFβ€”
    color_3STRING#FFFFFFβ€”
    color_4STRING#FFFFFFβ€”
    invertBOOLEANfalseβ€”
    angleFLOAT00–360β€”
    center_xFLOAT0.500–1β€”
    center_yFLOAT0.500–1β€”
    inner_border_pxINT00–200β€”
    border_colorSTRING#FFFFFFβ€”
    border_opacityFLOAT1.000–1β€”

    Outputs (4)

    NameTypeDescription
    imageIMAGEβ€”
    full_maskMASKβ€”
    border_maskMASKβ€”
    settings_jsonSTRINGβ€”