ImageDrawLine
Draw a straight line with a thickness, anti-aliased
- IMAGE
ImageDrawLine draws a straight line from one normalized point to another on a transparent RGBA canvas, with a thickness you control and anti-aliasing that actually looks decent. It sounds trivial, but a clean, thick, compositable line is genuinely annoying to produce in stock ComfyUI - this gives you one in a single node.
How it works
Same pipeline as every Allor draw node: RGBA canvas, PIL ImageDraw.line, supersample by SSAA, downscale with method, output a single IMAGE tensor. The coordinates are normalized fractions of the canvas - 0 is one edge, 1 is the opposite edge - which means the same values work at any canvas size.
Inputs that matter:
- width / height - canvas size, default 256×256.
- start_x / start_y, end_x / end_y - the line's endpoints as 0–1 fractions. Defaults run from top-left (
0,0) to bottom-right (1,1) - a diagonal. For a horizontal line across the middle, use0, 0.5 → 1, 0.5. - size - line thickness in pixels, default 1.
- red / green / blue / alpha - color, alpha defaulting to 1 (opaque).
- SSAA (default 4) and method (default
lanczos).
Where people get burned
Two things. First, the line can sit partially off-canvas - an endpoint of exactly 1 means the line's edge is flush against the border, and with a thick size the outer half of the stroke gets clipped. Pull endpoints slightly inside (e.g. 0.02–0.98) if you want a fully visible line. Second, the output is RGBA with a transparent background, so a lone line floats on a checkerboard in Preview - expected behavior for compositing, surprising if you wanted a solid backdrop.
Why you'd use it
Separator rules, grid lines, arrow shafts (composite the head on top), underline effects, or any vector-ish element you're layering over a generated image. Because the output has real alpha, it blends rather than hard-stamping.
Installing Allor
Part of the Allor Plugin (Nourepide/ComfyUI-Allor), ~90 nodes from early 2024:
cd ComfyUI/custom_nodes
git clone https://github.com/Nourepide/ComfyUI-Allor
cd ComfyUI-Allor
pip install -r requirements.txt
Restart, or search "Allor Plugin" in ComfyUI Manager - the more reliable route given the pack's history of manual-install import errors. Dependencies are rembg + onnx; drawing needs no models.
Gotchas that apply to the whole pack
The repo was rebased to strip images from history (shrank ~344×), so auto-update can occasionally break - the README's update-troubleshooting docs cover it; delete-and-reclone is the blunt fix. [Allor] console lines at startup are the pack writing config.json and checking updates, not an error.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 256 | — |
| height | INT | 256 | — |
| size | INT | 1 | — |
| start_x | FLOAT | 0.00 | — |
| start_y | FLOAT | 0.00 | — |
| end_x | FLOAT | 1.00 | — |
| end_y | FLOAT | 1.00 | — |
| red | INT | 255 | — |
| green | INT | 255 | — |
| blue | INT | 255 | — |
| 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 | — |