ImageDrawRectangle
Draw a clean box from scratch, anti-aliased and all
- IMAGE
ImageDrawRectangle is the node for when you need an actual rectangle image, not a rectangle drawn on an existing image. It takes no image input at all - you give it a canvas size and it generates a brand-new RGBA image containing one rectangle, with independent fill and outline colors, both with their own alpha. It's a generator, not an editor, and that makes it useful for a specific set of jobs: placeholder cards, UI mockups, mattes, or the seed of a composition you'll build up with other nodes.
The layout inputs are normalized, which is the clever part. start_x, start_y, end_x, end_y are all 0–1 floats that scale to the canvas, so the rectangle's position is resolution-independent - 0.1, 0.2 to 0.9, 0.8 is a centered-ish box whether the canvas is 256px or 2048px. The width/height (default 256) set the canvas size, not the box size.
Colors are where the beginner traps live:
- Fill -
fill_red/green/blueare 0–255 integers,fill_alphais a 0–1 float. Defaults: white fill, fully opaque. - Outline - same three-channel RGB plus its own alpha, plus
outline_sizein pixels. Defaults: black outline, size 1.
The subtle bit is outline_size: it's added inside the rectangle's bounds, so a thick outline eats into the fill rather than expanding the shape. Set outline_alpha to 0 if you don't want the border at all.
Then there's SSAA (default 4, range 1–16) - supersampling anti-aliasing. The node renders the rectangle at SSAA× the target size, then downsamples it with the method you pick (lanczos, bicubic, hamming, bilinear, box, nearest). That's why the edges come out smooth instead of jaggy: you're drawing big and shrinking. At SSAA 1 the box will look pixelated; 4 is a good default; you can afford higher on one-shot stills. Output is a single RGBA IMAGE (batch of one), so wire it to a Save Image or into a composite.
Installing it
It's part of the Allor plugin:
cd ComfyUI/custom_nodes
git clone https://github.com/Nourepide/ComfyUI-Allor
cd ComfyUI-Allor
pip install -r requirements.txt
Restart ComfyUI, or search "Allor" in ComfyUI Manager. Pack-level notes: requirements.txt installs rembg and onnx for the segmentation nodes even though this node only needs PIL, and Allor's repo was rebased to strip images from git history, which can break auto-updates - the docs at nourepide.github.io/ComfyUI-Allor-Doc have troubleshooting pages for that.
Real talk
This is a quiet little node with one genuinely thoughtful feature - normalized coordinates and SSAA mean you can crank the resolution without redesigning your layout or losing edge quality. The traps are all color-related: outline eats into fill, and the RGB values are 0–255 while alphas are 0–1, so mixing them up produces either invisible or neon output. And remember it makes its own canvas - if you meant to put a box on a photo you already have, this isn't the node; find the variant that takes a container image instead.
Inputs (17)
| 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 | — |
| 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 | — |
| SSAA | INT | 41–16 | — |
| method | COMBO | 6 options: lanczos, bicubic, hamming, bilinear, box, nearest |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |