ComfyUI > Nodes > WAS Node Suite > Bounded Image Crop

ComfyUI Node: Bounded Image Crop

Class Name

Bounded Image Crop

Category
WAS Suite/Image/Bound
Author
WASasquatch (Account age: 4688days)
Extension
WAS Node Suite
Latest Updated
2024-08-25
Github Stars
1.07K

How to Install WAS Node Suite

Install this extension via the ComfyUI Manager by searching for WAS Node Suite
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter WAS Node Suite 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Bounded Image Crop Description

Crop images based on specified bounding coordinates for precise manipulation and isolation of regions, supporting batch processing.

Bounded Image Crop:

The Bounded Image Crop node is designed to crop images based on specified bounding coordinates, allowing you to focus on specific regions of interest within an image. This node is particularly useful for tasks that require precise image manipulation, such as isolating objects or regions for further processing or analysis. By providing bounding coordinates, you can ensure that only the desired portion of the image is retained, which can be beneficial for improving the efficiency and accuracy of subsequent image processing steps. The node supports batch processing, making it suitable for handling multiple images simultaneously.

Bounded Image Crop Input Parameters:

image

This parameter represents the input image or a batch of images that you want to crop. The image should be in a tensor format, and the node will handle both single images and batches of images. The cropping operation will be applied to each image in the batch based on the corresponding bounding coordinates provided.

image_bounds

This parameter specifies the bounding coordinates for cropping the image. The bounds should be provided as a list of tuples, where each tuple contains four values: rmin, rmax, cmin, and cmax. These values represent the minimum and maximum row indices and the minimum and maximum column indices, respectively. The bounds determine the region of the image that will be retained after cropping. If the number of bounds does not match the number of images, the first set of bounds will be used for all images.

Bounded Image Crop Output Parameters:

IMAGE

The output of this node is a tensor containing the cropped images. Each image in the output tensor corresponds to an input image that has been cropped based on the specified bounding coordinates. The cropped images retain the same number of channels as the input images, ensuring that the color information is preserved.

Bounded Image Crop Usage Tips:

  • Ensure that the bounding coordinates provided in image_bounds are within the dimensions of the input image to avoid errors.
  • Use this node to isolate specific regions of interest in an image, which can be useful for tasks such as object detection, segmentation, or feature extraction.
  • When working with batches of images, make sure that the number of bounding coordinates matches the number of images to apply different crops to each image.

Bounded Image Crop Common Errors and Solutions:

Invalid bounds provided. Please make sure the bounds are within the image dimensions.

  • Explanation: This error occurs when the specified bounding coordinates are outside the dimensions of the input image.
  • Solution: Verify that the rmin, rmax, cmin, and cmax values are within the valid range for the image dimensions. Adjust the bounds to ensure they fall within the image size.

The cropping region has non-zero width and height.

  • Explanation: This error occurs when the calculated cropping region has zero or negative width or height.
  • Solution: Check the values for top, left, right, and bottom to ensure they define a valid cropping region. Adjust the values to create a region with positive width and height.

Bounded Image Crop Related Nodes

Go back to the extension to check out more related nodes.
WAS Node Suite
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.