Visit ComfyUI Online for ready-to-use ComfyUI environment
Versatile image cropping node with dynamic crop area selection and mask generation for ComfyUI framework.
OlmDragCrop is a versatile node designed to facilitate the cropping of images within the ComfyUI framework. Its primary function is to allow users to define specific areas of an image to be cropped, either by manually setting the crop dimensions or by automatically adjusting to changes in image resolution. This node is particularly beneficial for AI artists who need to focus on particular sections of an image for further processing or analysis. By providing a dynamic cropping mechanism, OlmDragCrop ensures that the selected image area is accurately extracted, even when the image size changes. This capability is crucial for maintaining consistency in image processing workflows, especially when dealing with batch processing or varying image dimensions. The node also supports the generation of a mask for the cropped area, which can be used for further image manipulation tasks.
This parameter specifies the version of the drawing or image processing operation. It is a string with a default value of "init". This parameter helps in managing different versions of the image processing pipeline, ensuring that the correct version is applied during execution.
The image parameter is the input image tensor that you want to crop. It is essential for the node's operation as it provides the data that will be processed. The image should be in a format compatible with PyTorch tensors.
This integer parameter defines the left boundary of the crop area. It has a default value of 0 and can range from 0 to 8192. Adjusting this value will shift the left edge of the crop area horizontally across the image.
Similar to crop_left, this integer parameter sets the right boundary of the crop area. It also ranges from 0 to 8192, with a default of 0. This value determines how far the right edge of the crop extends.
This parameter specifies the top boundary of the crop area. It is an integer with a default value of 0, and it can be set between 0 and 8192. Modifying this value will move the top edge of the crop area vertically.
This integer parameter sets the bottom boundary of the crop area, with a default value of 0 and a range from 0 to 8192. It controls the vertical extent of the crop area from the top.
The crop_width parameter defines the width of the crop area. It is an integer with a default value of 512, and it can range from 1 to 8192. This parameter is crucial for determining the horizontal size of the cropped section.
This parameter specifies the height of the crop area. It is an integer with a default value of 512, and it can range from 1 to 8192. It determines the vertical size of the cropped section.
This integer parameter represents the width of the image from the previous operation. It has a default value of 0 and is used to detect changes in image resolution, which can trigger a reset of the crop area.
Similar to last_width, this parameter indicates the height of the image from the previous operation. It is an integer with a default value of 0 and helps in identifying resolution changes.
The mask parameter is optional and allows you to provide a mask tensor that defines specific areas of the image to be included or excluded from the crop. This can be useful for advanced image processing tasks where selective cropping is required.
This output is the cropped image tensor, which contains the section of the original image defined by the crop parameters. It is the primary result of the node's operation and can be used for further processing or analysis.
The MASK output is the cropped mask tensor, which corresponds to the cropped area of the image. It is useful for tasks that require additional image manipulation or analysis based on specific regions.
This output is a JSON string that contains detailed information about the crop operation, including the crop boundaries and dimensions. It provides a structured representation of the crop parameters, which can be used for logging or further processing.
RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.