⭐ Star Box Drawer
When you just need a rectangle on an image, without leaving ComfyUI
- image
- IMAGE
Every so often you need a rectangle drawn on an image inside ComfyUI, and the standard advice - "just use a script" - is no help at all. Star Box Drawer is the pack's version of that "draw a box" utility: feed it an image, tell it where the box goes, and it paints a filled or outlined rectangle straight into the frame. Dead simple, exactly one job, and it's been in the StarNodes toolbox since the pack's early helper-node days.
It sits in ⭐StarNodes/Helpers And Tools and uses Pillow's ImageDraw under the hood, so there are no exotic dependencies - this node loads even if half the pack's heavy optional libraries are missing.
Why you'd actually reach for it
The honest uses are more varied than you'd think:
- Annotation / batching - mark a region of interest on an image before it feeds into a regional or attention-guided workflow.
- Cropping previews - draw a box over an image to visualize a crop region before a crop node runs.
- Mask or composite debugging - overlay a box on the source image so you can see in one glance whether your coordinates are actually pointing where you think.
It's not a glamorous node, and it's not trying to be. If you need arbitrary polygons, alpha masks or blending, this isn't the tool - but for a rectangle, it's the tool.
Inputs and output
image- the frame to draw on.x,y- top-left corner of the box, in pixels (0–8192).width,height- box size in pixels.color- one of five named colors:white,red,blue,green,black. No hex codes here; if you need a custom color you're in the wrong node.filled- on (default) paints a solid rectangle; off draws only an outline.line_width- outline thickness (1–50), only used whenfilledis off.
One IMAGE output, same size as the input, ready for a preview or a Save node.
Installing it
Standard StarNodes install - ComfyUI Manager, search Starnodes, install, restart:
cd ComfyUI/custom_nodes
git clone https://github.com/Starnodes2024/ComfyUI_StarNodes
cd ComfyUI_StarNodes
pip install -r requirements.txt
Then double-click the canvas and search star, or look under the ⭐StarNodes category.
The one trap
The coordinates are absolute pixel values, not percentages, and there's no bounds-checking feedback - a box whose x + width exceeds the image just gets clipped at the edge, silently. If you're drawing on variable-size images (like batches of video frames), the same coordinates that look great on a 1280px frame will land somewhere unexpected on a 720px one. Figure out your dimensions first, or pipe the frame's width/height from a helper node into the position inputs if your setup can produce them. For a static-size workflow, set it once and forget it - this is a "configure and walk away" node, not a live-tuning one.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| x | INT | 00–8192 | — |
| y | INT | 00–8192 | — |
| width | INT | 1001–8192 | — |
| height | INT | 1001–8192 | — |
| color | COMBO | white | 5 options: white, red, blue, green, black |
| filled | BOOLEAN | true | — |
| line_width | INT | 21–50 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |