Upscale Bbox By (mtb)
Grow a bounding box's margin before a detail pass
- bbox
- BBOX
A detector finds a face or a hand and hands you back a tight bounding box - exactly the pixels it's confident belong to the detected region, no more. That's usually too tight for a good detail pass: crop exactly to the detected edges and your refined result has no context to blend back into, and you get a visible seam. Upscale Bbox By grows the box by a multiplier before you crop, so the detail pass has room to work with.
What it does
One operation: take a BBOX and a scale multiplier (default 1, meaning no change), and return a new BBOX scaled by that factor. A scale of 1.3 grows the box 30% larger around its own footprint; anything below 1 would shrink it, though growing is the normal use case.
Inputs and outputs
bbox- the box you're resizing, typically straight out of a detector node.scale- the multiplier.
Output: a single BBOX - the new, resized box, ready to feed into whatever crops the image using it.
Where the BBOX comes from, and where this fits in a real pipeline
You won't hand-build a BBOX; it comes from detection. The common source is ComfyUI Impact Pack's detector nodes, which find faces, hands, or YOLO/SAM-detected regions and output bounding boxes for its detect-crop-resample-paste-back loop. That's exactly the pattern this node slots into: the detector finds a tight box, Upscale Bbox By grows it for margin, then a crop node uses the wider box, runs the detail pass, and composites back. Skip the margin step and you'll notice detail passes that look obviously pasted-in at the edges - the classic "grey box around the face" symptom people hit with tight-crop detailers generally, not unique to this pack.
Installing it
ComfyUI Manager: search "MTB Nodes," install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/melMass/comfy_mtb
then restart, and if it's missing afterward, cd into comfy_mtb and run pip install -r requirements.txt yourself.
Common issues
This is pure arithmetic on four numbers - no heavy dependencies, so it's rarely the node that fails to load; the pack's generic "some nodes couldn't be loaded" startup warning is about the optional face-swap/DeepBump extras, not this one. The real gotcha is type compatibility: this node's BBOX needs to match what your detector actually outputs, and if you're mixing detector nodes from a different pack (say, Impact Pack) with mtb's crop nodes, the connector may simply refuse to wire, or wire but behave unexpectedly, because different packs don't always share one canonical BBOX implementation under the hood. Keep detection and cropping within one pack's node family when you can, and if a scaled box ends up partially off-canvas (a detection near the image edge, scaled up), make sure whatever crops with it clamps to the image bounds - this node itself doesn't do that clamping for you.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| bbox | BBOX | — | |
| scale | FLOAT | 1.00 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BBOX | BBOX | — |