ComfyUI > Nodes > ComfyUI_KimNodes > 🍒Edge_Element_Cropper✀边缘元素裁剪

ComfyUI Node: 🍒Edge_Element_Cropper✀边缘元素裁剪

Class Name

Edge_Element_Cropper

Category
🍒 Kim-Nodes/✂ Crop | 裁剪工具
Author
Kim (Account age: 2536days)
Extension
ComfyUI_KimNodes
Latest Updated
2025-09-22
Github Stars
0.05K

How to Install ComfyUI_KimNodes

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

🍒Edge_Element_Cropper✀边缘元素裁剪 Description

The node intelligently crops images by detecting and isolating elements based on their edges.

🍒Edge_Element_Cropper✀边缘元素裁剪:

The Edge_Element_Cropper node is designed to intelligently crop images by identifying and isolating specific elements within an image based on their edges. This node leverages advanced image processing techniques to detect contours and boundaries, allowing you to focus on particular areas of interest within an image. By using morphological operations, it enhances the precision of the detected regions, ensuring that the cropped output is both accurate and visually appealing. This node is particularly beneficial for tasks that require precise element extraction, such as preparing images for further processing or analysis, and it provides a streamlined approach to handling complex image cropping tasks without requiring extensive manual intervention.

🍒Edge_Element_Cropper✀边缘元素裁剪 Input Parameters:

原始图片

This parameter represents the original image that you want to process. It should be provided as a tensor, and the node will handle the conversion to a suitable format for processing. The original image serves as the base from which elements will be detected and cropped.

蒙版图片

The mask image is used to guide the cropping process by highlighting the areas of interest. It should also be provided as a tensor. The mask helps in identifying the specific regions within the original image that need to be focused on, ensuring that the cropping is precise and relevant to the desired elements.

百分比扩展

This parameter allows you to specify a percentage by which the detected edges should be expanded. It is a float value, with a default of 0.0, meaning no expansion. Increasing this value will result in a larger cropped area around the detected elements, which can be useful if you want to include some surrounding context in the cropped output.

最小扩展像素

This parameter sets the minimum number of pixels by which the detected edges should be expanded, regardless of the percentage expansion. It is an integer value, with a default of 0. This ensures that even if the percentage expansion is small, the cropped area will still be expanded by at least this number of pixels, providing a buffer around the detected elements.

🍒Edge_Element_Cropper✀边缘元素裁剪 Output Parameters:

new_im_tensor

This output is the tensor representation of the newly cropped image. It contains the elements extracted from the original image, centered within a new image canvas. This output is crucial for further processing or analysis, as it isolates the desired elements from the rest of the image.

vis_result

The visual result is a tensor that provides a visualization of the detected contours on the original image. It is useful for verifying the accuracy of the edge detection and understanding how the cropping was performed. This output helps in assessing the effectiveness of the node's processing.

alpha_tensor

The alpha tensor is a mask that represents the transparency of the cropped image. It indicates which parts of the new image are part of the original content and which are transparent. This output is essential for applications that require compositing or layering of images, as it provides a clear delineation of the cropped elements.

🍒Edge_Element_Cropper✀边缘元素裁剪 Usage Tips:

  • Ensure that the mask image accurately highlights the areas of interest to achieve precise cropping results.
  • Adjust the 百分比扩展 and 最小扩展像素 parameters to include additional context around the detected elements if needed.
  • Use the vis_result output to verify the accuracy of the edge detection and make adjustments to the input parameters if necessary.

🍒Edge_Element_Cropper✀边缘元素裁剪 Common Errors and Solutions:

未检测到元素

  • Explanation: This error occurs when the node fails to detect any contours or elements within the provided mask image.
  • Solution: Ensure that the mask image is correctly highlighting the areas of interest and that it is in the correct format. You may need to adjust the mask or use a different image to achieve better results.

🍒Edge_Element_Cropper✀边缘元素裁剪 Related Nodes

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