Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI-CustomNodeKit > 交互式批量裁剪

ComfyUI Node: 交互式批量裁剪

Class Name

InteractiveBatchCrop

Category
Custom Nodes/Interactive
Author
user2318 (Account age: 2574days)
Extension
ComfyUI-CustomNodeKit
Latest Updated
2026-07-16
Github Stars
0.05K

How to Install ComfyUI-CustomNodeKit

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

交互式批量裁剪 Description

Facilitates batch image cropping with interactive control for AI dataset preparation, streamlining preprocessing for consistency and efficiency.

交互式批量裁剪:

The InteractiveBatchCrop node is designed to facilitate the batch processing of images by allowing you to interactively crop multiple images at once. This node is particularly beneficial for AI artists who need to prepare large datasets of images for training or other purposes, as it automates the cropping process while providing flexibility in defining crop parameters. By leveraging this node, you can efficiently handle image batches, ensuring that each image is cropped to the desired dimensions and filled with a specified color if necessary. The node supports both tensor-based and file path-based image sources, making it versatile for different workflows. Its primary goal is to streamline the image preprocessing stage, saving you time and effort while maintaining consistency across your image dataset.

交互式批量裁剪 Input Parameters:

crop_params

The crop_params parameter is a JSON string that defines the cropping parameters for the batch of images. It includes details such as the x and y coordinates for the crop (crop_x, crop_y), the width and height of the crop (crop_w, crop_h), the x and y coordinates of the image (img_x, img_y), and the fill color to use for areas outside the crop (fill_color). This parameter is crucial as it dictates how each image in the batch will be cropped and filled, impacting the final output. There are no explicit minimum or maximum values, but the values should be within the dimensions of the images being processed.

images

The images parameter is an optional input that allows you to provide a batch of images in tensor format. When this parameter is used, the node processes the images directly from the tensor, bypassing the need for file paths. This is useful when working with images already loaded into memory, enabling faster processing. The default value is None, and if not provided, the path parameter must be used.

path

The path parameter specifies the directory path where the images to be processed are located. It is used when images are not provided in tensor format. The node will search for image files within this directory, supporting common formats such as .png, .jpg, .jpeg, .bmp, and .webp. This parameter is essential when working with images stored on disk, and it must be a valid directory path.

node_id

The node_id parameter is a unique identifier for the node instance. It is used to manage caching of processed outputs, ensuring that results can be efficiently retrieved without redundant processing. This parameter is particularly useful in workflows where the same node configuration is used repeatedly, as it helps optimize performance by leveraging cached results.

target_size

The target_size parameter defines the desired output size for the cropped images. It is used to resize the cropped images to a consistent size, which is important for maintaining uniformity across the dataset. This parameter should be specified in the format width,height, and it ensures that all output images meet the specified dimensions.

max_preview

The max_preview parameter determines the maximum number of images to preview after processing. It is useful for quickly verifying the results of the cropping operation without having to inspect the entire batch. The default value is 10, providing a balance between performance and usability.

交互式批量裁剪 Output Parameters:

cropped_images

The cropped_images output parameter contains the batch of images that have been processed and cropped according to the specified parameters. Each image in this batch is resized and filled as needed, ensuring consistency with the defined crop parameters. This output is crucial for further processing or analysis, as it provides the final, ready-to-use images.

交互式批量裁剪 Usage Tips:

  • Ensure that the crop_params JSON string is correctly formatted and includes all necessary parameters to avoid processing errors.
  • When working with large datasets, consider using the path parameter to load images from disk, which can help manage memory usage more effectively.
  • Utilize the max_preview parameter to quickly verify the results of your cropping operation, allowing you to make adjustments before processing the entire batch.

交互式批量裁剪 Common Errors and Solutions:

"没有找到符合要求的图片"

  • Explanation: This error occurs when no images matching the specified criteria are found in the provided directory path.
  • Solution: Verify that the path parameter is correct and that the directory contains images in supported formats.

"必须提供 images 或有效的 path"

  • Explanation: This error indicates that neither the images parameter nor a valid path was provided, leaving the node without a source of images to process.
  • Solution: Ensure that you provide either a batch of images in tensor format via the images parameter or a valid directory path using the path parameter.

"没有有效图片可处理"

  • Explanation: This error suggests that none of the images in the batch met the processing criteria, possibly due to size mismatches or other issues.
  • Solution: Check the dimensions and formats of the images in your batch to ensure they meet the node's requirements, and adjust the crop_params as needed.

交互式批量裁剪 Related Nodes

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

交互式批量裁剪