🌻 Draw Simple Rectangle
Make a shape and a matching mask in one node
- IMAGE
- MASK
Draws a rounded rectangle on a blank canvas and hands you both the image and a matching mask. The mask is why this is more than a toy - a clean rectangular mask is exactly what you need to seed an inpaint region, block out a composite area, or build a simple frame, and generating one by hand is more annoying than it sounds.
What you'd do with it
Masking, mostly. Say you want to inpaint a specific rectangular chunk of an image, or composite something into a defined box. You need a mask of that region. This node makes one at whatever position and size you specify, with anti-aliased edges so the boundary isn't jagged. You can also use the image output directly as a solid color block - a background plate, a color swatch, a placeholder.
The inputs worth knowing
There are a lot of them, but they group cleanly:
- width / height - the canvas size.
- left / top / right / bottom - these define the rectangle by its inset from each edge of the canvas, not as x/y/width/height. So
left: 50means the rectangle starts 50px in from the left. It's a slightly different mental model than you might expect, so glance at the preview the first time. - radius - corner rounding. Set 0 for hard corners, higher for a pill shape.
- fill_red / fill_green / fill_blue - the color, 0–255 each.
- fill_alpha - opacity, 0 to 1.
- SSAA - supersampling, 1–16. The node draws at a larger size then shrinks down, which is what gives you smooth edges instead of aliased ones. 4 is a fine default; crank it for very smooth curves at the cost of a little speed.
- method - the resampling filter used for that downsample (lanczos, bicubic, etc.). Lanczos is the clean pick.
Outputs are the IMAGE (the drawn rectangle) and the MASK (the same shape as a mask). The mask is the one you'll wire into an inpaint or composite node.
Practical notes
The inset-from-each-edge layout is the only real head-scratcher - if your rectangle isn't where you expect, that's almost always why. SSAA at 4 with lanczos gives you nicely smooth rounded corners; there's rarely a reason to go past 8. And since it starts from a blank canvas, this makes shapes and masks, not edits to an existing image - for that you'd composite the output onto your picture in a later node.
Installing ComfyUI-Addoor
ComfyUI Manager: Install Custom Nodes → search "ComfyUI-Addoor" → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/Eagle-CN/ComfyUI-Addoor.git
cd ComfyUI-Addoor
pip install -r requirements.txt
Restart and find it under 🌻 Addoor / Utilities. Preview the output once to get the feel for the inset-based positioning before you build around it.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 512 | — |
| height | INT | 512 | — |
| left | INT | 50 | — |
| top | INT | 50 | — |
| right | INT | 50 | — |
| bottom | INT | 50 | — |
| radius | INT | 20 | — |
| fill_red | INT | 2550–255 | — |
| fill_green | INT | 2550–255 | — |
| fill_blue | INT | 2550–255 | — |
| fill_alpha | FLOAT | 1.000–1 | — |
| SSAA | INT | 41–16 | — |
| method | COMBO | 6 options: lanczos, bicubic, hamming, bilinear, box, nearest |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |