Skip to main content
Crops an image to the bounding box of its mask, producing a centered subject over a solid background color. The node composites the masked image over the chosen background and resizes the result to the specified output dimensions, making it suitable for 3D pipelines that expect a centered, background-free subject at a fixed resolution.

Inputs

Note: The crop region is centered on the mask’s bounding box and its aspect ratio matches width / height. The node automatically detects and corrects an inverted mask (foreground pixels along the border, background in the center). If the mask contains no foreground pixels, the node tries the inverted mask; if that is also empty, it logs a warning and crops the entire image. An error is raised when the mask batch size does not match the image batch size and is not a single mask.

Outputs

This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! Edit on GitHub

Source fingerprint (SHA-256): fcc14b5db7318699526dd544d404f78f9d1ab362b73769276f113f2b1062b214