ImagePadWithBBox(FaceParsing)
Pad a crop out to a target size without losing the box's position
- bbox
- image
- IMAGE
A lot of models - face parsing included - work best at specific resolutions or aspect ratios, but faces come in whatever shape the detector's box happens to be. This node pads an image out to a target width and height, positioning the original content according to a bounding box rather than just centering blindly, which matters when the thing you care about (the face) isn't necessarily centered in the crop you're padding.
The inputs that matter
All four required:
- bbox (BBOX) - the box describing where the meaningful content sits, used to guide how the padding is placed.
- width / height (INT) - the target dimensions you're padding out to.
- image (IMAGE) - the image being padded.
The output is a single IMAGE, padded to the requested width/height with the original content positioned per the box.
When you'd reach for this
Padding rather than stretching or cropping-to-fit is the right call whenever a model needs a fixed input size but you don't want to distort the face or lose part of it - squeezing a non-square crop into a square resolution warps proportions, and center-cropping can clip the edges of a face that isn't perfectly centered in its bounding box. This node lets you hit an exact target size while keeping the face's own geometry intact and using the box to know where the important content actually is.
Installing it
Comes with the whole pack:
- ComfyUI Manager - search "comfyui_face_parsing", install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/Ryuukeisyou/comfyui_face_parsing.git, restart ComfyUI.
Pure image manipulation, no extra dependencies.
Common issues
If your target width/height are smaller than the source image, you're asking this node to pad an already-larger image down, which isn't what it's built for - pick target dimensions that are equal to or larger than what you're padding. Also worth knowing: padding adds pixels (typically blank or edge-extended) around your content rather than resizing it, so if what you actually wanted was to resize the face into a target box, you want a resize node, not this one. ImageResizeCalculator is the node in this pack for working out proper resize dimensions when that's the goal instead.
It's easy to mix this node up with ImagePadWithBBox's near-namesake, ImageCropWithBBox, since both take a bbox and an image. They do opposite jobs: the crop node cuts down to the box, this one pads out to a target size while using the box to keep the important content correctly placed. If your output image came back larger than the input rather than smaller, you're on the right node; if you expected a tight crop and got a padded canvas instead, you've grabbed this one by mistake.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| bbox | BBOX | — | |
| width | INT | — | |
| height | INT | — | |
| image | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |