Visit ComfyUI Online for ready-to-use ComfyUI environment
Crop square region from image based on coordinates, size, and centering for precise manipulation and aspect ratio maintenance.
The Image Crop Square Location node is designed to crop a square region from an image based on specified coordinates and size. This node is particularly useful for focusing on a specific area of an image, ensuring that the cropped region is centered around the given coordinates. It automatically adjusts the cropping boundaries to fit within the image dimensions, providing a resized output that maintains the aspect ratio. This functionality is essential for tasks that require precise image manipulation, such as preparing images for machine learning models or creating visually appealing compositions.
The x-coordinate of the center of the cropping region. This parameter determines the horizontal position of the crop's center. The value should be within the width of the image. The default value is 256.
The y-coordinate of the center of the cropping region. This parameter determines the vertical position of the crop's center. The value should be within the height of the image. The default value is 256.
The size of the square cropping region. This parameter defines the width and height of the square crop. The value should be a positive integer, and the default value is 512.
The cropped and resized image. This output provides the image data after cropping the specified square region and resizing it to ensure the dimensions are multiples of 8. The output is in tensor format.
A tuple containing the size of the cropped image and the coordinates of the cropping region. This output provides metadata about the crop, including the dimensions of the cropped area and the exact coordinates used for cropping.
© Copyright 2024 RunComfy. All Rights Reserved.