Nodes/Comfyroll Studio/🟑 CR Draw Shape
ComfyUI Node Runs on cloud

🟑 CR Draw Shape

Render a solid shape for masks and compositing bases

By Suzie1Β·Created 3 years agoΒ·Updated 2 years agoΒ· 1,291
🟑 CR Draw Shape
    • IMAGE
    • show_help
    β—„width512β–Ί
    β—„height512β–Ί
    β—„shapeβ–Ύβ–Ί
    β—„shape_colorβ–Ύβ–Ί
    β—„back_colorβ–Ύβ–Ί
    β—„x_offset0β–Ί
    β—„y_offset0β–Ί
    β—„zoom1.00β–Ί
    β—„rotation0.0β–Ί
    β—„shape_color_hex#000000β–Ί
    β—„bg_color_hex#000000β–Ί

    CR Draw Shape draws a solid geometric shape - circle, square, triangle, hexagon, star, and a dozen more - on a background, and outputs it as an image. It's a small utility with a surprisingly wide reach: a shape on a contrasting background makes an instant mask for regional work, a base for compositing, a simple logo or badge element, or the raw material for a ControlNet or inpaint region. When you need a clean, controllable shape and don't want to leave ComfyUI to draw one, this is it.

    The mask angle is the one people underuse. A white circle on black is a perfectly good mask for "generate only here" - feed it as a mask into an inpaint or a regional conditioning setup and you've defined a region without touching an image editor.

    How it works

    You set the canvas size, pick a shape and its color and the background color, and it renders. Beyond the basics you get placement and transform controls: x_offset / y_offset slide the shape around, zoom scales it, and rotation spins it (in tenths of a degree, up to 3600 - so full rotations are on the table). Colors come from a 30-entry named palette, or set the color to custom and supply your own hex value in the hex fields. The output is a standard IMAGE, so it flows into masks, composites, or straight to a preview.

    The inputs and outputs that matter

    • shape - the geometry: circle, oval, square, diamond, triangle, hexagon, octagon, star, starburst, and more.
    • width / height - canvas size. Match it to whatever the shape needs to line up with.
    • shape_color / back_color - named colors, or custom to use the hex inputs. For a mask, white shape on black background.
    • shape_color_hex / bg_color_hex (optional) - your own hex values, used when the color is set to custom.
    • x_offset / y_offset / zoom / rotation - position and transform the shape.

    Outputs:

    • IMAGE - the rendered shape. Wire it to a mask input, a composite, or a preview.
    • show_help - wiki link, ignore.

    How to install it

    Comfyroll Studio (Suzie1 and RockOfFire), a mature utility pack - no models, no heavy dependencies.

    • ComfyUI Manager - search Comfyroll Studio, install, restart.
    • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git, then restart.

    Also on CivitAI.

    Common issues

    Two small ones on the node itself: to use a custom color you have to set shape_color (or back_color) to custom and fill in the matching hex field - set one without the other and you get the wrong color. And if you plan to use the output as a mask, you may need to convert the IMAGE to a MASK depending on what consumes it; a solid black/white image is the right starting point either way.

    The bigger thing is that Draw Shape lives in the Graphics group, which is the part of Comfyroll most likely to fail on load. If it's missing, your log shows Comfyroll Studio: Failed to load Graphics nodes ending in NameError: name 'CR_HalftoneGrid' is not defined. That NameError is a symptom - the real cause is an import error higher up, nearly always an incompatible Pillow (PIL) version dragged in by some other custom node, which can knock out the whole pack. Scroll up to the first traceback and reinstall Pillow (pip install --upgrade --force-reinstall pillow) into ComfyUI's Python, then restart.

    Category🧩 Comfyroll Studio/πŸ‘Ύ Graphics/🟣 Shape

    Inputs (11)

    NameTypeDefaultDescription
    widthINT51264–4096β€”
    heightINT51264–4096β€”
    shapeCOMBO14 options: circle, oval, square, diamond, triangle, hexagon, +8
    shape_colorCOMBO30 options: custom, white, black, red, green, blue, +24
    back_colorCOMBO30 options: custom, white, black, red, green, blue, +24
    x_offsetINT0-2048–2048β€”
    y_offsetINT0-2048–2048β€”
    zoomFLOAT1.000–10β€”
    rotationFLOAT0.00–3600β€”
    shape_color_hexoptSTRING#000000β€”
    bg_color_hexoptSTRING#000000β€”

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGEβ€”
    show_helpSTRINGβ€”