ComfyUI > Nodes > Olm DragCrop for ComfyUI > Olm Drag Crop

ComfyUI Node: Olm Drag Crop

Class Name

OlmDragCrop

Category
image/transform
Author
o-l-l-i (Account age: 3012days)
Extension
Olm DragCrop for ComfyUI
Latest Updated
2025-09-02
Github Stars
0.07K

How to Install Olm DragCrop for ComfyUI

Install this extension via the ComfyUI Manager by searching for Olm DragCrop for ComfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Olm DragCrop for ComfyUI in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Olm Drag Crop Description

Versatile image cropping node with dynamic crop area selection and mask generation for ComfyUI framework.

Olm Drag Crop:

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.

Olm Drag Crop Input Parameters:

drawing_version

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.

image

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.

crop_left

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.

crop_right

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.

crop_top

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.

crop_bottom

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.

crop_width

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.

crop_height

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.

last_width

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.

last_height

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.

mask

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.

Olm Drag Crop Output Parameters:

IMAGE

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.

MASK

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.

CROP_JSON

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.

Olm Drag Crop Usage Tips:

  • Ensure that the crop boundaries (left, right, top, bottom) are set within the image dimensions to avoid errors and ensure accurate cropping.
  • Utilize the mask parameter to selectively crop specific areas of the image, which can be particularly useful for complex image processing tasks.
  • Monitor the last_width and last_height parameters to detect changes in image resolution and adjust the crop settings accordingly.

Olm Drag Crop Common Errors and Solutions:

Error invalid crop area → Resetting to full image.

  • Explanation: This error occurs when the specified crop area is invalid, such as when the crop boundaries exceed the image dimensions or when the crop width or height is zero or negative.
  • Solution: Ensure that the crop boundaries are within the image dimensions and that the crop width and height are positive values. Adjust the crop parameters to fit within the image size.

Error saving preview image

  • Explanation: This error indicates a problem with saving the preview image to the specified file path, possibly due to file system permissions or an invalid path.
  • Solution: Check the file path and ensure that the directory exists and has the necessary write permissions. Verify that the file path is correctly specified and accessible.

Olm Drag Crop Related Nodes

Go back to the extension to check out more related nodes.
Olm DragCrop for ComfyUI
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

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.