Visit ComfyUI Online for ready-to-use ComfyUI environment
Crop images to specified aspect ratio for consistent proportions, eliminating unwanted parts while preserving essential content.
The ImageCropByRatio
node is designed to crop an image based on a specified aspect ratio, ensuring that the resulting image maintains the desired proportions. This node is particularly useful for AI artists who need to standardize the aspect ratio of images for consistency in their projects. By focusing on the aspect ratio, the node helps in eliminating unwanted parts of the image while preserving the essential content. This can be especially beneficial when preparing images for further processing or display, as it ensures that all images conform to a uniform aspect ratio, enhancing the overall aesthetic and coherence of the artwork.
The image to be cropped. This parameter expects an image input and serves as the primary source material for the cropping operation.
The desired width ratio for the cropping operation. This parameter determines the width component of the target aspect ratio. For example, if you want a 16:9 aspect ratio, you would set this parameter to 16.
The desired height ratio for the cropping operation. This parameter determines the height component of the target aspect ratio. For example, if you want a 16:9 aspect ratio, you would set this parameter to 9.
The position from which to start the cropping. This parameter allows you to specify where the cropping should be anchored, such as "top", "bottom", "left", "right", or "center". This helps in focusing the crop on a particular area of the image.
The cropped image. This output provides the resulting image after the cropping operation, maintaining the specified aspect ratio.
The width of the cropped image. This output indicates the final width of the image after cropping, which is determined based on the specified aspect ratio.
The height of the cropped image. This output indicates the final height of the image after cropping, which is determined based on the specified aspect ratio.
width_ratio
and height_ratio
values.position
parameter to focus the crop on important areas of the image, such as the center or a specific edge, to ensure that the most relevant content is preserved.width_ratio
parameter is not provided or is incorrectly named.width_ratio
parameter in the input.height_ratio
parameter is not provided or is incorrectly named.height_ratio
parameter in the input.position
parameter results in a crop area that exceeds the image dimensions.position
parameter is set correctly and that the specified aspect ratio can be accommodated within the image dimensions. Adjust the position
or aspect ratio if necessary.© Copyright 2024 RunComfy. All Rights Reserved.