ComfyUI > Nodes > Mikey Nodes > Batch Crop Image (Mikey)

ComfyUI Node: Batch Crop Image (Mikey)

Class Name

Batch Crop Image

Category
Mikey/Image
Author
bash-j (Account age: 4196days)
Extension
Mikey Nodes
Latest Updated
2024-06-15
Github Stars
0.08K

How to Install Mikey Nodes

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

Batch Crop Image (Mikey) Description

Automate batch cropping of images in various formats for efficiency and consistency in preprocessing tasks.

Batch Crop Image (Mikey):

The Batch Crop Image node is designed to streamline the process of cropping multiple images in a directory. This node is particularly useful for AI artists who need to prepare a large number of images for further processing or analysis. By specifying a directory and a crop amount, you can automatically crop all images within that directory, ensuring uniformity and saving significant time compared to manual cropping. The node supports various image formats, including PNG, JPG, JPEG, WEBP, BMP, and GIF, making it versatile for different types of projects. The primary goal of this node is to enhance efficiency and consistency in image preprocessing tasks.

Batch Crop Image (Mikey) Input Parameters:

image_directory

This parameter specifies the directory containing the images you want to crop. It should be a string representing the path to the directory. The node will process all supported image files within this directory. Ensure that the directory exists and contains the images you wish to crop. If the directory does not exist, an error will be raised.

crop_amount

This parameter determines the amount to crop from each side of the image. It is a float value representing the percentage of the image's width to be cropped. The default value is 0.05 (5%). Adjusting this value will change how much of the image is cropped from each side, allowing for precise control over the final image dimensions.

Batch Crop Image (Mikey) Output Parameters:

image

The output is a list of cropped images. Each image in the list is processed according to the specified crop amount. The images are returned in a format suitable for further processing or analysis within your workflow. This output ensures that all images have been uniformly cropped, maintaining consistency across your dataset.

Batch Crop Image (Mikey) Usage Tips:

  • Ensure that the image_directory parameter points to a valid directory containing the images you want to crop.
  • Adjust the crop_amount parameter to achieve the desired cropping effect. A smaller value will result in less cropping, while a larger value will crop more of the image.
  • Use this node as a preprocessing step before feeding images into other nodes or models to ensure uniformity and consistency in your dataset.

Batch Crop Image (Mikey) Common Errors and Solutions:

Image directory <directory_path> does not exist

  • Explanation: This error occurs when the specified image directory does not exist.
  • Solution: Verify that the image_directory parameter is correctly set to an existing directory path.

Unsupported image format

  • Explanation: This error occurs if the directory contains files that are not in the supported image formats (PNG, JPG, JPEG, WEBP, BMP, GIF).
  • Solution: Ensure that all files in the directory are in one of the supported formats. Remove or convert any unsupported files.

Insufficient crop amount

  • Explanation: This error occurs if the crop_amount parameter is set too high, resulting in an invalid crop size.
  • Solution: Adjust the crop_amount parameter to a lower value to ensure that the cropped dimensions are valid.

Batch Crop Image (Mikey) Related Nodes

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