ComfyUI > Nodes > Comfyui_PDuse > PD:Image Crop Location

ComfyUI Node: PD:Image Crop Location

Class Name

PD_Image_Crop_Location

Category
PD_Image/Process
Author
7BEII (Account age: 453days)
Extension
Comfyui_PDuse
Latest Updated
2026-03-25
Github Stars
0.05K

How to Install Comfyui_PDuse

Install this extension via the ComfyUI Manager by searching for Comfyui_PDuse
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Comfyui_PDuse 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

PD:Image Crop Location Description

Facilitates precise image cropping by coordinates for focused composition and analysis.

PD:Image Crop Location:

The PD_Image_Crop_Location node is designed to facilitate precise image cropping based on specified coordinates and dimensions. This node is particularly useful for AI artists who need to focus on specific areas of an image, allowing for enhanced control over the composition and framing of visual elements. By providing the ability to crop images at designated locations, this node helps in isolating parts of an image for further processing or analysis, ensuring that only the most relevant sections are retained. This functionality is essential for tasks that require detailed attention to specific image regions, such as creating thumbnails, preparing images for machine learning models, or simply enhancing the aesthetic appeal of a visual piece.

PD:Image Crop Location Input Parameters:

image

The image parameter represents the input image tensor that you wish to crop. This tensor is typically in the format [B, H, W, C], where B is the batch size, H is the height, W is the width, and C is the number of color channels. The image serves as the primary data source for the cropping operation, and its dimensions will determine the available area for cropping.

x

The x parameter specifies the horizontal starting point for the crop. It determines the left boundary of the cropping rectangle. The value of x should be within the range of the image's width, ensuring that the crop does not exceed the image's boundaries. This parameter is crucial for defining the horizontal position of the cropped area.

y

The y parameter defines the vertical starting point for the crop, setting the top boundary of the cropping rectangle. Similar to the x parameter, y should be within the range of the image's height to ensure a valid cropping operation. This parameter is essential for positioning the cropped area vertically within the image.

width

The width parameter indicates the width of the cropping rectangle. It determines how much of the image will be retained horizontally from the starting x position. The width should be chosen carefully to ensure that the cropped area captures the desired content without exceeding the image's boundaries.

height

The height parameter specifies the height of the cropping rectangle, determining the vertical extent of the cropped area from the starting y position. Like the width, the height should be selected to encompass the desired image content while staying within the image's dimensions.

PD:Image Crop Location Output Parameters:

Result

The Result parameter is the output of the cropping operation, providing the cropped image tensor. This tensor retains the format [B, H, W, C], but with dimensions adjusted according to the specified width and height parameters. The cropped image is a focused representation of the original image, containing only the area defined by the input parameters. This output is crucial for further image processing tasks or for direct use in applications where a specific image region is required.

PD:Image Crop Location Usage Tips:

  • Ensure that the x and y parameters are set within the image's dimensions to avoid errors and ensure a valid crop.
  • Use the width and height parameters to precisely define the area of interest, keeping in mind the aspect ratio and composition of the cropped image.

PD:Image Crop Location Common Errors and Solutions:

IndexError: index out of range

  • Explanation: This error occurs when the x, y, width, or height parameters result in a cropping area that exceeds the image's dimensions.
  • Solution: Verify that the x and y starting points, along with the width and height, are within the bounds of the image. Adjust these parameters to ensure the cropping rectangle fits within the image's size.

ValueError: Invalid image tensor format

  • Explanation: This error indicates that the input image tensor does not conform to the expected format [B, H, W, C].
  • Solution: Check the format of the input image tensor and ensure it matches the required dimensions. Convert or reshape the tensor if necessary to meet the expected format.

PD:Image Crop Location Related Nodes

Go back to the extension to check out more related nodes.
Comfyui_PDuse
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.