Nodes/comfyui_cv/CV Scale BBoxes
ComfyUI Node

CV Scale BBoxes

Rescales bounding boxes from one image space to another by comparing the sizes of two references - e.g. a bbox found by 'Match Template' on a LATENT (latent-cell coordinates) mapped onto the original image (pixel coordinates) for the core 'Draw BBoxes' node, or boxes detected on a downscaled copy mapped back to full resolution. Only the references' height/width are read, so any IMAGE, MASK, NPARRAY or LATENT works on either side.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Scale BBoxes
  • bboxes
  • from_space
  • to_space
  • bboxes
  • scale_x
  • scale_y
Categoryimage/CV

Inputs (3)

NameTypeDefaultDescription
bboxesBOUNDING_BOX[object Object]Core BOUNDING_BOX data: per-frame lists of {x, y, width, height} dicts - compatible with Draw BBoxes, Crop By Bounding Boxes, Image Crop, etc. Boxes in from_space coordinates: a single dict, a flat list, or per-frame nested lists. Extra keys (score, label, ...) are preserved.
from_spaceNPARRAY,IMAGE,MASK,LATENTReference the boxes were measured on (e.g. the LATENT that was searched). Only its height/width are used - for a LATENT that is the latent-cell grid size.
to_spaceNPARRAY,IMAGE,MASK,LATENTReference to map the boxes onto (e.g. the original IMAGE, or its MASK - only height/width are used).

Outputs (3)

NameTypeDescription
bboxesBOUNDING_BOXCore BOUNDING_BOX data: per-frame lists of {x, y, width, height} dicts - compatible with Draw BBoxes, Crop By Bounding Boxes, Image Crop, etc. Same nesting as the input, coordinates in to_space.
scale_xFLOATApplied horizontal factor: to_space width / from_space width (8.0 for a stride-8 VAE latent).
scale_yFLOATApplied vertical factor: to_space height / from_space height.