ImageDrawRectangleRounded
Rounded rectangles without the jagged corners
- IMAGE
Rounded-corner boxes are one of those things every post-processing workflow eventually needs - a card behind a caption, a pill-shaped button, a frame that doesn't look like it was cut with scissors. ImageDrawRectangleRounded from the Allor plugin does exactly that, on a canvas you size yourself with width and height, and it gives you the one thing most similar nodes skip: the ability to round only some corners.
How it works
The node draws with PIL's rounded_rectangle onto a transparent RGBA canvas. You set the canvas with width and height, then define the box with the same normalized 0–1 coordinates as the other Allor draw nodes - start_x, start_y, end_x, end_y are fractions of the canvas, so the same layout works at any resolution. The radius input (0–360) controls corner curvature, and here's the nice bit: top_left_corner, top_right_corner, bottom_right_corner, and bottom_left_corner are each true/false toggles. Turn off the bottom corners and you have a speech-bubble-ish header card; turn them all on and you get the classic rounded rect.
Like the other Allor draw nodes it's supersampled: SSAA (default 4) renders at 4× then downsamples with your chosen method (lanczos → nearest). That's what keeps rounded edges smooth instead of stairstepped. Colors work the same way too - fill_red/green/blue plus fill_alpha for the body, outline_red/green/blue, outline_alpha and outline_size for the stroke.
Inputs that matter
width/height- canvas size in pixels (unlike the "ByContainer" variants, there's no reference image here).start_x/start_y/end_x/end_y- the box, as 0–1 fractions of the canvas.radius- corner roundness, 0 to 360. It's a radius in the scaled drawing space, so don't overthink the absolute number - nudge it until it looks right.- The four
*_cornertoggles - the reason to pick this node over a plain rounded-rect. SSAAandmethod- anti-aliasing quality vs. speed.
Output is a single IMAGE, RGBA with transparency outside the rectangle, so composite it over your render rather than treating it as a finished frame.
Installing it
This is part of the Allor plugin (~90 nodes in one pack), installed once:
cd ComfyUI/custom_nodes
git clone https://github.com/Nourepide/ComfyUI-Allor
Restart ComfyUI afterward, or use ComfyUI Manager and search for Allor Plugin. The pack's requirements.txt pulls in rembg and onnx, so the first launch after install takes a while - the drawing nodes themselves don't need models.
Gotchas
- Watch the update gotcha that hits everyone on Allor: the repo history was rebased to drop old images, so an old clone can fail on
git pull. If auto-update throws, the fix is a clean re-clone (docs on the pack README cover it). - The output is transparent outside the rectangle - don't save it standalone and wonder where your background went.
radiusis a drawing-space value scaled by SSAA. If your corners look over-round at high SSAA, that's normal; just lower the radius.
If you'd rather have the box match an existing image's dimensions automatically, the sibling node ImageDrawRectangleRoundedByContainer takes a container IMAGE instead of width/height.
Inputs (22)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 256 | — |
| height | INT | 256 | — |
| start_x | FLOAT | 0.10 | — |
| start_y | FLOAT | 0.20 | — |
| end_x | FLOAT | 0.90 | — |
| end_y | FLOAT | 0.80 | — |
| radius | INT | 180 | — |
| outline_size | INT | 1 | — |
| outline_red | INT | 0 | — |
| outline_green | INT | 0 | — |
| outline_blue | INT | 0 | — |
| outline_alpha | FLOAT | 1.00 | — |
| fill_red | INT | 255 | — |
| fill_green | INT | 255 | — |
| fill_blue | INT | 255 | — |
| fill_alpha | FLOAT | 1.00 | — |
| top_left_corner | COMBO | 2 options: true, false | |
| top_right_corner | COMBO | 2 options: true, false | |
| bottom_right_corner | COMBO | 2 options: true, false | |
| bottom_left_corner | COMBO | 2 options: true, false | |
| SSAA | INT | 41–16 | — |
| method | COMBO | 6 options: lanczos, bicubic, hamming, bilinear, box, nearest |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |