Visit ComfyUI Online for ready-to-use ComfyUI environment
Resize and crop images to specified dimensions while maintaining aspect ratio and composition, with precise control over cropping position and offset.
The Crop Image TargetSize (JPS) node is designed to resize and crop images to a specified target width and height, ensuring that the resulting image maintains the desired aspect ratio and composition. This node is particularly useful for AI artists who need to prepare images for specific dimensions without distorting the content. By leveraging various interpolation methods and sharpening options, the node provides high-quality resized images. Additionally, it allows for precise control over the cropping position and offset, making it versatile for different artistic needs. Whether you need to center-crop an image or align it to a specific edge, this node offers the flexibility to achieve your desired outcome.
This parameter determines the initial cropping position of the source image. Options include "center", "top", "bottom", "left", and "right". Choosing the correct position ensures that the most important part of the image is retained after cropping.
This integer parameter specifies the offset for the source crop position. It ranges from -2048 to 2048, with a default value of 0. Adjusting this offset allows for fine-tuning the cropping area to include or exclude specific parts of the image.
Similar to source_crop_pos
, this parameter sets the cropping position for the support image. Options are "center", "top", "bottom", "left", and "right". It ensures that the support image is cropped in alignment with the source image.
This integer parameter defines the offset for the support crop position, ranging from -2048 to 2048, with a default value of 0. It provides additional control over the cropping area of the support image.
This parameter specifies the interpolation method used for resizing the image. Options include "lanczos", "nearest", "bilinear", "bicubic", "area", and "nearest-exact". The choice of interpolation affects the quality and smoothness of the resized image.
This output parameter returns a tuple containing the settings used for cropping the image. It includes the source crop position, source crop offset, support crop position, support crop offset, and the interpolation method. These settings can be used to replicate the cropping process or for further image processing tasks.
source_crop_pos
to "center" to ensure the main subject remains in focus.source_crop_offset
and support_crop_offset
parameters to make minor adjustments and ensure that important elements are not cut off during cropping.crop_intpol
parameter is set to one of the valid options: "lanczos", "nearest", "bilinear", "bicubic", "area", or "nearest-exact".source_crop_offset
or support_crop_offset
to be within the range of -2048 to 2048.target_w
and target_h
values to be within the dimensions of the source image or use a higher resolution source image.© Copyright 2024 RunComfy. All Rights Reserved.