ComfyUI > Nodes > Comfyui_PDuse > PD:Image centerCrop

ComfyUI Node: PD:Image centerCrop

Class Name

PD_Image_centerCrop

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 centerCrop Description

Center crops image tensors to specified dimensions, focusing on central content for design.

PD:Image centerCrop:

The PD_Image_centerCrop node is designed to perform a center crop operation on an image tensor, ensuring that the resulting image is centered and cropped according to specified dimensions. This node is particularly useful for artists and designers who need to focus on the central part of an image, removing unwanted edges while maintaining the core content. By dynamically adjusting the width and height of the crop, this node allows for precise control over the final image composition, making it an essential tool for image preprocessing in various creative workflows.

PD:Image centerCrop Input Parameters:

image

The image parameter is the input image tensor that you want to crop. It must be a four-dimensional tensor with the shape [B, H, W, C], where B is the batch size, H is the height, W is the width, and C is the number of channels. This parameter is crucial as it provides the raw data that will be processed by the node.

W

The W parameter specifies the width to be cropped from each side of the image. It is an integer value with a default of 0, and it can range from 0 to 10,000,000. This parameter determines how much of the image's width will be removed from both the left and right sides, effectively controlling the horizontal focus of the cropped image.

H

The H parameter defines the height to be cropped from the top and bottom of the image. Similar to W, it is an integer value with a default of 0, and it can range from 0 to 10,000,000. This parameter controls the vertical focus of the cropped image by specifying how much of the image's height will be removed from both the top and bottom.

PD:Image centerCrop Output Parameters:

Result

The Result parameter is the output of the node, which is the cropped image tensor. This tensor retains the original batch size and number of channels but has reduced dimensions [B, H', W', C] based on the specified W and H values. The Result provides the final processed image, centered and cropped according to your specifications, ready for further use in your creative projects.

PD:Image centerCrop Usage Tips:

  • Ensure that the input image tensor is in the correct format [B, H, W, C] to avoid errors during processing.
  • Use the W and H parameters to fine-tune the focus of your image, especially when you want to highlight specific central elements.
  • Start with smaller values for W and H to gradually adjust the crop and avoid removing too much of the image content.

PD:Image centerCrop Common Errors and Solutions:

"输入图像张量必须是 4 维的 [B, H, W, C]"

  • Explanation: This error occurs when the input image tensor does not have the required four dimensions.
  • Solution: Verify that your input image tensor is formatted as [B, H, W, C] before passing it to the node.

"W 的值无效,必须满"

  • Explanation: This error indicates that the W value is invalid, likely because it is negative or too large.
  • Solution: Ensure that W is a non-negative integer and does not exceed half of the image's width. Adjust the value accordingly to fit within the valid range.

PD:Image centerCrop 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 centerCrop