ComfyUI > Nodes > ComfyUI > Center Crop Images

ComfyUI Node: Center Crop Images

Class Name

CenterCropImages

Category
dataset/image
Author
ComfyAnonymous (Account age: 763days)
Extension
ComfyUI
Latest Updated
2026-05-13
Github Stars
112.77K

How to Install ComfyUI

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

Center Crop Images Description

Efficiently crop images to specified dimensions from the center for consistency in datasets and machine learning tasks.

Center Crop Images:

The CenterCropImages node is designed to precisely crop images from the center to specified dimensions, ensuring that the most central part of the image is retained. This node is particularly useful when you want to focus on the central subject of an image or when you need to standardize the size of images for further processing or analysis. By cropping images to a uniform size, it helps in maintaining consistency across datasets, which is crucial for tasks like training machine learning models. The node automatically calculates the cropping area based on the input dimensions, making it user-friendly and efficient for batch processing of images.

Center Crop Images Input Parameters:

width

The width parameter specifies the desired width of the cropped image. It determines how wide the central portion of the image will be after cropping. The minimum value for this parameter is 1, the maximum is 8192, and the default is set to 512. Adjusting this parameter allows you to control the horizontal extent of the cropped area, which can be useful for focusing on specific details or ensuring compatibility with other image processing tasks.

height

The height parameter defines the desired height of the cropped image. It controls the vertical extent of the central portion of the image that will be retained after cropping. Similar to the width parameter, the minimum value is 1, the maximum is 8192, and the default is 512. By modifying this parameter, you can tailor the cropping to suit the aspect ratio or specific requirements of your project.

Center Crop Images Output Parameters:

image

The output parameter is the cropped image itself. This image is the result of the center cropping operation, where the central part of the original image is extracted based on the specified width and height. The output image retains the central features of the original, making it ideal for applications where the focus is on the main subject or when preparing images for uniformity in datasets.

Center Crop Images Usage Tips:

  • To ensure that the central subject of your image is retained, set the width and height parameters to values that match the aspect ratio of the original image as closely as possible.
  • Use this node to preprocess images for machine learning models that require input images of a specific size, ensuring consistency across your dataset.

Center Crop Images Common Errors and Solutions:

Image size is smaller than crop dimensions

  • Explanation: This error occurs when the specified crop dimensions (width or height) exceed the dimensions of the original image.
  • Solution: Ensure that the width and height parameters are set to values less than or equal to the dimensions of the original image to avoid this error.

Invalid input type

  • Explanation: This error might occur if the input image is not in the expected format or type.
  • Solution: Verify that the input image is correctly formatted and compatible with the node's requirements, typically as a tensor or PIL image.

Center Crop Images Related Nodes

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

Center Crop Images