Nodes/Dream Painter/β˜€ Shape of Circular Rays
ComfyUI Node

β˜€ Shape of Circular Rays

Draw the light before the model does

By alt-key-projectΒ·Created 2 years agoΒ·Updated 2 years agoΒ· 2
β˜€ Shape of Circular Rays
    • SHAPE
    β—„ray_origin_x0.50β–Ί
    β—„ray_origin_y0.50β–Ί
    β—„center_x0.50β–Ί
    β—„center_y0.50β–Ί
    β—„diameter2.00β–Ί
    β—„rays12β–Ί

    You know those AI images that are "a sunburst of light behind a figure" and the model just fumbles it, making the rays crooked or placing them where you didn't want them? This node is how you stop hoping and start pointing. Shape of Circular Rays [DPaint] generates the geometry of a sunburst - a fan of rays fanning out from a point - as a vector shape you can render and feed into a ControlNet, so the model knows exactly where your rays are and how they spread.

    It's part of the Dream Painter pack (alt-key-project/comfyui-dream-painter), a small MIT-licensed kit of nodes for drawing simple 2D graphics that guide image generation. The README is upfront about the philosophy: these are a "quick-and-dirty solution, not intended to produce the final artwork." You're not making art here, you're making a map. The classic workflow in the pack's own example is exactly that - a couple of these rays shapes combined, edge-detected, and run through a ControlNet at a modest weight so the structure lands and the model fills in the texture.

    What it actually does

    Shapes in Dream Painter live in a normalized 0–1 coordinate space (you can push outside it, but 0.5 is the middle of the frame). This node places a ray_origin - where the rays shoot from - and a center for the circle they orbit, then constructs one wedge per ray: a triangle from the origin out to two adjacent points on a circle of the given diameter. So when you render it filled, you get a pinwheel of wedges, not thin lines.

    The inputs that matter:

    • ray_origin_x / ray_origin_y - where the rays emanate from. Default 0.5/0.5. This is the anchor of your sunburst.
    • center_x / center_y - the middle of the circle the ray tips ride on. Offset these from the origin and the fan turns into a "sun rising over the horizon" wedge instead of a full circle of rays.
    • diameter - how far the rays reach. Default 2.0, which already overshoots the 0–1 frame, so lower it to ~0.8–1.0 unless you want clipping.
    • rays - the count, 2 to 1000. A handful reads as a star/asterisk; crank it to 40+ and it becomes a smooth sunburst disc. This is the knob you'll actually tweak.

    Output is a single SHAPE socket. It doesn't render anything on its own - wire it into Draw Shape As Bitmap [DPaint] (set fill to yes if you want solid wedges), then Bitmap To Image & Mask [DPaint] to get an IMAGE you can hand to a ControlNet node or a MASK you can composite with.

    Installing it

    Same for every node in this pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/alt-key-project/comfyui-dream-painter
    cd comfyui-dream-painter
    pip install -r requirements.txt
    

    or just search "Dream Painter" in ComfyUI Manager and let it handle it. Then restart ComfyUI. No model files to download, no API keys - it's pure geometry plus Pillow/scipy/numpy. Watch the numpy<2.0.0 pin in requirements.txt: on a fresh environment pip will happily downgrade your numpy to satisfy it, and other nodes that want numpy 2 can break. If that bites you, install with --no-deps and add the deps manually.

    Common gotchas

    The two things that trip people up: the diameter default of 2.0 draws well past the frame, and the viewport bounds on Draw Shape As Bitmap default to 0–1. If your origin or ray tips sit outside that box, they get clipped. Keep your coordinates inside 0–1 (or widen shape_bound_x_max/shape_bound_y_max) and you'll see the whole sunburst.

    Also worth knowing: this is an obscure pack - zero community discussion anywhere I could find, so you won't get help from a reddit thread if something looks off. The upside is the mechanism is simple enough to debug by previewing the bitmap before it ever touches a sampler.

    CategoryπŸ–Œ DPaint/β–’ shape

    Inputs (6)

    NameTypeDefaultDescription
    ray_origin_xFLOAT0.50-3–3β€”
    ray_origin_yFLOAT0.50-3–3β€”
    center_xFLOAT0.50-3–3β€”
    center_yFLOAT0.50-3–3β€”
    diameterFLOAT2.00β€”
    raysINT122–1000β€”

    Outputs (1)

    NameTypeDescription
    SHAPESHAPEβ€”