Nodes/ComfyUI-TinyBee/Draw TinyRect
ComfyUI Node

Draw TinyRect

Draw your detection box on the image so you can actually see what it found

By TinyBeeman·Created about a year ago·Updated 10 days ago· 1
Draw TinyRect
  • image
  • tinyrect
  • image
rectColor255, 255, 255
paddingColor0, 0, 0
padImageToFittrue
strokeWidth10.0

Detection nodes give you numbers; numbers don't show up on a monitor. When a Florence2 or other detector parses a bounding box and your crop comes out looking wrong, the first question is "what did it actually find?" - and the fastest way to answer it is to draw the box on the image and look. Draw TinyRect is the eyeball tool for this pack's rectangles: you feed it an image and a TINYRECT, it renders a rectangle outline over the image, and you get a new image you can preview or save.

Under the hood it's PIL's ImageDraw.rectangle with an outline, nothing more. The niceties are in the details: it handles rects that hang off the edge, and it can pad the canvas so a partially-offscreen box is still fully visible instead of clipped. It also survives multi-frame image batches - each frame gets the same box drawn on it, which makes it usable for video workflows where you want to see a tracked region across frames.

The inputs that matter

  • image, tinyrect - the image and the box to draw. Straightforward.
  • rectColor - the outline color as a "r, g, b" string, default "255, 255, 255" (white). Set it to something loud like "255, 0, 0" when the white box vanishes into a bright background.
  • paddingColor - the fill used when padding, default "0, 0, 0" (black).
  • padImageToFit - when true (default), a rect extending past the image edge grows the canvas with paddingColor so the whole box is visible. When false, offscreen parts are just clipped.
  • strokeWidth - outline thickness, default 10.0. Bump it down to ~2-3 if you're drawing dozens of boxes and want to see the actual boundaries, or up for a preview that reads at a glance.

The single output is image, the annotated version - wire it into a Preview Image node and you're done.

Install and gotchas

Standard TinyBee install:

cd ComfyUI/custom_nodes
git clone https://github.com/TinyBeeman/ComfyUI-TinyBee

or ComfyUI Manager → "ComfyUI-TinyBee" → restart. This is the one node in the rect family that actually needs pillow (it's in the pack's requirements.txt alongside jsonata), which ComfyUI Manager installs for you automatically. No models. The gotcha worth knowing: the color strings are comma-separated "r, g, b" - without the parentheses that the sibling Crop/Grow Image to Bounds expects. Copy-paste a color between the two and it still parses fine, but it's a reminder that this pack's string formats are per-node. You'll find it in 🐝TinyBee/Rectangles.

Category🐝TinyBee/Rectangles

Inputs (6)

NameTypeDefaultDescription
imageIMAGE
tinyrectTINYRECT
rectColorSTRING255, 255, 255
paddingColorSTRING0, 0, 0
padImageToFitBOOLEANtrue
strokeWidthFLOAT10.00–1000

Outputs (1)

NameTypeDescription
imageIMAGE