Skip to main content
This node crops each input image to a centered square on a black background and adds padding to reach the specified output size. It is designed to prepare images for the TripoSplat 3D model by ensuring consistent square framing and optional alpha matte erosion to prevent border artifacts.

Inputs

Note: The mask input is required and must be provided. If the mask has a different batch size than the image, it is automatically repeated to match. If the mask dimensions differ from the image dimensions, the mask is resized to match the image using bilinear interpolation. The output size is automatically rounded down to the nearest multiple of 16 (minimum 16) to ensure compatibility with DINOv3 patch and Flux2 VAE stride requirements. The node raises an error if the mask contains no foreground pixels (empty mask). When erode_radius is 0, no erosion is applied. The square crop is centered on the mask’s alpha bounding box and sized to 1.2 times the larger bounding box dimension; any area outside the image bounds is filled with black.

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): ec66941846398ee6637576b11ae9d2f9576f6b05ed2ef730cdbf99a68fe9b838