ComfyUI > Nodes > Comfyui_PDuse > PD:Image Crop V1

ComfyUI Node: PD:Image Crop V1

Class Name

PDimage_corp_v1

Category
PD/ImageProcessing
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 V1 Description

PDimage_corp_v1 enables precise image and mask cropping in ComfyUI by defining ratios and directions.

PD:Image Crop V1:

PDimage_corp_v1 is a specialized node designed to facilitate the cropping of images within the ComfyUI framework. This node allows you to extract specific segments of an image based on defined ratios and directions, providing flexibility in how images are manipulated and utilized in your projects. By specifying the axis and direction for cropping, you can easily isolate parts of an image for further processing or analysis. This capability is particularly beneficial for AI artists who need to focus on particular areas of an image, whether for artistic effect or data preparation. The node supports both image and mask cropping, ensuring that any associated masks are accurately adjusted alongside the image. This ensures consistency and accuracy in image processing tasks, making PDimage_corp_v1 a valuable tool for precise image manipulation.

PD:Image Crop V1 Input Parameters:

img

The img parameter represents the input image that you wish to crop. It is essential for the node's operation as it provides the visual data that will be manipulated. The image should be in a format compatible with the node's processing capabilities, typically a tensor format as used in PyTorch.

msk

The msk parameter is an optional input that represents a mask associated with the image. If provided, this mask will be cropped in tandem with the image, ensuring that any segmentation or masking information remains aligned with the cropped image segment. This is particularly useful for tasks that involve image segmentation or where masks are used to highlight specific areas of interest.

axis

The axis parameter determines the axis along which the image will be cropped. It can be set to either "x" or "y", indicating whether the cropping should occur horizontally or vertically. This parameter is crucial for defining the orientation of the crop and directly impacts the resulting image segment.

direction

The direction parameter specifies the direction from which the image will be cropped. Depending on the chosen axis, this can be "left" or "right" for horizontal cropping, and "top" or "bottom" for vertical cropping. This parameter allows you to control which part of the image is retained and which part is discarded.

ratio_a

The ratio_a parameter is part of the ratio that defines the size of the cropped segment. It works in conjunction with ratio_b to determine the proportion of the image that will be retained. This parameter allows for precise control over the size of the cropped area.

ratio_b

The ratio_b parameter complements ratio_a to form a ratio that dictates the size of the cropped segment. By adjusting these two parameters, you can finely tune the dimensions of the cropped image, allowing for flexible and targeted image manipulation.

PD:Image Crop V1 Output Parameters:

out_img

The out_img parameter is the primary output of the node, representing the cropped image segment. This output is a tensor that contains the portion of the original image specified by the input parameters. It is the main result of the cropping operation and can be used for further processing or analysis.

out_mask

The out_mask parameter is an optional output that contains the cropped mask, if a mask was provided as input. This ensures that any segmentation or masking information remains consistent with the cropped image. If no mask was provided, this output will be None.

PD:Image Crop V1 Usage Tips:

  • Ensure that the axis and direction parameters are set correctly to achieve the desired cropping orientation and position.
  • Use the ratio_a and ratio_b parameters to precisely control the size of the cropped segment, allowing for targeted image manipulation.
  • If working with masks, always provide the msk parameter to maintain alignment between the image and its mask.

PD:Image Crop V1 Common Errors and Solutions:

Image and mask dimension mismatch

  • Explanation: This error occurs when the dimensions of the image and mask do not match, which can lead to misalignment during cropping.
  • Solution: Ensure that the input image and mask have the same dimensions before passing them to the node.

Invalid axis or direction value

  • Explanation: This error arises when an unsupported value is provided for the axis or direction parameters.
  • Solution: Verify that the axis is set to either "x" or "y" and the direction is set to a valid option based on the axis ("left" or "right" for "x", "top" or "bottom" for "y").

PD:Image Crop V1 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.

PD:Image Crop V1