Draw Size Chart Arrows
Draw the Size-Chart Dimension Lines Right on Your Product Photo
- image
- image
Every clothing or bag listing needs that technical-style shot: the product photo with clean arrow lines showing height and width, like a size chart from a garment catalog. KSDrawSizeChartArrows draws exactly those guide lines onto your image - an L-shaped pair of dimension arrows offset from the product's bounding box, with arrowheads, in a color you pick. It's the finishing touch node: product cut out on white, arrows drawn, listing done.
How it works
You give it the image plus a bounding box (bbox_x, bbox_y, bbox_width, bbox_height) and it renders two dimension lines in one raster pass using PIL's ImageDraw:
- a horizontal arrow running left-to-right below the box, and
- a vertical arrow running top-to-bottom beside it,
positioned just outside the box at the horizontal_gap and vertical_gap distances (default 24px each). The knobs are the usual suspects: color (default #111111, any hex PIL understands), stroke_width (default 4), and arrow_head_size (default 14). Negative gaps pull the arrows inside the box - occasionally useful if you want dimension lines overlapping the product, though that's an odd look for a catalog. Output is the annotated image, same size as the input, one per frame.
The honest caveat about the bbox inputs: they're four plain INT inputs (forceInput, so they want wires), and this pack's own KSGroundingDinoDetect outputs a KS_DINO_BOXES container - not four ints. Nothing in the pack currently unpacks that container into bbox_x/y/width/height, so to drive this node from detection you'll either wire the ints from another source (a detector that emits raw coordinates, or a bbox-computing node from another pack) or type them in manually. In practice people use it on a fixed layout where the product position is consistent, so manual values aren't as painful as they sound. If you're after a dynamic arrows node fed by detection, note that seam before you build the workflow.
Installing
With the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/kongshan4219/ComfyUI-Kongshan-Nodes
restart ComfyUI. No models, no keys - pure Pillow. One honest note on the API surface: the color field is a plain string with a #111111 default, and if you hand it something PIL can't parse it silently falls back to #111111 rather than erroring - so a typo gives you near-black arrows, not a helpful error. Check your hex when the color looks wrong.
Gotchas
- The arrows are decorative, not measured. Nothing here computes real dimensions from real-world size; it draws guide lines around the product box. You (or your retoucher) annotate the numbers in post. Set expectations accordingly.
- Gaps and head size interact. The arrowhead is sized relative to
arrow_head_size, and tiny gaps with huge heads look broken - thehalfdimension is clamped to at leaststroke + 2, so extreme values just look bad rather than crash. Reasonable defaults are genuinely reasonable here. - It's the tail of a specific pipeline. In the author's original 1688-style workflow this sits after "product cut out on white," producing the size-chart frame for the listing sheet. Standalone, it's still a perfectly good arrow-drawing node for any "show the dimensions" need.
A small, focused, honest little node - the kind that makes a pack feel lived-in. Young pack, zero impressions everywhere as of now, but this one answers a real listing-catalog need that most packs never touch.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Base image to draw on. | |
| bbox_x | INT | — | |
| bbox_y | INT | — | |
| bbox_width | INT | — | |
| bbox_height | INT | — | |
| coloropt | STRING | #111111 | — |
| stroke_widthopt | INT | 41–32 | — |
| arrow_head_sizeopt | INT | 144–96 | — |
| horizontal_gapopt | INT | 24-512–1024 | — |
| vertical_gapopt | INT | 24-512–1024 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |